Skip to content

Conversation

@brizental
Copy link
Contributor

No description provided.

brizental added 2 commits March 19, 2021 14:54
This is a very weird change, I know, but there is good reason behind it:

1. ESM resolution algorithm does not currently support automatic
resolution of file extensions and does not have the hability to
import directories that have an index file. The extension and the name
of the file being import need to _always_ be spcified. See:
https://nodejs.org/api/esm.html#esm_customizing_esm_specifier_resolution_algorithm

2. Typescript does not provide features that change compiled JS code.
This means there is no Typescript feature to include the ".js" on
compiled code. See: microsoft/TypeScript#16577 (comment)

All of this results in this weird change. It is the accepted workaround
for this issue and until ES6 imports support automatic resolution of
extensions, we will keep it.
@brizental brizental requested a review from Dexterp37 March 19, 2021 14:10
Copy link
Contributor

@Dexterp37 Dexterp37 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 the great work.

@brizental brizental requested a review from Dexterp37 March 19, 2021 17:19
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

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

Let's add a changelog entry :)

@brizental brizental requested a review from Dexterp37 March 22, 2021 08:48
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

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

r+wc

Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
@brizental brizental merged commit 16afe14 into mozilla:main Mar 22, 2021
@brizental brizental deleted the 1699674-extensions branch March 22, 2021 09:06
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.

2 participants