Skip to content

Conversation

ms-dosx86
Copy link
Contributor

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Currently the wasm plugin introduced in v18.1.0 resolves not only .wasm imports, but any imports that end with (any character)wasm. It must be a typo in the wasm plugin regex /.wasm$/ which should look like /\.wasm$/.

You can see it in this example by running ng build.
In the example above matrix-js-sdk depends on @matrix-org/matrix-sdk-crypto-wasm which is treated as a wasm import by the plugin which causes build error

The plugin "angular-compiler" didn't set a resolve directory for the file "angular:wasm:init:/home/projects/stackblitz-starters-nnuphq/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/index.js", so esbuild did not search for "./matrix_sdk_crypto_wasm_bg.wasm.js" on the file system.

What is the new behavior?

Wasm plugin resolves only .wasm imports.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Jul 16, 2024
@dgp1130 dgp1130 merged commit 855a4b8 into angular:main Jul 17, 2024
@dgp1130
Copy link
Collaborator

dgp1130 commented Jul 17, 2024

The changes were merged into the following branches: main, 18.1.x

@ms-dosx86 ms-dosx86 deleted the bugfix/fix-wasm-import branch July 17, 2024 16:36
@LeonEck LeonEck mentioned this pull request Jul 17, 2024
1 task
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants