robbederks / downzip

NPM library to enable client-side code to stream potentially large files into a zipped download
MIT License
35 stars 12 forks source link

Rebuilds `dist` contents; [close #20] #28

Closed coleshaw closed 1 year ago

coleshaw commented 1 year ago

This PR simply rebuilds the contents of the dist directory, bundling in the correct service-worker-loader version. You can inspect the dist/main.js file and see that the mapScriptUrl function is correctly handled. Testing locally in my application, mapScriptUrl is now called, and the service worker is correctly found and registered (apologies for the minification ... but you should be able to get the idea):

function i(e,r){var n=o,i=r;return"function"==typeof e?n=e(n):i=e,"serviceWorker"in navigator?navigator.serviceWorker.register(n,i):Promise.reject(new t)}

Previously the dist code reflected the previous service-worker-loader behavior (v3?), which simply passed through the value:

function o(e){return"serviceWorker"in navigator?navigator.serviceWorker.register("/downzip-sw.js",e):Promise.reject(new t)}

Also bumps the version to 2.0.1 -- if you merge this, could you also please make an npm release? Thanks!

coleshaw commented 1 year ago

Basically, I think this undoes this earlier commit, which seems to have used the old version of service-worker-loader when building...

robbederks commented 1 year ago

Thanks! Will try to test, merge and bump tonight.

robbederks commented 1 year ago

Fixed this + updated some of the CI on master. Also pushed the 2.0.1 version to npmjs. Thanks for the suggestion!

Will also be trying to update some of the dependencies that have reported vulnerabilities.