From 2b745548c3c5b986c6e462155d8a0620d77b2df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0pan=C4=9Bl?= Date: Thu, 29 Jun 2023 14:48:44 +0200 Subject: [PATCH 1/2] Document ES module limitation (https://github.com/scala-js/scala-js/issues/3893) --- doc/project/module.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/project/module.md b/doc/project/module.md index 63d5252e..21ed2204 100644 --- a/doc/project/module.md +++ b/doc/project/module.md @@ -19,6 +19,8 @@ scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) } scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) } {% endhighlight %} +Note: when using ECMAScript modules, fullopt file [optimization](../internals/performance.html) is limited, because Google Closure Compiler cannot be used with them. + When emitting a module, `@JSExportTopLevel`s are really *exported* from the Scala.js module. Moreover, you can use top-level `@JSImport` to [import native JavaScript stuff](../interoperability/facade-types.html#import) from other JavaScript module. From 9e31d72179b2829d205ba868fc66059bc306be2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0pan=C4=9Bl?= Date: Sun, 9 Jul 2023 08:58:46 +0200 Subject: [PATCH 2/2] Update doc/project/module.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Doeraene --- doc/project/module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/project/module.md b/doc/project/module.md index 21ed2204..30bacd2b 100644 --- a/doc/project/module.md +++ b/doc/project/module.md @@ -19,7 +19,7 @@ scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) } scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) } {% endhighlight %} -Note: when using ECMAScript modules, fullopt file [optimization](../internals/performance.html) is limited, because Google Closure Compiler cannot be used with them. +Note: when using ECMAScript modules, the [optimizations performed in `fullLinkJS`](../internals/performance.html) are limited, because the Google Closure Compiler cannot be used with them. When emitting a module, `@JSExportTopLevel`s are really *exported* from the Scala.js module. Moreover, you can use top-level `@JSImport` to [import native JavaScript stuff](../interoperability/facade-types.html#import) from other JavaScript module.