Skip to content
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

Serve source maps from server instead of bundling them #1007

Closed
fregante opened this issue Aug 6, 2021 · 4 comments · Fixed by #1071
Closed

Serve source maps from server instead of bundling them #1007

fregante opened this issue Aug 6, 2021 · 4 comments · Fixed by #1071

Comments

@fregante
Copy link
Collaborator

fregante commented Aug 6, 2021

To make the extension bundle leaner, we could remove the source maps from it. We have a couple of options if we want to preserve source maps without including them:

I think the public server approach is interesting, we get every benefit of source maps without making the user download them. The upload would only be enabled on CI, perhaps exclusively for production/store builds.

@twschiller
Copy link
Contributor

We already upload the source maps to Rollbar: http://github.com/pixiebrix/pixiebrix-extension/blob/0c6f2308ee1a68ec05fbedaaf4b4e3547129342b/webpack.config.js#L77-L77

My main concern is that excluding source maps could increase our Chrome Web Store review time. The benefit of a public server is that Chrome could find them (I'm not sure it it could load them from a remote server if they're maps for an extension?). If we just want the CWS team to find them, we could upload them as artifacts to the GitHub action build

@fregante any insights from your experience with the review process?

@fregante
Copy link
Collaborator Author

fregante commented Aug 7, 2021

Source maps should work the same everywhere, the browser will resolve absolute URLs just as well as local paths I'd reckon.

I don't remember sourcemaps affecting CWS, I rarely include them and they rarely complain.

AMO does not care for maps, they want the full source and they will build it from scratch if they see "generated code." This only happens at random; It hasn't happened in months to me but at some point they flagged every release for a month last year. Submissions are accepted automatically but then they're flagged and you have 15 days to upload the source manually. There's no upload API and they don't want URLs, they want a zip file.

I see sourcemaps as useful to us for debugging, not for reviews.

@twschiller
Copy link
Contributor

twschiller commented Aug 7, 2021

I'd recommend we do the following. Thoughts?

  • Continue to upload the source to Rollbar
  • Upload the source maps as artifacts of the build (I'll mention in the CWS notes where they're available)
  • Remove them from the zipped bundle

IIRC, the source maps don't actually work locally in the release bundle anyway as they're not in web_accessible_resources?

@fregante
Copy link
Collaborator Author

fregante commented Aug 9, 2021

I'll have to do some tests, I think uploading them automatically to a server would work and it would be best for you since there's no manual step. There's an abundance of permanent and temporary storage options for this, we just need to pick the easiest to implement on GitHub Actions. The dev tools are not bound to the manifest, I assume they can load maps from anywhere even on the web and the file system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants