Skip to content

Commit 6fcefe7

Browse files
authored
prepare 3.0.7 release (#207)
## [3.0.7] - 2023-07-11 ### Changed: - This release introduces rollup to bundle the build output. The bundle is minified and supports both cjs and esm.
2 parents 2c83830 + 9854a95 commit 6fcefe7

File tree

10 files changed

+87
-11
lines changed

10 files changed

+87
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## LaunchDarkly overview
66

7-
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
7+
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
88

99
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
1010

@@ -22,7 +22,7 @@ Please note that the React SDK has two special requirements in terms of your Lau
2222

2323
## Learn more
2424

25-
Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/react-sdk-reference) or our [code-generated API documentation](https://launchdarkly.github.io/react-client-sdk/).
25+
Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/react-sdk-reference) or our [code-generated API documentation](https://launchdarkly.github.io/react-client-sdk/).
2626

2727
This SDK builds upon the [JavaScript SDK](https://github.com/launchdarkly/js-client-sdk), supporting all of the same functionality, but using React's Context API to provide additional conveniences. While using this SDK you may need to directly interact with the underlying JavaScript SDK. For more information on how to use the JavaScript SDK and its characteristics, see the [SDK's README](https://github.com/launchdarkly/js-client-sdk/blob/main/README.md).
2828

docs/typedoc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
let version = process.env.VERSION;
2+
if (!version) {
3+
const package = require('../package.json');
4+
version = package.version;
5+
}
6+
17
module.exports = {
28
out: '/tmp/project-releaser/project/docs/build/html',
39
exclude: [
410
'**/node_modules/**',
511
'test-types.ts'
612
],
7-
name: "LaunchDarkly React SDK (2.25.0)",
13+
name: `LaunchDarkly React SDK (${version})`,
814
readme: 'none', // don't add a home page with a copy of README.md
915
entryPoints: "/tmp/project-releaser/project/src/index.ts",
1016
entryPointStrategy: "expand"

examples/typescript/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24-
25-
public

examples/typescript/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"start": "react-scripts start",
2323
"build": "react-scripts build",
2424
"test": "react-scripts test",
25-
"eject": "react-scripts eject"
25+
"eject": "react-scripts eject",
26+
"postinstall": "cd ../../ && yarn link-dev",
27+
"tsc": "tsc"
2628
},
2729
"eslintConfig": {
2830
"extends": [
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang='en'>
3+
<head>
4+
<meta charset='UTF-8'>
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
</body>
10+
</html>

package.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"sdk",
1313
"bindings"
1414
],
15-
"main": "lib/index.js",
15+
"exports": {
16+
"require": "./lib/cjs/index.js",
17+
"import": "./lib/esm/index.js"
18+
},
19+
"main": "./lib/cjs/index.js",
1620
"types": "lib/index.d.ts",
1721
"files": [
1822
"lib",
@@ -23,7 +27,10 @@
2327
"scripts": {
2428
"test": "jest",
2529
"test:junit": "jest --ci --reporters=default --reporters=jest-junit",
26-
"build": "rimraf lib/* && tsc && mv lib/src/* lib && rimraf lib/package.json lib/src lib/*.test.*",
30+
"clean": "rimraf lib/*",
31+
"rb": "rollup -c --configPlugin typescript",
32+
"rbw": "yarn rb --watch",
33+
"build": "yarn clean && yarn rb",
2734
"lint": "tslint -p tsconfig.json 'src/**/*.ts*'",
2835
"lint:all": "npm run lint",
2936
"check-typescript": "tsc",
@@ -38,6 +45,10 @@
3845
},
3946
"homepage": "https://github.com/launchdarkly/react-client-sdk",
4047
"devDependencies": {
48+
"@rollup/plugin-json": "^6.0.0",
49+
"@rollup/plugin-node-resolve": "^15.1.0",
50+
"@rollup/plugin-terser": "^0.4.3",
51+
"@rollup/plugin-typescript": "^11.1.2",
4152
"@testing-library/jest-dom": "^5.16.4",
4253
"@testing-library/react": "^13.0.1",
4354
"@types/hoist-non-react-statics": "^3.3.1",
@@ -47,6 +58,7 @@
4758
"@types/react": "^18.0.3",
4859
"@types/react-dom": "^18.0.0",
4960
"@types/react-test-renderer": "^18.0.0",
61+
"esbuild": "^0.18.11",
5062
"jest": "^27.4.4",
5163
"jest-environment-jsdom": "^27.4.4",
5264
"jest-environment-jsdom-global": "^3.0.0",
@@ -57,6 +69,10 @@
5769
"react-dom": "^18.0.0",
5870
"react-test-renderer": "^18.0.0",
5971
"rimraf": "^3.0.0",
72+
"rollup": "^3.26.2",
73+
"rollup-plugin-dts": "^5.3.0",
74+
"rollup-plugin-esbuild": "^5.0.0",
75+
"rollup-plugin-filesize": "^10.0.0",
6076
"ts-jest": "^27.1.1",
6177
"tslint": "^6.1.3",
6278
"tslint-config-prettier": "^1.18.0",

rollup.config.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import dts from 'rollup-plugin-dts';
2+
import esbuild from 'rollup-plugin-esbuild';
3+
import filesize from 'rollup-plugin-filesize';
4+
import json from '@rollup/plugin-json';
5+
import resolve from '@rollup/plugin-node-resolve';
6+
import terser from '@rollup/plugin-terser';
7+
8+
const plugins = [resolve(), esbuild(), json(), terser(), filesize()];
9+
const external = /node_modules/;
10+
11+
export default [
12+
{
13+
input: 'src/index.ts',
14+
output: [
15+
{
16+
file: 'lib/cjs/index.js',
17+
format: 'cjs',
18+
sourcemap: true,
19+
},
20+
],
21+
plugins,
22+
external,
23+
},
24+
{
25+
input: 'src/index.ts',
26+
output: [
27+
{
28+
file: 'lib/esm/index.js',
29+
format: 'esm',
30+
sourcemap: true,
31+
},
32+
],
33+
plugins,
34+
external,
35+
},
36+
{
37+
input: 'src/index.ts',
38+
plugins: [dts(), json()],
39+
output: {
40+
file: 'lib/index.d.ts',
41+
format: 'es',
42+
},
43+
},
44+
];

src/initLDClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const wrapperOptions: LDOptions = {
1515
* @param clientSideID Your project and environment specific client side ID
1616
* @param context A LaunchDarkly context object
1717
* @param options LaunchDarkly initialization options
18-
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
18+
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only listen for changes to these flags.
1919
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
2020
*
2121
* @see `ProviderConfig` for more details about the parameters

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface ProviderConfig {
7878
reactOptions?: LDReactOptions;
7979

8080
/**
81-
* If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
81+
* If specified, `launchdarkly-react-client-sdk` will only listen for changes to these flags.
8282
* Otherwise, all flags will be requested and listened to.
8383
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
8484
*/

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const getFlattenedFlagsFromChangeset = (
5454
* Retrieves flag values.
5555
*
5656
* @param ldClient LaunchDarkly client
57-
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
57+
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only listen for changes to these flags.
5858
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
5959
*
6060
* @returns an `LDFlagSet` with the current flag values from LaunchDarkly filtered by `targetFlags`.

0 commit comments

Comments
 (0)