Skip to content

Commit

Permalink
prepare 3.0.7 release (#207)
Browse files Browse the repository at this point in the history
## [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.
  • Loading branch information
yusinto authored Jul 12, 2023
2 parents 2c83830 + 9854a95 commit 6fcefe7
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## LaunchDarkly overview

[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!
[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!

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

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

## Learn more

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/).
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/).

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).

Expand Down
8 changes: 7 additions & 1 deletion docs/typedoc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
let version = process.env.VERSION;
if (!version) {
const package = require('../package.json');
version = package.version;
}

module.exports = {
out: '/tmp/project-releaser/project/docs/build/html',
exclude: [
'**/node_modules/**',
'test-types.ts'
],
name: "LaunchDarkly React SDK (2.25.0)",
name: `LaunchDarkly React SDK (${version})`,
readme: 'none', // don't add a home page with a copy of README.md
entryPoints: "/tmp/project-releaser/project/src/index.ts",
entryPointStrategy: "expand"
Expand Down
2 changes: 0 additions & 2 deletions examples/typescript/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

public
4 changes: 3 additions & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"postinstall": "cd ../../ && yarn link-dev",
"tsc": "tsc"
},
"eslintConfig": {
"extends": [
Expand Down
10 changes: 10 additions & 0 deletions examples/typescript/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>Title</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"sdk",
"bindings"
],
"main": "lib/index.js",
"exports": {
"require": "./lib/cjs/index.js",
"import": "./lib/esm/index.js"
},
"main": "./lib/cjs/index.js",
"types": "lib/index.d.ts",
"files": [
"lib",
Expand All @@ -23,7 +27,10 @@
"scripts": {
"test": "jest",
"test:junit": "jest --ci --reporters=default --reporters=jest-junit",
"build": "rimraf lib/* && tsc && mv lib/src/* lib && rimraf lib/package.json lib/src lib/*.test.*",
"clean": "rimraf lib/*",
"rb": "rollup -c --configPlugin typescript",
"rbw": "yarn rb --watch",
"build": "yarn clean && yarn rb",
"lint": "tslint -p tsconfig.json 'src/**/*.ts*'",
"lint:all": "npm run lint",
"check-typescript": "tsc",
Expand All @@ -38,6 +45,10 @@
},
"homepage": "https://github.com/launchdarkly/react-client-sdk",
"devDependencies": {
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.2",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.1",
"@types/hoist-non-react-statics": "^3.3.1",
Expand All @@ -47,6 +58,7 @@
"@types/react": "^18.0.3",
"@types/react-dom": "^18.0.0",
"@types/react-test-renderer": "^18.0.0",
"esbuild": "^0.18.11",
"jest": "^27.4.4",
"jest-environment-jsdom": "^27.4.4",
"jest-environment-jsdom-global": "^3.0.0",
Expand All @@ -57,6 +69,10 @@
"react-dom": "^18.0.0",
"react-test-renderer": "^18.0.0",
"rimraf": "^3.0.0",
"rollup": "^3.26.2",
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-filesize": "^10.0.0",
"ts-jest": "^27.1.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
Expand Down
44 changes: 44 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import dts from 'rollup-plugin-dts';
import esbuild from 'rollup-plugin-esbuild';
import filesize from 'rollup-plugin-filesize';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';

const plugins = [resolve(), esbuild(), json(), terser(), filesize()];
const external = /node_modules/;

export default [
{
input: 'src/index.ts',
output: [
{
file: 'lib/cjs/index.js',
format: 'cjs',
sourcemap: true,
},
],
plugins,
external,
},
{
input: 'src/index.ts',
output: [
{
file: 'lib/esm/index.js',
format: 'esm',
sourcemap: true,
},
],
plugins,
external,
},
{
input: 'src/index.ts',
plugins: [dts(), json()],
output: {
file: 'lib/index.d.ts',
format: 'es',
},
},
];
2 changes: 1 addition & 1 deletion src/initLDClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const wrapperOptions: LDOptions = {
* @param clientSideID Your project and environment specific client side ID
* @param context A LaunchDarkly context object
* @param options LaunchDarkly initialization options
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only listen for changes to these flags.
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
*
* @see `ProviderConfig` for more details about the parameters
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface ProviderConfig {
reactOptions?: LDReactOptions;

/**
* If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
* If specified, `launchdarkly-react-client-sdk` will only listen for changes to these flags.
* Otherwise, all flags will be requested and listened to.
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const getFlattenedFlagsFromChangeset = (
* Retrieves flag values.
*
* @param ldClient LaunchDarkly client
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only listen for changes to these flags.
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
*
* @returns an `LDFlagSet` with the current flag values from LaunchDarkly filtered by `targetFlags`.
Expand Down

0 comments on commit 6fcefe7

Please sign in to comment.