-
Notifications
You must be signed in to change notification settings - Fork 367
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
refactor: [M3-7750] - Update launchdarkly-react-client-sdk
to latest
#10165
refactor: [M3-7750] - Update launchdarkly-react-client-sdk
to latest
#10165
Conversation
@@ -23,37 +22,35 @@ import { useSetupFeatureFlags } from './useSetupFeatureFlags'; | |||
export const App = () => <BaseApp />; | |||
|
|||
const BaseApp = withDocumentTitleProvider( | |||
withFeatureFlagProvider( | |||
withFeatureFlagConsumer(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The consumer is not needed here because we don't need to read flags
in this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a much cleaner rewrite of withFeatureFlagConsumer.container.ts
DomainRecord[], | ||
DomainRecord[], | ||
DomainRecord[] | ||
>(prependLinodeNS, filter(typeEq('NS')), pathOr([], ['domainRecords'])); | ||
|
||
export default recompose<CombinedProps, DomainRecordsProps>(withFeatureFlags)( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component does not consume feature flags
@@ -432,7 +431,6 @@ const sendGroupByAnalytic = (value: boolean) => { | |||
|
|||
export const enhanced = compose<CombinedProps, LinodesLandingProps>( | |||
withRouter, | |||
withFeatureFlagConsumer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component does not consume feature flags so this can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to address a breaking change here. Launch Darkly no longer exports Provider
so we have to use LDProvider
.
@@ -39,7 +39,7 @@ | |||
"ipaddr.js": "^1.9.1", | |||
"jspdf": "^2.3.1", | |||
"jspdf-autotable": "^3.5.14", | |||
"launchdarkly-react-client-sdk": "^3.0.6", | |||
"launchdarkly-react-client-sdk": "3.0.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm going to start pinning exact versions (without the ^
) so that if we ever have to re-generate the lockfile, the minor version won't update. Usually this is fine because minor versions shouldn't case breaking changes, but in this case for launch darkly, it did.
Using the exact version will make things more predictable and safe
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested feature flags and affected components. Everything looks good, thanks for the update and clean up work @bnussman-akamai!
Minor style suggestions from eslint
packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx
Outdated
Show resolved
Hide resolved
clientSideID={''} | ||
deferInitialization | ||
flags={options.flags ?? {}} | ||
options={{ bootstrap: options.flags }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, here is some context for others:
The bootstrapping feature lets you decrease startup times for client-side SDKs by providing them with an initial set of flag values that are immediately available during client initialization.
Description 📝
Updates Launch Darkly to latest 📦
Changes 🔄
withFeatureFlagConsumer
➡️withFeatureFlags
because it needed to be cleaned up 🧼How to test 🧪
Prerequisites
yarn
in the root directory to make sure updated dependencies are installedVerification steps
withFeatureFlagConsumer
➡️withFeatureFlags
does not introduce any breaking changesAs an Author I have considered 🤔