Skip to content

feat(es): allow parse js hashbang syntax#4970

Merged
LingyuCoder merged 6 commits intoweb-infra-dev:mainfrom
magic-akari:hashbang
Dec 12, 2023
Merged

feat(es): allow parse js hashbang syntax#4970
LingyuCoder merged 6 commits intoweb-infra-dev:mainfrom
magic-akari:hashbang

Conversation

@magic-akari
Copy link
Copy Markdown
Contributor

Summary

Test Plan

crates/rspack_loader_swc/tests/fixtures/hashbang added.
If there are any additional locations where test cases need to be added, please inform me.

Require Documentation?

  • No
  • Yes, the corresponding rspack-website PR is __

@magic-akari magic-akari requested review from a team, LingyuCoder and jerrykingxyz December 11, 2023 06:59
@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Dec 11, 2023
@LingyuCoder
Copy link
Copy Markdown
Contributor

This modification only works when using builtin:swc-loader, may consider adding it in crates/rspack_plugin_javascript/src/ast/parse.rs to prevent compilation failure when not using builtin:swc-loader.

And it would be better if you could align the addition of comments with webpack

@magic-akari
Copy link
Copy Markdown
Contributor Author

@LingyuCoder Do you have any suggestions about test cases?

@LingyuCoder
Copy link
Copy Markdown
Contributor

@LingyuCoder Do you have any suggestions about test cases?

It is recommended to add test cases to ensure that the bundled script runs correctly. You can reuse webpack's test cases by removing webpack-test/cases/parsing/hashbang/test.filter.js. And also you can add additional test cases in the packages/rspack/tests directory.

@LingyuCoder
Copy link
Copy Markdown
Contributor

Thanks

@LingyuCoder LingyuCoder merged commit d52368a into web-infra-dev:main Dec 12, 2023
@magic-akari magic-akari deleted the hashbang branch December 12, 2023 04:08
ahabhgk pushed a commit that referenced this pull request Jan 2, 2024
* feat(es): allow parse js hashbang syntax

* chore: update test cases

* Revert "feat(es): allow parse js hashbang syntax"

This reverts commit 15650b9.

* Revert "chore: update test cases"

This reverts commit 0fe2cab.

* feat(es): allow parse js hashbang syntax

* chore: enable webpack test cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow parse js hashbang syntax

2 participants