Skip to content

[vercel-flags-core] fix datafile serialization#416

Merged
dferber90 merged 1 commit into
mainfrom
dominikferber/fla-3006-fallback-data-not-shown-in-vercel-site
Jun 26, 2026
Merged

[vercel-flags-core] fix datafile serialization#416
dferber90 merged 1 commit into
mainfrom
dominikferber/fla-3006-fallback-data-not-shown-in-vercel-site

Conversation

@dferber90

@dferber90 dferber90 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Small, localized change to caching in evaluate.ts with the same memoization semantics and no API surface changes.

Overview
Fixes datafiles failing to cross the React Server Components boundary when passed from server to client components.

Evaluation used to cache scaled split weights and compiled regexes by attaching symbol-keyed properties on objects inside the datafile. That stayed hidden from JSON.stringify, but RSC’s serializer walks objects directly and breaks on non-serializable values (especially RegExp).

Memoization now lives in module-level WeakMaps keyed by the same outcome / regex rhs objects, so datafile payloads stay unmodified while cache lifetime and behavior stay equivalent.

Reviewed by Cursor Bugbot for commit 94629d9. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flags-playground Ready Ready Preview, Comment, Open in v0 Jun 26, 2026 2:33pm
flags-sdk-dev Ready Ready Preview, Comment, Open in v0 Jun 26, 2026 2:33pm
flags-sdk-snippets Ready Ready Preview, Comment, Open in v0 Jun 26, 2026 2:33pm
flags-sdk-sveltekit-snippets Ready Ready Preview, Comment, Open in v0 Jun 26, 2026 2:33pm
shirt-shop Ready Ready Preview, Comment, Open in v0 Jun 26, 2026 2:33pm
shirt-shop-api Ready Ready Preview, Comment, Open in v0 Jun 26, 2026 2:33pm

@dferber90 dferber90 merged commit f60c99d into main Jun 26, 2026
19 checks passed
@dferber90 dferber90 deleted the dominikferber/fla-3006-fallback-data-not-shown-in-vercel-site branch June 26, 2026 14:40
@github-actions github-actions Bot mentioned this pull request Jun 26, 2026
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.

2 participants