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

mdoc.js: support ES modules and SmallModulesFor #638

Open
armanbilge opened this issue Apr 5, 2022 · 1 comment
Open

mdoc.js: support ES modules and SmallModulesFor #638

armanbilge opened this issue Apr 5, 2022 · 1 comment

Comments

@armanbilge
Copy link
Contributor

armanbilge commented Apr 5, 2022

Scala.js 1.10.0 added ModuleSplitStyle.SmallModulesFor to enable fast, iterative development of Scala.js apps.

The typical usage pattern is to list the application’s packages as argument. This way, often-changing classes receive independent, small modules, while the stable classes coming from libraries are bundled together as much as possible.

https://www.scala-js.org/news/2022/04/04/announcing-scalajs-1.10.0/#new-module-split-style-smallmodulesforpackages

IIUC all mdocs are compiled under the mdoc package so I expect that would be the argument to use for this setting. Then, mdoc --watch can provide a supercharged dev cycle.

@armanbilge
Copy link
Contributor Author

armanbilge commented Apr 5, 2022

Btw, I don't think this should be too hard to support. I think the key change here is adding support for ESModules, which means:

  1. supporting multiple JS file output from the linker
  2. Using in the browser with <script type="module" src="..."></script>

After enabling ES modules for (the non-mdoc part of) my project, the only change I had to make was (2).

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

No branches or pull requests

1 participant