Repository navigation
feat: configurable assets_dir and lockfile_dir for apps sharing a project root - #8009
benedikt-bartscher wants to merge 11 commits into
Conversation
[Medium impact] The PR appears safe to merge. SummaryAdds
Reviews (6) · Last reviewed commit: "fix: update absolute directory settings ..." · Reviewed by Greptile |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
…tarting the dev backend
…to app-assets-and-lockfile-dirs
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
An app always takes its static files from
<root>/assetsand persists its frontendpackage.jsonand lockfiles in<root>/reflex.lock. Two apps that share a project root, say a dashboard and a static marketing site built from the same repo, each with its own config, therefore step on each other:assets/into its frontend, so the small site ships the dashboard's assets (22 MB in our case);reflex.lock/, so building the site replaces the dashboard's committed lockfile with the site's smaller package set, and the next dashboard build changes it back..webcan already move per app withREFLEX_WEB_WORKDIR; these two directories could not. This PR adds two config fields:Both are relative to the app root (absolute paths work too), default to
assetsandreflex.lock, take strings as well, and can come fromREFLEX_ASSETS_DIR/REFLEX_LOCKFILE_DIRlike any config field.assets_diris used wherever the assets directory was hardcoded: the copy into.web/public,rx.asset(local files and theexternal/links of shared ones), local stylesheets inApp(stylesheets=...), andreflex rename.lockfile_dirgoes throughfrontend_skeleton.get_root_lockfile_dir(), which the lockfile sync, the npm detection and its messages, the hot reload exclusion and telemetry now use. Nothing changes for an app that sets neither.This touches the same lines of
_compile_root_stylesheetas #8007 (page stylesheets), which moves them into helpers; whichever merges second resolves the conflict by readingget_config().assets_dirin those helpers.