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

1699674 - Fix support for ES6 importing #123

Merged
merged 7 commits into from
Mar 22, 2021

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.

glean/package.json Outdated Show resolved Hide resolved
@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 :)

glean/tests/core/metrics/labeled.spec.ts Show resolved Hide resolved
glean/package.json Show resolved Hide resolved
@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

CHANGELOG.md Outdated Show resolved Hide resolved
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