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

fix: remove regex replacement for lib mode #14091

Closed
wants to merge 1 commit into from

Conversation

fnlctrl
Copy link
Contributor

@fnlctrl fnlctrl commented Aug 13, 2023

Description

Fix #14065 lib mode hanging for umd build, by removing regex replacements

Additional context

The original fix #7948 used regex for string replacement to avoid global esbuild helpers. However, it seems these can be removed now, because all the tests pass without them, probably due to updated esbuild (0.14.27 then vs 0.18.10 now).

The regex approach also doesn't completely fix the original issue, some reproductions with the latest vite (4.4.9):

Given numerous preivous attemps #8110 #8741 #10905 at fixing regex performance, I think this is an indication that regex isn't the right solution in this scenario, and we should probably remove it altogether to avoid future performance issues.

In conclusion, we need a better fix for the global esbuild helpers. Removing regex for now appears to be safe because a). all tests pass and b). the original issue is still largely unfixed (easily reproducable - probably already in many people's builds)


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Aug 13, 2023

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

@fnlctrl
Copy link
Contributor Author

fnlctrl commented Aug 13, 2023

🤦‍♂️seems I forgot to run build before running tests locally.. I'll investigate more for a proper fix, closing for now

@fnlctrl fnlctrl closed this Aug 13, 2023
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.

Library mode umd build hangs
1 participant