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

wrapper: rename entrypoint to help sourcemaps #295

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@2color
Copy link
Contributor

commented Apr 30, 2019

What

  • Rename entrypoint file to @aragon/wrapper

Why

  • For some strange reason Chrome and Firefox don't seem to be able to parse the source map properly when debugging aragon/aragon with @aragon/wrapper linked.
  • This extends to our production deployments took, which are deployed with the sourcemaps. Yet for some strange reason, this module isn't picked up properly. See in screenshot below how the module is missing.

Screen Shot 2019-04-30 at 10 25 29 am

@2color 2color requested review from bpierre and sohkai Apr 30, 2019

@bpierre
Copy link
Member

left a comment

We should also update this file:

path: "packages/aragon-wrapper/dist/index.js",

And should we make this same change on the three other packages?

@2color

This comment has been minimized.

Copy link
Contributor Author

commented May 6, 2019

@bpierre
Thanks for pointing this out. We should apply this change to the other packages.

I'm curious what the root cause of this bug is.

For example, our production build which includes the sourcemap seems to mix files from the aragon/aragon repository and @aragon/wrapper package. See below the cache/index.js and the apps folder, each of which are coming from different repos.

Screen Shot 2019-05-06 at 12 28 32 pm

@sohkai

This comment has been minimized.

Copy link
Member

commented May 6, 2019

I think the Chrome debugger is likely confused with the source map paths, since we export them transpiled in the aragon.js repo. I imagine it's having a hard time knowing that it's in node_modules, when the source map probably says everything is from ../src/index.js :shrug:.

@@ -2,7 +2,7 @@
"name": "@aragon/wrapper",
"version": "5.0.0-rc.3",
"description": "Library for Aragon client implementations",
"main": "dist/index.js",
"main": "dist/aragon-wrapper.js",

This comment has been minimized.

Copy link
@sohkai

sohkai May 6, 2019

Member

What do you think about keeping an index.js file that just re-exports the other modules, to be more similar to other npm packages?

We also do some re-exporting in the current index.js that could be removed from aragon-wrapper.js.

This comment has been minimized.

Copy link
@2color

2color May 6, 2019

Author Contributor

I like the idea. I also had mixed feelings about this given all the other npm packages I've seen.

@sohkai

This comment has been minimized.

Copy link
Member

commented May 6, 2019

And on size-limit, we should probably specify a glob instead:

"path": "dist/*.js"

@2color 2color force-pushed the wrapper-entrypoint branch from a9c3a77 to 33ac785 May 6, 2019

@2color

This comment has been minimized.

Copy link
Contributor Author

commented May 6, 2019

And on size-limit, we should probably specify a glob instead:
"path": "dist/*.js"

I'm not sure what you're actually suggesting. size-limit expects an entry point and for every entrypoint we have a size limit so I'm not sure what we'll get with a glob?

@sohkai

This comment has been minimized.

Copy link
Member

commented May 6, 2019

Ahh, didn't realize size-limit was smart enough to compute all the dependencies from a single entry point 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.