Skip to content
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

Conversation

patricklx
Copy link
Contributor

@patricklx patricklx commented May 6, 2024

terser will ofter not optimize const vars. even if they reference noop funcs

Copy link

stackblitz bot commented May 6, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patricklx patricklx marked this pull request as draft May 6, 2024 14:43
Copy link

socket-security bot commented May 6, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, filesystem Transitive: eval, shell, unsafe +71 9.85 MB eslintbot

🚮 Removed packages: npm/@starbeam-dev/[email protected], npm/[email protected]

View full report↗︎

@patricklx patricklx marked this pull request as ready for review May 6, 2024 21:26
@patricklx patricklx changed the title improve verify checks improve production build May 7, 2024
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>;
Copy link
Contributor Author

@patricklx patricklx May 7, 2024

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

@patricklx patricklx force-pushed the add-ci-check-for-fobidden-texts branch from 88c6055 to d1bf028 Compare May 8, 2024 08:08
@NullVoxPopuli NullVoxPopuli merged commit 7099168 into starbeamjs:add-ci-check-for-fobidden-texts May 8, 2024
8 checks passed
NullVoxPopuli added a commit that referenced this pull request May 8, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants