fix: address framework papercuts (#66, #68, #71, #73, #75, #76, #81, #90, #92, #93, #94, #95) - #98
Merged
Conversation
, #92, #93, #94, #95) - #95: users.login_redirect_url setting; auto-fallback to / when Dashboard absent - #94 + #68: worker entrypoint loads .env via shared load_dotenv_into_environ; schema-per-module driven by SM_SCHEMA_PER_MODULE (URL fallback kept) - #93: CSP gains worker-src/child-src for blob: workers (MapLibre, WASM) - #92: NavIcon swaps hand-rolled SVGs for tree-shaken lucide-react named imports - #90: register_event_handlers gains optional app=; back-compat dispatch shim - #81: SM_USERS_*_TOKEN_SECRET re-enabled as boot-time env-var override - #76: init_db accepts poolclass (NullPool) for cross-loop test setups - #75: drop tests/__init__.py from module scaffold (pytest plugin collision) - #71: testing plugin pre-builds eager Celery for non-client fixtures; new task_always_eager / task_eager_propagates settings honoured by build_celery - #66: vite resolve.dedupe + optimizeDeps for React/JSX runtimes so module-shipped pages share React identity with the host Adds shared dotenv helpers (env_str, env_bool, load_dotenv_into_environ, BOOL_LITERALS_*) in simple_module_core to consolidate duplicated env parsing.
This was referenced May 1, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes 12 of the 13 open framework papercut issues filed against
simple_module_python. Issue #74 lives in a downstream module (simple_module_sharing) that isn't in this repo and is left for that project.users.login_redirect_urlsetting; users module auto-falls back to/when Dashboard isn't installed.Login.tsxreads it from props.scripts/run_worker.py+ CLI template now load.envvia sharedload_dotenv_into_environbefore importing settings.worker-src 'self' blob:+child-src 'self' blob:(default +dev_csp) so MapLibre / WASM workers run.NavIconswaps the hand-rolled 11-icon map for ~70 tree-shakenlucide-reactnamed imports.ModuleBase.register_event_handlers(self, bus, app=None)so handlers can capture the framework session factory. Hosting layer dispatches viainspect.signatureso single-arg overrides keep working.SM_USERS_RESET_PASSWORD_TOKEN_SECRET/SM_USERS_VERIFICATION_TOKEN_SECRETre-enabled as boot-time env-var defaults so fresh prod deploys can clear the validator.init_db()acceptspoolclass=NullPoolfor tests on asyncpg/Postgres.tests/__init__.pydropped from the module scaffold to avoid pytest plugin collision under--import-mode=importlib.dedupe/optimizeDepsfrom #66 covers the residual React-identity bug.task_always_eager/task_eager_propagatesfields honoured bybuild_celery. The pytest plugin pre-builds an eager Celery app at import time so non-clientfixtures don't reach for the broker.SM_SCHEMA_PER_MODULE; theSM_DATABASE_URLheuristic is kept as a back-compat fallback.vite.config.tsaddsresolve.dedupe+optimizeDeps.includeforreact/react-dom/ JSX runtimes so cross-@fs/module-shipped.tsxpages share React identity with the host.Why
Each item is the smallest fix that makes a real first-run / first-try scenario work without requiring the user to monkey-patch the framework. Most were filed during the laco-wiki rewrite as concrete repro reports.
Notable design choices
env_str,env_bool,load_dotenv_into_environ,BOOL_LITERALS_TRUE/FALSEtosimple_module_core.dotenvand consolidated four sites that had been hand-rolling the same patterns.register_event_handlersback-compat: the newapp=Noneparameter is dispatched viainspect.signatureso out-of-tree modules with the one-arg override aren't broken at boot.UsersSettings(DB-backed, runtime-editable).users.on_startupauto-rewrites the default/dashboard/→/only when the Dashboard module isn't loaded; explicit operator overrides are preserved.Test plan
make lintclean (ruff + ty + biome ci + tsc across host / packages / modules + file-size + metadata + readmes)uv run pytest: 1047 passed, 6 deselected (e2e)npx vitest run: 8 tests passedmake devin a freshsm new --preset minimalto confirm login →/lands cleanly (didn't run; covered by the on_startup auto-fallback test path).envis honoured (covered by docs; not exercised in CI)