-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Production Builds MVP #1
Comments
Note that this is about reducing the runtime overhead of dev-mode constructs, not (yet) about eliminating them from the build. 1. use import.meta.env.PROD in user code 2. add `pnpm test:prod`, which runs the tests in prod mode 3. Make verify() and verified() noops in production 4. Update rollup.config.js to mirror how vite replaces import.meta.env Note that the reason we have rollup.config.ts is because we need the feature of rollup that allows us to create separate, distinct configs, because we don't want the packages to share chunks with each other. See [this vite issue]. [this vite issue]: vitejs/vite#1736
Note that this is about reducing the runtime overhead of dev-mode constructs, not (yet) about eliminating them from the build. 1. use import.meta.env.PROD in user code 2. add `pnpm test:prod`, which runs the tests in prod mode 3. Make verify() and verified() noops in production 4. Update rollup.config.js to mirror how vite replaces import.meta.env Note that the reason we have rollup.config.ts is because we need the feature of rollup that allows us to create separate, distinct configs, because we don't want the packages to share chunks with each other. See [this vite issue]. [this vite issue]: vitejs/vite#1736
Here is a PR that tries to use what's on We can use this to test out production mode: At the time of writing, we still have: |
Closing this out as the effort to identify a solid production build strategy is now happening in https://github.com/starbeamjs/starbeam-lite. That repo is a testbed for addressing some of the long-standing open questions in the Starbeam fundamentals. Once we get to the end of that exploration, this repo will and starbeam-lite will be merged. |
We should make it easy to strip out runtime behavior that is only there for debug purposes.
Things to do:
debug
entry point with debug features in and aprod
entry point with debug features outOut of scope for this issue:
This is important, but it's a little trickier, because it involves things like stripping out unused methods, which has implications for TypeScript. My preferred solution is to use build-time decorators with
import.meta.env
to remove unused behavior.verify
pattern (verify(expr, isPresent)
) to remove the call to verify entirely.This is very important, but requires a different kind of work than the primary work this ticket is about.
Both of these are important near-term follow-up issues.
The text was updated successfully, but these errors were encountered: