Skip to content

docs: base the v2 SDK READMEs on their v1 guides and update only what changed - #852

Merged
roncohen merged 7 commits into
mainfrom
docs/react-readme-from-v1
Dec 1, 2026
Merged

roncohen merged 7 commits into
mainfrom
docs/react-readme-from-v1

Conversation

@roncohen

@roncohen roncohen commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

The v2 READMEs for React, Browser, Vue, Node and React Native were short rewrites, so their docs pages looked very different from v1. This PR starts each README from its last v1 release and changes only what's different in v2. It keeps the v1 structure, sections and examples. Each claim that remains was checked against the v2 source. Against the current v2 READMEs the diff looks like a full rewrite, so the table below compares each one with v1.

README v1 source Change vs v1
React @reflag/react-sdk@1.7.4 +117 / −105
Browser @reflag/browser-sdk@1.7.4 +66 / −77
Vue @reflag/vue-sdk@1.5.7 +102 / −70
Node @reflag/node-sdk@1.8.4 +130 / −103
React Native @reflag/react-native-sdk@0.3.7 +34 / −10

What changed in every README

  • Flag reads return the value: useFlag(key) / getFlag(...) instead of { isEnabled, config, track, requestFeedback }. Tracking and feedback examples use the client or the hooks.
  • Remote config → Multivariate flags. These sections cover reading a flag with a default and how defaults behave: the default sets the return type, it's used while flags load or when the flag is missing or has the wrong JSON type, and null accepts any value. They also note that remote config isn't converted automatically.
  • Bootstrap. Each lists protocolVersion, says bootstrap data needs Node SDK v2 and includes only flags marked secret: false, and notes that the browser can read the bootstrapped context.
  • fallbackFlags is removed from options and migration notes. The removed getFeature, getFeatures and useFeature aliases are dropped from "Migrating from Bucket SDK".
  • Opt-in: useOptInFlags() returns setOptIn, useSetOptIn() is deprecated, and entries have a Boolean value.
  • New "Migrating from v1" section in each, carried over from the current v2 READMEs.

SDK-specific changes

  • React: useFlagSuspense() replaces useFlag(key, { suspense: true }), and the provider's suspense prop now applies only to useOptInFlags(). useOnEvent() gets a note on its optional client argument. The useTrack() example used const { track } = useTrack(), which was already wrong in v1; it's now const track = useTrack().
  • Browser: getFlags() returns values and records a check per flag, and getFlagResults() is the way to inspect flags without checks. The check event description is updated. bootstrappedFlags is removed.
  • Vue: useFlag() returns a ShallowRef. The hand-written bootstrap example uses v2 raw flags. There's a new type-safety section, since the CLI's vue format is new in v2.
  • Node: reads take the context first on the root client, and getFlags() returns values. getFlagRemote(key, defaultValue, userId, companyId) takes the default second. getFlagDefinitions() returns { flags, segments }. Overrides and the static fallback provider take values directly, the reflag.config.json override examples are updated, and the type-check example no longer uses config payloads.
  • React Native: useFlagSuspense(), and the v2 useFlag() example.

Everything else is the v1 text unchanged.

Follow-up

Some docs pages link to anchors that exist only in the current v2 READMEs. I'll update them in the docs repo when the docs are re-imported after this merges:

  • #bootstrap-and-ssr (React): service-resiliency.md, next.js.md
  • #server-bootstrap, #overrides-and-toolbar, #events (Browser): service-resiliency.md, toggle-toolbar-with-a-flag.md, integrations/overview.md
  • #bootstrap (Vue): service-resiliency.md
  • #bootstrap-the-browser, #fallback-providers (Node)

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

4 actionable findings.

Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/react-sdk/README.md Resolved
@roncohen roncohen changed the title docs(react-sdk): base the v2 README on the v1 guide and update only what changed docs: base the v2 SDK READMEs on their v1 guides and update only what changed Dec 1, 2026

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: high

7 actionable findings.

Comment thread packages/browser-sdk/README.md Resolved
Comment thread packages/node-sdk/README.md Resolved
Comment thread packages/browser-sdk/README.md Resolved
Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

6 actionable findings; 1 optional refactor suggestion.

Comment thread packages/node-sdk/README.md Resolved
Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/node-sdk/README.md Resolved
Comment thread packages/browser-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
Comment thread packages/node-sdk/README.md Resolved

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

4 actionable findings; 1 optional refactor suggestion.

Comment thread packages/node-sdk/README.md Resolved
Comment thread packages/node-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
@roncohen
roncohen enabled auto-merge December 1, 2026 09:13

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

3 actionable findings.

Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/react-sdk/README.md Resolved
Comment thread packages/vue-sdk/README.md Resolved
@roncohen
roncohen added this pull request to the merge queue Dec 1, 2026

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

2 actionable findings.

Comment thread packages/browser-sdk/README.md Resolved
Comment thread packages/node-sdk/README.md Resolved
Merged via the queue into main with commit 1231e44 Dec 1, 2026
7 checks passed
@roncohen
roncohen deleted the docs/react-readme-from-v1 branch December 1, 2026 09:27
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

Successfully merging this pull request may close these issues.

1 participant