Scala-js: Dump a list of all linked classes

Created on 3 Feb 2019  Â·  7Comments  Â·  Source: scala-js/scala-js

Hi, I am not having a specific problem but our codebase is getting rather big (10mb fastOptJS) and I'm starting to look at ways to trim things down. One thing I was thinking about was basically making sure I am not including classes that I wouldn't expect to be including.

In the same way webpack can dump a set of the dependencies it includes during the building process, it would be nice to be able to get some visibility around linked classes with scalajs.

Has anyone done any work on exposing either low level primitives or some ideas about how one would go about exposing this?

question

Most helpful comment

@dispalt You may want to try source-code-mapper. See more at https://youtu.be/zU5_jXaM2Zs?t=2035

All 7 comments

What about

$ grep '^function \$c\_' project-fastopt.js | cut -c 13- | sed 's/() {$//'

?

@dispalt You may want to try source-code-mapper. See more at https://youtu.be/zU5_jXaM2Zs?t=2035

That looks really interesting. Where can we find this source-code-mapper
tool? Google yields nothing.

On Wed, 6 Feb 2019 at 07:36, Ramnivas Laddad notifications@github.com
wrote:

@dispalt https://github.com/dispalt You may want to try
source-code-mapper. See more at https://youtu.be/zU5_jXaM2Zs?t=2035

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/scala-js/scala-js/issues/3556#issuecomment-460793784,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMYtw2catNLYNsSmEOJxK5NAiMLXWbzks5vKetqgaJpZM4agM3u
.

Oops. I got the name wrong. Here it is: https://www.npmjs.com/package/source-map-explorer

Awesome, thanks for that Ramnivas!

On Wed, 6 Feb 2019 at 08:52, Ramnivas Laddad notifications@github.com
wrote:

Oops. I got the name wrong. Here it is:
https://www.npmjs.com/package/source-map-explorer

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/scala-js/scala-js/issues/3556#issuecomment-460818173,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMYt4RHlxoy1rAKZVtseroEOT06-v2rks5vKf0JgaJpZM4agM3u
.

@ramnivas thanks a bunch looks like a decent solution!

Seems like this is addressed.

Was this page helpful?
0 / 5 - 0 ratings