Skip to content

Conversation

JSMonk
Copy link
Member

@JSMonk JSMonk commented Jun 27, 2025

No description provided.

@JSMonk JSMonk requested a review from a team as a code owner June 27, 2025 15:40
@AlejandraPedroza AlejandraPedroza self-assigned this Jul 1, 2025
@AlejandraPedroza AlejandraPedroza changed the base branch from master to kotlin-js-doc-update July 10, 2025 14:43
@AlejandraPedroza AlejandraPedroza force-pushed the add-information-about-es-modules branch from cb9e823 to 4789de7 Compare July 10, 2025 14:44
@@ -33,8 +34,9 @@ Check the article on [JavaScript Modules](js-modules.md) for more information on

## Package structure

Kotlin exposes its package structure to JavaScript, so unless you define your declarations in the root package,
you have to use fully qualified names in JavaScript. For example:
For most of the module systems, Kotlin exposes its package structure to JavaScript,
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's worth mentioning which module systems, since Kotlin supports four only (not considering PLAIN).
Plus, you say ESM is an exception, so CJS, AMD and UMD are the one with the package structure.

@@ -54,6 +56,15 @@ Or, in the case of using `plain` as a module system setting:
alert(myModule.my.qualified.packagename.foo());
```

However, there is an exception for `ES` modules.
Copy link
Contributor

Choose a reason for hiding this comment

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

If you apply my suggestion above, you could reword this one to

The ECMAScript Modules target instead loses package information, to improve the package' bundle size and to match the typical layout of ESM packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Applied your suggestions

Copy link
Contributor

@AlejandraPedroza AlejandraPedroza left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. I made some minor style changes. Can you please check the new version?

Copy link
Contributor

@AlejandraPedroza AlejandraPedroza left a comment

Choose a reason for hiding this comment

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

LGTM!

@AlejandraPedroza AlejandraPedroza merged commit 76472a4 into kotlin-js-doc-update Aug 21, 2025
@AlejandraPedroza AlejandraPedroza deleted the add-information-about-es-modules branch August 21, 2025 09:57
AlejandraPedroza added a commit that referenced this pull request Aug 27, 2025
…#4932)

* Add extra information about ES modules inside the js-interop document

* chore: apply community suggestions on clarifying the module systems that expose package structure

* update:  js-interop review

* chore: add links to module systems

---------

Co-authored-by: alepedroza <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants