ENG-9801: sync reflex.lock/package.json to .web/package.json#6658
ENG-9801: sync reflex.lock/package.json to .web/package.json#6658masenf wants to merge 5 commits into
reflex.lock/package.json to .web/package.json#6658Conversation
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 unifies
Confidence Score: 5/5Safe to merge — the changes are well-scoped, the previous concern about overrides being dropped on init has been addressed, and the new test coverage is thorough. The logic flows (init, install, sync-back) have all been updated consistently, the **persisted spread correctly carries only unrecognised fields after all framework-managed keys are explicitly popped, and the prune=False flag prevents accidental deletion of .web/package.json when no root copy exists yet. Four new unit tests cover null fields, non-object roots, user override merging, and arbitrary pass-through fields. No defects found in the changed paths. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "Move comment above line (ruff cleanup)" | 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.
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 😅