Repository navigation
Commit 3906e4f
authored
docs: evaluate Browser bootstrap per request and fix the Node offline default (#853)
Follow-up to #852. These two review fixes were ready after #852 entered
the merge queue, so they missed it.
- **Browser README bootstrap example:** it called
`getFlagsForBootstrap()` once at server startup and served that snapshot
on every request. Bootstrapped clients skip their initial fetch, so flag
changes didn't reach pages until the server restarted. The example now
evaluates flags inside the request handler and keeps the shared Node
client.
- **Node README `offline` option:** it said offline mode defaults to
`true` based on a `TEST` environment variable. The SDK actually checks
`NODE_ENV === "test"` (`client.ts`), so the description now says that.
- **Browser README script tag:** it loaded
`cdn.jsdelivr.net/npm/@reflag/browser-sdk@2`, a major-pinned URL carried
over from v1. The docs check keeps major-pinned installs out of the SDK
pages and in the upgrade guide, so the example now loads
`@reflag/browser-sdk` without a version.
---------
Co-authored-by: Ron Cohen <744+roncohen@users.noreply.github.com>1 parent 1231e44 commit 3906e4f
2 files changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | 293 | | |
| 294 | + | |
299 | 295 | | |
300 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
606 | | - | |
| 606 | + | |
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| |||
0 commit comments