ENG-9801: sync reflex.lock/package.json to .web/package.json#6658
Conversation
Every time the framework requests installation of packages, sync the `package.json` along with the lock files, so out of band changes are picked up. After init, sync any package.json or lock files to reflex.lock so subsequent installs keep the initialized hooks and overrides.
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThis PR folds
Confidence Score: 5/5Safe to merge; the changes are well-scoped file-copy utilities with no shared mutable state, and the new test suite thoroughly covers the added paths. All changed paths are file I/O helpers with straightforward before/after semantics. The previously-noted overrides regression is correctly addressed. No logic paths were found that could silently drop data or corrupt state. No files require special attention. Important Files Changed
Reviews (6): Last reviewed commit: "Merge branch 'main' into masenf/sync-pac..." | Re-trigger Greptile |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
masenf
left a comment
There was a problem hiding this comment.
ideally we would consolidate the package.json combining code in frontend_skeleton.py with that of templates.py... but i'm holding off on that change until 0.10.0 when we combine the compiler into reflex-base, otherwise we'll be introducing cross-package incompatibility for no real gain other than hygiene.
FarhanAliRaza
left a comment
There was a problem hiding this comment.
Maybe we want to add tests for these cases
(a) prune=False preserving .web/package.json when
the root copy is absent
(b) initialize_web_directory persisting package.json back to root.
Cover the two behaviors raised in PR review: - prune=False preserving .web/package.json when the root copy is absent - initialize_web_directory persisting the compiled package.json back to root Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Every time the framework requests installation of packages, sync the
package.jsonalong with the lock files, so out of band changes are picked up.After init, sync any package.json or lock files to reflex.lock so subsequent installs keep the initialized hooks and overrides.
The reflex.lock/package.json is interesting because it's checked in, and it's the canonical copy of
package.jsonthat will replace what exists in.web... but it's also a deletable lock-ish file that will itself be recreated from the compiled app. After this change though, the reflex.lock/package.json is now an appropriate place to keep local changes like package version overrides.PR written without AI assistance 😅