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
added basic support for module attributes and tests updated #10962
Merged
nicolo-ribaudo
merged 71 commits into
babel:master
from
vivek12345:proposal-module-attributes
May 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
7e1a783
:recycle: added basic support for module attributes and tests updated
b810e31
attributes should be set only if moduleAttributes plugin is enabled, …
c35b06e
Merge branch 'master' of https://github.com/babel/babel into proposal…
4243ec1
:recycle: use new AST Node ImportAttribute for module attributes, tes…
vivek12345 202af5a
Merge branch 'master' of https://github.com/babel/babel into proposal…
vivek12345 14aae84
chore: fixed the eslint issue and sorted the errors in ascending order
vivek12345 8c4ecf9
improvement: added support to throw error if duplicate attributes found
vivek12345 bbb6020
chore: fixed the failing test of babel plugin dotall regex
vivek12345 ba5482e
improvement: fixed error messages, confition to check presence of wit…
vivek12345 a038601
test: added a new test for allowing hasOwnProperty as one of the modu…
vivek12345 cde4f92
chore: added a mandatory version option to use along with module attr…
vivek12345 4f16179
improvement: replaced object create with set and renamed test folder …
vivek12345 a264662
Update packages/babel-parser/src/plugin-utils.js
vivek12345 c7c2c78
Update packages/babel-parser/src/parser/statement.js
vivek12345 2b5b437
chore: unnecesaary comment removed and tests updated
vivek12345 d36d314
improvement: using node.key.start instead of this.node.start to point…
vivek12345 0a0958d
improvement: added check for line terminator
vivek12345 f28f6ad
chore: renamed valid-syntax-with-attributes-multiple-lines to invalid…
vivek12345 7806809
improvement: changed the logic and tests to only support type as the …
vivek12345 a3c6a55
improvement: don't throw an error when attribute name is not type, ju…
vivek12345 65f9f5c
Revert output.js
nicolo-ribaudo 1dacc99
improvement: removed the check for presence of tyep attribute as an e…
vivek12345 187d0d6
Merge branch 'proposal-module-attributes' of https://github.com/vivek…
vivek12345 5cb50ed
Merge branch 'master' of https://github.com/babel/babel into proposal…
vivek12345 40ddfab
feat: added syntax-import-module-attributes
vivek12345 41bb994
fix: fixed a message test in the readme for syntax-import-module-attr…
vivek12345 4030426
refactor: removed the error key ModuleAttributesWithoutType as it is …
vivek12345 792d096
refactor: renamed syntax-import-module-attributes to syntax-module-at…
vivek12345 a3c56ff
:recycle: added basic support for module attributes and tests updated
cbcdb3d
attributes should be set only if moduleAttributes plugin is enabled, …
e392984
:recycle: use new AST Node ImportAttribute for module attributes, tes…
vivek12345 256510b
chore: fixed the eslint issue and sorted the errors in ascending order
vivek12345 1ee26a7
improvement: added support to throw error if duplicate attributes found
vivek12345 2a708a5
improvement: fixed error messages, confition to check presence of wit…
vivek12345 f795d36
test: added a new test for allowing hasOwnProperty as one of the modu…
vivek12345 35a85e9
chore: added a mandatory version option to use along with module attr…
vivek12345 e3976f2
improvement: replaced object create with set and renamed test folder …
vivek12345 efacdaf
Update packages/babel-parser/src/plugin-utils.js
vivek12345 4202fa9
Update packages/babel-parser/src/parser/statement.js
vivek12345 e1016ad
chore: unnecesaary comment removed and tests updated
vivek12345 f89c15f
improvement: using node.key.start instead of this.node.start to point…
vivek12345 18dd064
improvement: added check for line terminator
vivek12345 31f6a38
chore: renamed valid-syntax-with-attributes-multiple-lines to invalid…
vivek12345 b98824f
improvement: changed the logic and tests to only support type as the …
vivek12345 1c2be01
improvement: don't throw an error when attribute name is not type, ju…
vivek12345 180b757
Revert output.js
nicolo-ribaudo ca2608f
improvement: removed the check for presence of tyep attribute as an e…
vivek12345 3581a82
feat: added syntax-import-module-attributes
vivek12345 b9d2939
fix: fixed a message test in the readme for syntax-import-module-attr…
vivek12345 24f7830
refactor: removed the error key ModuleAttributesWithoutType as it is …
vivek12345 b1270c6
refactor: renamed syntax-import-module-attributes to syntax-module-at…
vivek12345 b7280e2
Format output files
nicolo-ribaudo 6e4e730
feb-2020 -> apr-2020
nicolo-ribaudo 7a2f4f8
Revert output.js
nicolo-ribaudo 69f153e
Revert expression.js
nicolo-ribaudo 522bdc6
relaxed the argument condition on dynamic imports from 1 to 2 for pro…
vivek12345 2a3e3d0
merged with upstream master
vivek12345 b1e7ddc
merged with remote changes and merge conflicts resolved
vivek12345 2e243af
bug: fixed the version to apr-2020
vivek12345 f250937
polish: tune importArity error message
JLHwung dbf36f6
fix: allow trailing comma in import()
JLHwung 0ce6e62
chore: update version to latest month
JLHwung 9f80885
add moduleAttributes to parse typings
JLHwung aa22f1a
feat: add syntax-module-attributes to babel-standalone
JLHwung 967a9be
fix: forbid spread element in second argument of import()
JLHwung d06d08b
expect moduleAttributes when there are two arguments of import()
JLHwung f051fa1
refactor: minor tweaks
JLHwung 01933e4
Merge remote-tracking branch 'upstream/master' into proposal-module-a…
JLHwung dde6294
chore: rearrange tests
JLHwung 907aacd
Update packages/babel-parser/src/parser/expression.js
JLHwung 63b7c44
Merge remote-tracking branch 'upstream/master' into proposal-module-a…
nicolo-ribaudo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...er/test/fixtures/experimental/module-attributes/dynamic-import-with-valid-syntax/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import("foo.json", { with: { type: "json" } }) |
11 changes: 11 additions & 0 deletions
11
...est/fixtures/experimental/module-attributes/dynamic-import-with-valid-syntax/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"moduleAttributes", | ||
{ | ||
"version": "feb-2020" | ||
} | ||
] | ||
], | ||
"sourceType": "module" | ||
} |
226 changes: 226 additions & 0 deletions
226
...test/fixtures/experimental/module-attributes/dynamic-import-with-valid-syntax/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,226 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 46, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 46 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 46, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 46 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 46, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 46 | ||
} | ||
}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"start": 0, | ||
"end": 46, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 46 | ||
} | ||
}, | ||
"callee": { | ||
"type": "Import", | ||
"start": 0, | ||
"end": 6, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 6 | ||
} | ||
} | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "StringLiteral", | ||
"start": 7, | ||
"end": 17, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17 | ||
} | ||
}, | ||
"extra": { | ||
"rawValue": "foo.json", | ||
"raw": "\"foo.json\"" | ||
}, | ||
"value": "foo.json" | ||
}, | ||
{ | ||
"type": "ObjectExpression", | ||
"start": 19, | ||
"end": 45, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 45 | ||
} | ||
}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start": 21, | ||
"end": 43, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 21 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 43 | ||
} | ||
}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start": 21, | ||
"end": 25, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 21 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 25 | ||
}, | ||
"identifierName": "with" | ||
}, | ||
"name": "with" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "ObjectExpression", | ||
"start": 27, | ||
"end": 43, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 27 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 43 | ||
} | ||
}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start": 29, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 29 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 41 | ||
} | ||
}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start": 29, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 29 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
}, | ||
"identifierName": "type" | ||
}, | ||
"name": "type" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "StringLiteral", | ||
"start": 35, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 35 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 41 | ||
} | ||
}, | ||
"extra": { | ||
"rawValue": "json", | ||
"raw": "\"json\"" | ||
}, | ||
"value": "json" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are passing a message here to explain the exact number of arguments needed. for module attributes it is two arguments and for every other thing it is only one argument.