Skip to content

Remove source-map dependency from terser bundle - #17067

Merged
sbc100 merged 1 commit into
mainfrom
fix_terser
May 26, 2022
Merged

sbc100 merged 1 commit into
mainfrom
fix_terser

Conversation

@sbc100

@sbc100 sbc100 commented May 26, 2022

Copy link
Copy Markdown
Collaborator

When updating terser to 4.1.0 in #17035 I inadvertently introduced a
dependency on the node source-map module. Rebuilding after patching
our terser fork removed this:

emscripten-core/terser@b3ace3b

This happens to be available during testing because it one of our dev
decpendencies but we not include it in our end-user/production
dependencies.

This kind of error is hard to find since the node_modules for our test
setup is the same as the node_modules for emscripten itself. It migth
be worth attempting to tease them appart if this kind of thing ever
shows up again.

@sbc100
sbc100 requested a review from kripken May 26, 2022 16:11
using the following steps:

$ CI=1 npm run build
$ npx rollup -c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Intentional change? What is the difference?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, its the same thing.. I just noticed this works better and was simpler for me to deal with when iterating.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(and I can then remove the comment below)

When updating terser to 4.1.0 in #17035 I inadvertently introduced a
dependency on the node source-map module.  Rebuilding after patching
our terser fork removed this:

emscripten-core/terser@b3ace3b

This happens to be available during testing because it one of our dev
decpendencies but we not include it in our end-user/production
dependencies.

This kind of error is hard to find since the `node_modules` for our test
setup is the same as the node_modules for emscripten itself.  It migth
be worth attempting to tease them appart if this kind of thing ever
shows up again.
@sbc100
sbc100 merged commit 38d1292 into main May 26, 2022
@sbc100
sbc100 deleted the fix_terser branch May 26, 2022 17:08
@kripken

kripken commented May 26, 2022

Copy link
Copy Markdown
Member

@sbc100

sbc100 commented May 26, 2022

Copy link
Copy Markdown
Collaborator Author

Yes, this is an odd case where the only effect users are those that are not setup to run emscripten tests... so by definition it doesn't get caught be our testing process :(

@sbc100

sbc100 commented May 26, 2022

Copy link
Copy Markdown
Collaborator Author

The solution is probably to have the tests run emscripten in some kind of virtual sandbox that is separate from the test running environment... but I'm hoping this kind of issue is rare enough not to warrant building that.

@kripken

kripken commented May 26, 2022

Copy link
Copy Markdown
Member

Yeah... I guess it makes sense that emsdk CI would find it as that really tests the entire user flow. I agree it might not be worth doing anything more there, as such breakage will be 100% caught before a release.

@sbc100

sbc100 commented May 26, 2022

Copy link
Copy Markdown
Collaborator Author

Its also notable that users who happen to have source-map install anywhere in their node path would also not have seen this issue.. the emcc JS tools are not insulated from the wider node module environment.

sbc100 added a commit that referenced this pull request Aug 10, 2023
This happened once before already and was fixed #17067.

This change was generated by re-bundling terser after this change:

emscripten-core/terser@692a6de
sbc100 added a commit that referenced this pull request Aug 10, 2023
This happened once before already and was fixed #17067.

This change was generated by re-bundling terser after this change:

emscripten-core/terser@692a6de
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