-
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
improve production build #158
improve production build #158
Conversation
Run & review this pull request in StackBlitz Codeflow. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@starbeam-dev/[email protected], npm/[email protected] |
export function verified(v: unknown): unknown { | ||
if (import.meta.env.DEV) { | ||
// eslint-disable-next-line prefer-rest-params | ||
const [value, check, error] = [...arguments] as Parameters<typeof verified>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this hides extra function params from terser, so terser can optimize the prod build and inline this function.
terser will then replace verified(x)
with x
88c6055
to
d1bf028
Compare
7099168
into
starbeamjs:add-ci-check-for-fobidden-texts
* Add CI check for forbidden texts * wip * Try this * I think the custom externals stuff has a bug * it worked? * Update workspace/scripts/build-verify.js Co-authored-by: Patrick Pircher <[email protected]> * try this * improve production build (#158) * improve verify * fix preact * fix collections * dont check debug & verify packages * wip * fix reactive * fix lint * improve build * fix type & lint * more lint fixes * fix lint * update @starbeam-dev/eslint-plugin --------- Co-authored-by: Patrick Pircher <[email protected]>
terser will ofter not optimize const vars. even if they reference noop funcs