Skip to content

add .mjs to list of well known extensions - #5624

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

loganfsmyth merged 1 commit into
babel:7.0from
bmeck:mjs

Conversation

@bmeck

@bmeck bmeck commented Apr 11, 2017

Copy link
Copy Markdown
Contributor
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

codecov Bot commented Apr 11, 2017 •

Copy link
Copy Markdown

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

bmeck commented Apr 11, 2017

Copy link
Copy Markdown
Contributor Author

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

@xtuc xtuc left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

bmeck commented Apr 12, 2017

Copy link
Copy Markdown
Contributor Author

@loganfsmyth yes

@loganfsmyth

Copy link
Copy Markdown
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