Skip to content

Conversation

gzm0
Copy link
Contributor

@gzm0 gzm0 commented Jan 26, 2021

No description provided.


Create modules that are as small as possible.
The smallest unit of splitting is a Scala class.
The smallest unit of splitting is a Scala class (see [Splitting Granularity](#Splitting Granularity) below for more).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this the correct way to link to an anchor?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, except that the titles are converted to something #splitting-granularity. I don't try to predict it, and instead generate then inspect the page with a browser's inspection tools...

@gzm0
Copy link
Contributor Author

gzm0 commented Jan 26, 2021

I still need another self-review pass.


### Module Split Styles

So far, we have seen public modules and dynamic import boundaries can be defined.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
So far, we have seen public modules and dynamic import boundaries can be defined.
So far, we have seen how public modules and dynamic import boundaries can be defined.
* `main.js`: public module, containing the export of `onClick`.
* many internal small modules (~150 for this example), approximately one per class.

Observe that in this split style, dynamic import boundaries do not affect splitting because the modules are already as small as possible.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this sentence. :s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have tried to clarify. PTAL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(maybe it doesn't need to be there and I can just drop it)

Copy link
Member

Choose a reason for hiding this comment

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

Hum, OK, now I understand. But I'm not sure it's clear for a user. Perhaps add something like "Dynamic import boundaries are still important for dynamic loading."? On a first reading, it sounds like this paragraph says that dynamic imports are irrelevant with SmallestModules. So it's confusing.

Perhaps even consider removing this paragraph altogether? I'm not sure it brings any relevant value to a user.

@gzm0 gzm0 force-pushed the document-dynamic-module-splitting branch from b605e60 to aea8422 Compare January 27, 2021 10:39
@gzm0 gzm0 force-pushed the document-dynamic-module-splitting branch from aea8422 to 1183101 Compare January 27, 2021 10:51
@gzm0 gzm0 marked this pull request as ready for review January 27, 2021 10:57
@gzm0 gzm0 requested a review from sjrd January 27, 2021 14:49
@sjrd sjrd merged commit ee152d3 into scala-js:master Jan 27, 2021
@gzm0 gzm0 deleted the document-dynamic-module-splitting branch April 3, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants