Skip to content

resolve jszip #238

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

Merged
merged 1 commit into from
Aug 21, 2021
Merged

resolve jszip #238

merged 1 commit into from
Aug 21, 2021

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Aug 1, 2021

I missed this when rebasing #222. This also upgrades JSZip from 3.6.0 to 3.7.0 which you can see here:

Stuk/jszip@v3.6.0...e5b3f0d

The only change appears to be a security fix for weirdly-named files which I do not think applies in our usage.

@mbostock mbostock requested a review from visnup August 1, 2021 18:56
@@ -72,6 +78,17 @@ async function resolve(specifier) {
return {
name: package.name,
version: package.version,
export: (package.unpkg || package.jsdelivr || package.browser || package.main).replace(/^\.\//, "")
export: main(package)
Copy link
Member Author

@mbostock mbostock Aug 1, 2021

Choose a reason for hiding this comment

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

This is a workaround for JSZip’s use of the nonstandard browser object for Browserify:

https://github.com/Stuk/jszip/blob/e5b3f0ddaa8182cd6ea253e97f678b9f36d0d8ac/package.json#L27-L30

I modeled this code after the same code from d3-require. Note that I just ended up hard-coding the main for JSZip (since I didn’t want to bother supporting Browserify-style entry parsing); this code is still needed so that the code doesn’t crash.

@mbostock mbostock merged commit 0323209 into main Aug 21, 2021
@mbostock mbostock deleted the mbostock/resolve-jszip branch August 21, 2021 15:47
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