Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError cannot redefine property: default #36

Closed
dan-hill-nutrien opened this issue May 23, 2020 · 6 comments
Closed

TypeError cannot redefine property: default #36

dan-hill-nutrien opened this issue May 23, 2020 · 6 comments

Comments

@dan-hill-nutrien
Copy link

When using withLDProvider in our react application using this code:

export default withLDProvider({ clientSideID: ${appConfig.launchDarklyId} })( App );

we are getting the following error:

`TypeError: application 'dxp-sidebar-app' died in status LOADING_SOURCE_CODE: Cannot redefine property: default
(anonymous function)
./node_modules/launchdarkly-react-client-sdk/lib/withLDProvider.js:34
31 | o[k2] = m[k];
32 | }));
33 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {

34 | Object.defineProperty(o, "default", { enumerable: true, value: v });
35 | }) : function(o, v) {
36 | o["default"] = v;
37 | });`

SDK version
2.18.1

@joeldenning
Copy link

This is caused by microsoft/TypeScript#38540 and occurs when the React module provided to react-client-sdk is an ES module instead of a CJS module.

This can happen when React is converted to an ES module by SystemJS. In that case, the following workaround can be employed to fix it:

<script src="https://cdn.jsdelivr.net/npm/systemjs/dist/system.js"></script>
<script>
  (function() {
    const originalInstantiate = System.constructor.prototype.instantiate;
    System.constructor.prototype.instantiate = function() {
      return originalInstantiate
        .apply(this, arguments)
        .then(function(register) {
          const originalFn = register[1];
          register[1] = function(_export) {
            _export("__esModule", true);
            return originalFn.apply(this, arguments);
          };
          return register;
        });
    };
  })();
</script>

@bwoskow-ld
Copy link
Member

Thank you @joeldenning for the response and workaround!

@dan-hill-nutrien - can you provide us with your TypeScript version? From my reading of the linked GitHub issue, this issue appears to have been introduced in TS 3.9.

@dan-hill-nutrien
Copy link
Author

Yes thank you @joeldenning the work around works like a charm!

@bwoskow-ld I am using typescript@3.6.3

@joeldenning
Copy link

joeldenning commented May 27, 2020

The relevant typescript version is the one used by launchdarkly's react-client-sdk:

"typescript": "^3.9.2"

Also note that this error only occurs with the esModuleInterop flag, as noted in the typescript issue I linked to above. Launch darkly is using that flag as shown here:

"esModuleInterop": true,

See lines 41 and 42 of https://unpkg.com/browse/launchdarkly-react-client-sdk@2.18.1/lib/withLDProvider.js, which show that the code published by launchdarkly to unpkg has the bug in it (due to typescript@3.9.2 compiling it in such a way where it's possible to throw an error).

Lines 41 and 42 are the ones throwing an error. The code I shared works around the error by causing the if statement on line 39 to short circuit.

The reason that the error is thrown is that any ESM version of react is an object with an enumerable property called default. Contrast that with the CJS version of react, which does not have a property on it called default.

The typescript runtime currently throws errors whenever a dependency has a default property without also having the __esModule property on it. Note that __esModule is not on standards track and is not present on real ES modules created by browsers. For that reason, SystemJS also does not apply the __esModule property to its modules, which are a close approximation to native ES module objects. The SystemJS-specific workaround I provided will forcibly apply the __esModule to all SystemJS modules, which works around the bug in typescript due to the check on line 39

The options I see:

  1. Use the workaround I provided above
  2. Downgrade typescript inside of react-client-sdk until the typescript bug has been fixed.
  3. Remove the esModuleInterop flag from react-client-sdk's tsconfig.json until the typescript bug has been fixed.

@bwoskow-ld
Copy link
Member

Thanks again @joeldenning for your guidance here.

@dan-hill-nutrien - we've released version 2.18.2 of the React SDK which downgrades to TypeScript 3.8.3 (or more specifically, ~3.8.3 so that the SDK isn't built with 3.9.x unless we explicitly update our dependencies to do so).

I also see that there is a TypeScript PR to fix the underlying issue. We'll pick that up in a future React SDK release.

Cheers,
Ben

@joeldenning
Copy link

This is now fixed in typescript@3.9.4, which is currently released under the dev dist-tag.

The react-client-sdk project should be able to upgrade from 3.8.3 to 3.9.4 without worry of regression.

LaunchDarklyReleaseBot added a commit that referenced this issue Feb 18, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Apr 15, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Apr 27, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 5, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

* Rename master to main (#56)

* Set sendEventsOnlyForVariation by default

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Update tests

* Move wrapper options into base options obj

* Target ES6

* Add tests for camel case cases

* Remove vestigial package

* Make targetFlags doc more clear

* Add error hook and handler

* Revert changes to original docs

* Add context and flags proxy util

* Use flags proxy and update tests

* Fixup

* Fixup

* Don't call variation when initializing

* Add option and failing test

* Passing test

* Remove incorrect comment and fix typo

* Update proxy's get trap

* except after c

* Remove unproxied flags from context

* Restore ldClient dec and clean up camelization

* Update src/types.ts

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Fixup

* Handle symbols

* Add type constraint to withLDProvider

* Remove getter setter

* Remove error handler and fix bad merge

* Update snapshots

* Update releaser config

* Fixup

* Update version of js-client-sdk used. (#82)

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Christie Williams <xie.williams@gmail.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 18, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

* Rename master to main (#56)

* Set sendEventsOnlyForVariation by default

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Update tests

* Move wrapper options into base options obj

* Target ES6

* Add tests for camel case cases

* Remove vestigial package

* Make targetFlags doc more clear

* Add error hook and handler

* Revert changes to original docs

* Add context and flags proxy util

* Use flags proxy and update tests

* Fixup

* Fixup

* Don't call variation when initializing

* Add option and failing test

* Passing test

* Remove incorrect comment and fix typo

* Update proxy's get trap

* except after c

* Remove unproxied flags from context

* Restore ldClient dec and clean up camelization

* Update src/types.ts

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Fixup

* Handle symbols

* Add type constraint to withLDProvider

* Remove getter setter

* Remove error handler and fix bad merge

* Update snapshots

* Update releaser config

* Fixup

* Update version of js-client-sdk used. (#82)

* Upgrade js-client-sdk version to 2.24.0 (#83)

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Christie Williams <xie.williams@gmail.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 21, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

* Rename master to main (#56)

* Set sendEventsOnlyForVariation by default

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Update tests

* Move wrapper options into base options obj

* Target ES6

* Add tests for camel case cases

* Remove vestigial package

* Make targetFlags doc more clear

* Add error hook and handler

* Revert changes to original docs

* Add context and flags proxy util

* Use flags proxy and update tests

* Fixup

* Fixup

* Don't call variation when initializing

* Add option and failing test

* Passing test

* Remove incorrect comment and fix typo

* Update proxy's get trap

* except after c

* Remove unproxied flags from context

* Restore ldClient dec and clean up camelization

* Update src/types.ts

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Fixup

* Handle symbols

* Add type constraint to withLDProvider

* Remove getter setter

* Remove error handler and fix bad merge

* Update snapshots

* Update releaser config

* Fixup

* Update version of js-client-sdk used. (#82)

* Upgrade js-client-sdk version to 2.24.0 (#83)

* Upgrade common to 2.24.2 (#84)

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Christie Williams <xie.williams@gmail.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Oct 28, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

* Rename master to main (#56)

* Set sendEventsOnlyForVariation by default

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Update tests

* Move wrapper options into base options obj

* Target ES6

* Add tests for camel case cases

* Remove vestigial package

* Make targetFlags doc more clear

* Add error hook and handler

* Revert changes to original docs

* Add context and flags proxy util

* Use flags proxy and update tests

* Fixup

* Fixup

* Don't call variation when initializing

* Add option and failing test

* Passing test

* Remove incorrect comment and fix typo

* Update proxy's get trap

* except after c

* Remove unproxied flags from context

* Restore ldClient dec and clean up camelization

* Update src/types.ts

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Fixup

* Handle symbols

* Add type constraint to withLDProvider

* Remove getter setter

* Remove error handler and fix bad merge

* Update snapshots

* Update releaser config

* Fixup

* Update version of js-client-sdk used. (#82)

* Upgrade js-client-sdk version to 2.24.0 (#83)

* Upgrade common to 2.24.2 (#84)

* Populate the context with the initial flag state and proxy. (#85)

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Christie Williams <xie.williams@gmail.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Dec 7, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

* Rename master to main (#56)

* Set sendEventsOnlyForVariation by default

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Update tests

* Move wrapper options into base options obj

* Target ES6

* Add tests for camel case cases

* Remove vestigial package

* Make targetFlags doc more clear

* Add error hook and handler

* Revert changes to original docs

* Add context and flags proxy util

* Use flags proxy and update tests

* Fixup

* Fixup

* Don't call variation when initializing

* Add option and failing test

* Passing test

* Remove incorrect comment and fix typo

* Update proxy's get trap

* except after c

* Remove unproxied flags from context

* Restore ldClient dec and clean up camelization

* Update src/types.ts

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Fixup

* Handle symbols

* Add type constraint to withLDProvider

* Remove getter setter

* Remove error handler and fix bad merge

* Update snapshots

* Update releaser config

* Fixup

* Update version of js-client-sdk used. (#82)

* Upgrade js-client-sdk version to 2.24.0 (#83)

* Upgrade common to 2.24.2 (#84)

* Populate the context with the initial flag state and proxy. (#85)

* [sc-178045] u2c changes for v3.0 release (#90)

* Update js sdk version to prerelease

* Renamed LDContext to ReactSdkContext

* Added context to provider config. Replaced LDUser with context in init client function. Deprecated user prop in provider config.

* Added getContextOrUser helper function. Replaced user props with getContextOrUser function.

* Update js sdk to v3 alpha 2 to fix messages error

* Replaced LDUser with LDContext. Added kind prop to test cases.

* Update circleci node image version

* Renamed wording "user" to "context". Added more test cases for provider.

* Added more unit tests to cover backwards compatibility and new context. Renamed user to context in test data and comments.

* Force async example to use js sdk alpha version

* Update package.json

* Add manual resolution for acorn to make webpack 4 work with optional chaining. Add context to init code.

* [sc-177377] Update js dep to alpha3

* Update alpha packages

* Removed redundant null coalescence. Added more unit tests for getContextOrUser.

* Update package.json

* Remove un-used import

* Minor comment fixes

* Removed unnecessary context arg in example init

* Update app.js

* Set default context kind to user

* Create CODEOWNERS

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* [sc-178466] Bugfix flags proxy errors when using native functions (#91)

* [sc-178466] Fix native function proxy errors

* Added unit tests.

* Fix ts any error

* Update getFlagsProxy.test.ts

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update package.json (#92)

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Christie Williams <xie.williams@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
LaunchDarklyReleaseBot added a commit that referenced this issue Dec 7, 2022
* Initial commit

* Delete extraneous files from lib.

* Update initLDClient.test.ts

* Update withLDProvider.tsx (#18)

* update JS SDK dependency to 2.16.3

* use JS SDK 2.17.0

* improve tests to clarify which options we're passing in and which ones are added by the wrapper

* set wrapperName to react-client-sdk

* lint

* Update withLDProvider.test.tsx

* update JS SDK to 2.17.5 + a few dev dependency bumps (#21)

* downgrade typescript to 3.8.3 (#22)

* [Fixes for] Expose LDProvider as a standalone component (#31)

* remove startsWith usage (#23)

* Fix the broken build (#24)

* Expose ld provider (#40)

* Add tests for the LDProvider

* Add LDProvider component

* Add LDProvider to main export

* Update provider tests

* Remove unused EnhancedComponent

* Abstract function to generate react options

* add waitForUserToInitializeClient flag to Provider

* rename to LDProvider.tsx

* fix tests

* remove async from componentDidMount

* fixes from CR

* add test

* cleanup

* update types for componentDidUpdate

* await initLDClient

Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>

* update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)

* 45 fix providers to respect subscribed flags (#46)

* Fixed asyncWithLDProvider.tsx and provider.tsx so that they only provide flag changes for subscribed flags.

* Removed unused imports.

* Addressed PR feedback. Fixed linting errors.

Co-authored-by: Clay Embry <cembry@atlassian.com>

* targetflags simplified logic (#26)

* remove client-side ids from examples (#27)

* update JS SDK to 2.18.1

* Fixing camelCaseKeys export (#44)

* new js-common-sdk version (#30)

* adding alias functionality (#31)

* pin typedoc to unblock our releases (#32)

* Removed the guides link

* add inlineUsersToEvents to TypeScript defs by updating js-client-sdk (#33)

* debugging

* Fix linting errors

* [ch103643] Fix examples to use local sdk

* Remove unwanted changes.

* Update package.json

* Update yarn.lock

* Update lock files.

* Update package-lock.json

* Update package-lock.json

* Update package.json

* Update link-dev.sh

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Update link-dev.sh

* Update yarn.lock

* Add react 17 peer dep (#61)

* Update common JS SDK library to use fixes for debug event generation issues. (#36)

* HOC static hoisting (#71)

* Added a test for hoisting react statics in withLDProvider HOC

* Fixed linting errors

* Fixed more linting errors

* update example app deps (#38)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders (#39)

* Updated asyncWithLDProvider to fetch latest flag values when the Provider renders

* Fixed linting

* Updates docs URLs

* fix: improve types of withLDProvider (#97)

* [sc-107070] Include src for sourcemaps to work

* [sc-127032] Omit deferInitialization from asyncWithLDProvider config

* Removed and ignored lock files.

* Update types.ts

* Update typescript version (#44)

* Update Makefile

* Update Makefile

* Deleting test-types.ts (#45)

* [sc-132394] Add typedoc for AsyncProviderConfig (#47)

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Pass in client (#105)

* [sc134057] Fix react sdk lint errors (#48)

* remove custom TypeDoc build, use Releaser's standard logic (#49)

* update js-client-sdk to 2.20.1 for localstorage error-handling fix and others

* export more public symbols from entry point

* [sc134364] Upgrade typescript, tslint and jest. (#50)

Co-authored-by: Eli Bishop <eli@launchdarkly.com>

* update js-client-sdk to 2.20.2 for sc-142333 fix (#53)

* First commit. TODO: migrate enzyme to rtl.

* Removed enzyme. Fixed prettier parentheses rule.

* Fixed broken snapshot tests. Removed unused imports.

* Update package.json

* Update the version of the js-client-sdk

* Update patch version.

* Rename master to main (#56)

* Set sendEventsOnlyForVariation by default

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Add jest-environment-jsdom as explicit dependency

* Fix TS error

* Update tests

* Move wrapper options into base options obj

* Target ES6

* Add tests for camel case cases

* Remove vestigial package

* Make targetFlags doc more clear

* Add error hook and handler

* Revert changes to original docs

* Add context and flags proxy util

* Use flags proxy and update tests

* Fixup

* Fixup

* Don't call variation when initializing

* Add option and failing test

* Passing test

* Remove incorrect comment and fix typo

* Update proxy's get trap

* except after c

* Remove unproxied flags from context

* Restore ldClient dec and clean up camelization

* Update src/types.ts

Co-authored-by: Molly <molly.jones@launchdarkly.com>

* Fixup

* Handle symbols

* Add type constraint to withLDProvider

* Remove getter setter

* Remove error handler and fix bad merge

* Update snapshots

* Update releaser config

* Fixup

* Update version of js-client-sdk used. (#82)

* Upgrade js-client-sdk version to 2.24.0 (#83)

* Upgrade common to 2.24.2 (#84)

* Populate the context with the initial flag state and proxy. (#85)

* [sc-178466] Bugfix flags proxy errors when using native functions (#91)

* [sc-178466] Fix native function proxy errors

* Added unit tests.

* Fix ts any error

* Update getFlagsProxy.test.ts

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>

* Update config.yml

Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Martin Heller <github@technopolis.de>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: bezreyhan <bezreyhan@gmail.com>
Co-authored-by: Nicholas Mitchell <nicholas@netlify.com>
Co-authored-by: Martin Heller <mheller@testo.de>
Co-authored-by: clayembry <clayembry@yahoo.com>
Co-authored-by: Clay Embry <cembry@atlassian.com>
Co-authored-by: Jonathan Felchlin <jonathan@xgecko.com>
Co-authored-by: Mac Lockard <maclockard@gmail.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Nathan Waddell <45477581+NathanWaddell121107@users.noreply.github.com>
Co-authored-by: Clifford Tawiah <ctawiah@launchdarkly.com>
Co-authored-by: Cliff Tawiah <82856282+ctawiah@users.noreply.github.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Derek Sifford <dereksifford@gmail.com>
Co-authored-by: Jaz White <jwhite@launchdarkly.com>
Co-authored-by: Molly <molly.jones@launchdarkly.com>
Co-authored-by: Tim Lee <tim.lee@red-badger.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Co-authored-by: Christie Williams <xie.williams@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants