Skip to content

add .mjs to list of well known extensions#5624

Merged
loganfsmyth merged 1 commit intobabel:7.0from
bmeck:mjs
May 1, 2017
Merged

add .mjs to list of well known extensions#5624
loganfsmyth merged 1 commit intobabel:7.0from
bmeck:mjs

Conversation

@bmeck
Copy link
Contributor

@bmeck bmeck commented Apr 11, 2017

Q A
Patch: Bug Fix? no
Major: Breaking Change? no
Minor: New Feature? yes
Deprecations? no
Spec Compliancy? yes (node-ep)
Tests Added/Pass? yes
Fixed Tickets no
License MIT
Doc PR no
Dependency Changes no

Adds default support for picking up .mjs files

@hzoo hzoo added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Apr 11, 2017
@codecov
Copy link

codecov bot commented Apr 11, 2017

Codecov Report

Merging #5624 into 7.0 will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              7.0    #5624      +/-   ##
==========================================
+ Coverage   84.45%   84.46%   +0.01%     
==========================================
  Files         285      285              
  Lines        9648     9648              
  Branches     2711     2711              
==========================================
+ Hits         8148     8149       +1     
+ Misses        998      997       -1     
  Partials      502      502
Impacted Files Coverage Δ
packages/babel-cli/src/babel/index.js 67.94% <100%> (ø) ⬆️
packages/babel-cli/src/_babel-node.js 71.83% <100%> (ø) ⬆️
packages/babel-core/src/index.js 100% <100%> (ø) ⬆️
...bel-plugin-transform-es2015-classes/src/vanilla.js 90.59% <0%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ea3338...4ae9596. Read the comment docs.

this is to conform to the plan of the Node.js EP
@bmeck
Copy link
Contributor Author

bmeck commented Apr 11, 2017

ideally this would be an ES Module only mode / checked prior to .js but I am not sure how people feel about this.

Copy link
Member

@xtuc xtuc 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 your PR, LGTM 👍

@loganfsmyth
Copy link
Member

@bmeck Could you clarify what you mean for

checked prior to .js but I am not sure how people feel about this.

You mean looking for .mjs files first, and then falling back to .js?

@bmeck
Copy link
Contributor Author

bmeck commented Apr 12, 2017

@loganfsmyth yes

@loganfsmyth
Copy link
Member

Gotcha. Yeah seems like that would be good to do for babel-register. I don't know how the current logic is implemented for ordering.

I don't think we have any control over resolution ordering for our our other usecases though.

@loganfsmyth loganfsmyth merged commit 7ca8170 into babel:7.0 May 1, 2017
aisamu added a commit to aisamu/ring that referenced this pull request Aug 8, 2018
Javascript's module system has a suggested `mjs` extension, which has received
some degree of adoption (Node [1]), tooling support (Babel [2], VSCode [3]), and
is already present on Google's JS Modules documentation [4].

The only requirement is that they're sent with JS's MIME.

[1] - http://2ality.com/2017/05/es-module-specifiers.html#why-new-extension
[2] - babel/babel#5624
[3] - microsoft/vscode#25747
[4] - https://developers.google.com/web/fundamentals/primers/modules
aisamu added a commit to aisamu/ring that referenced this pull request Aug 19, 2018
Javascript's module system has a suggested mjs extension, which has
received some degree of adoption (Node [1]), tooling support (Babel [2],
VSCode [3]), and is already present on Google's JS Modules documentation
[4].

The only requirement is that they're sent with JS's MIME.

[1] -
http://2ality.com/2017/05/es-module-specifiers.html#why-new-extension
[2] - babel/babel#5624
[3] - microsoft/vscode#25747
[4] - https://developers.google.com/web/fundamentals/primers/modules
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: modules outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants