Nicolò Ribaudo
6ef7b51a11
Implement assumptions defined in the babel/rfcs#5 RFC
...
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408 )
- `setClassMethods` (#12407 )
- `setComputedProperties` (#12490 )
- `ignoreFunctionLength` (#12491 )
- `noDocumentAll` (#12481 )
- `iterableIsArray` and `arrayLikeIsIterable` (#12489 )
- `pureGetters` (#12504 )
- `skipForOfIteratorClosing` (#12496 )
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505 )
- `noNewArrows` (#12613 , #12793 )
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497 )
- `constantReexports` and `enumerableModuleMeta` (#12618 )
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726 )
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
2021-02-21 17:09:45 +01:00
Nicolò Ribaudo
7965c15557
Add @babel/core support for the new assumptions option ( #12219 )
...
- Disallow setting assumptions to `false` in presets (#12498 )
2021-02-21 17:09:45 +01:00
Nicolò Ribaudo
cb404e4776
Add targets and browserslist* options to @babel/core ( #12189 )
2021-02-21 17:09:43 +01:00
Nicolò Ribaudo
31ca15ef58
Support .mjs plugins/presets and async factories ( #12266 )
2021-02-21 17:08:30 +01:00
Devon Govett
35c41148dd
Do not cache non-existent JS config files forever ( #12211 )
...
Missed a spot in #11906 . Currently if you don't have a JS config file and then add one to your project, it will not be picked up without restarting the process. Changing from caching forever to never caching when files don't exist fixes the issue.
2021-02-18 12:18:02 +01:00
Nicolò Ribaudo
e735266dee
Avoid importing .json files ( #12759 )
...
* Avoid importing `.json` files
* Use ESold in babel.config.json
* Use `import/extensions` eslint plugin
2021-02-05 23:34:36 +01:00
Nicolò Ribaudo
4f2d47500f
Don't use require() in ESM files ( #12728 )
...
* Update `yarn-plugin-conditions`
* Don't use `require()` in ESM files
2021-02-01 17:09:02 +01:00
Henry Zhu
464a02ffe1
[babel 8] Replace lodash/escapeRegExp with escape-string-regexp ( #12677 )
...
Co-authored-by: James Addison <jay@jp-hosting.net>
2021-01-23 22:21:34 +01:00
Nicolò Ribaudo
208acb1d6c
Use require.resolve instead of the resolve package ( #12439 )
2020-12-04 08:57:09 +01:00
Jason Miller
ddd868f838
Account for ConfigItem being generated by another copy of Babel ( #11734 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-11-10 15:02:46 +01:00
Nicolò Ribaudo
31396b286d
Make loadPartialConfig's options optional ( #12200 )
2020-10-16 15:46:49 +02:00
Sven Sauleau
af8e0facc1
Parse import-assertions ( #12139 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-14 21:18:16 +02:00
Huáng Jùnliàng
f697e7995d
Transform class static block ( #12143 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 21:16:24 +02:00
Huáng Jùnliàng
21d7ee2610
String import/export specifier ( #12091 )
...
* feat: parse moduleExportName
* feat: add validators
* Support string specifier name in commonjs transform
* Support string specifier name in export-ns-from
* test: add loose testcases
* test: add testcases for amd and umd
* feat: support systemjs
* test: update fixtures fixed in #12110
* add plugin name typings
* test: rename test layout
* feat: implement under moduleStringNames flag
* chore: add plugin syntax module string names
* feat: support ModuleExportName as ModuleExportName
* test: update test fixtures
* fix flow errors
* docs: update AST spec
* feat: support { "some imports" as "some exports" }
* feat: support { "some imports" as "some exports" } in systemjs
* test: add test on `import { "foo" }`
* Address review comments
* add moduleStringNames to missing plugin helpers
* Apply suggestions from code review
* update test fixtures
* Update packages/babel-parser/src/parser/error-message.js
* update test fixtures
Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 20:01:37 +02:00
Nicolò Ribaudo
1b90d90fcc
Instantiate presets before plugins ( #11689 )
2020-10-14 19:59:02 +02:00
Devon Govett
ce7b170ab7
Return a list of files that were read from loadPartialConfig ( #11907 )
2020-10-14 19:59:02 +02:00
Tim Gates
1334bc99e0
docs: Fix simple typo, preprelease -> pre-release ( #12102 )
...
There is a small typo in packages/babel-core/src/transformation/file/file.js, packages/babel-plugin-transform-runtime/src/helpers.js.
Should read `pre-release` rather than `preprelease`.
2020-09-23 16:06:21 -04:00
Devon Govett
c29138fd72
Do not cache non-existent files forever ( #11906 )
2020-08-04 16:07:25 -04:00
Huáng Jùnliàng
164a93945d
add showConfig support ( #11588 )
...
* draft: showConfig support
* feat: pass through showConfig command options
* update test file
* refactor: add createLogger to makeChainWalker
* serializing dynamic plugin instance
* fix flow errors
* chore: add tests on extended config
* fix: do not print empty presets
* add more test cases
* add windows testcases
* address review comments
* throw error when showConfigPath does not exist
* print reason when showConfig is targetting an ignored file
* remove showConfig: boolean
* refactor: simplify environment flag name
* rename test fixtures
* fix: throw when SHOW_CONFIG_FOR is not a regular file
* cleanup test fixtures
* add test on only
* Update packages/babel-core/src/config/files/configuration.js
Co-authored-by: Brian Ng <bng412@gmail.com>
* address review comments
* update test fixtures
* feat: sort config items in ascending priority
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-30 09:24:19 -04:00
Vahagn Aharonian
b651a6f6ab
Enable logical assignment by default in @babel/parser ( #11860 ) ( #11869 )
2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
059e9124ff
Add decimal parsing support ( #11640 )
...
* docs: add DecimalLiteral to AST spec
* add decimal support
* fix: throw invalid decimal on start
* add DecimalLiteral type definitions
* update parser typings
* add generator support
* add syntax-decimal plugin
* Add syntax-decimal to babel-standalone
* add syntax-decimal to missing plugin helpers
* fix incorrect test macro
2020-07-29 16:43:15 -04:00
coderaiser
cf425a0bde
feature: babel-core: add cloneInputAst ( #10241 )
...
Co-authored-by: coderaiser <coderaiser@cloudcmd.io>
2020-07-29 16:40:02 -04:00
Huáng Jùnliàng
8f191ead92
chore: fix typo in codebase ( #11846 )
2020-07-16 16:01:20 -05:00
Wojciech Maj
1dd94e813e
Replace non-inclusive "whitelist" and "blacklist" terms with "allowlist" etc. ( #11758 )
2020-06-29 15:39:38 -04:00
Huáng Jùnliàng
601c824873
Refine babel core types ( #11544 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-06-21 22:04:12 +02:00
Bogdan Savluk
4108524856
Update prettier to v2 ( #11579 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-06-07 22:21:33 +02:00
Huáng Jùnliàng
6b7a6dccd2
fix: add new plugin names to missing plugin helpers ( #11643 )
2020-05-29 14:04:47 -04:00
Nicolò Ribaudo
31b361b736
Use ?. where it represents the intended semantics ( #11512 )
2020-05-09 23:31:50 +02:00
Nicolò Ribaudo
90a9103e55
Update Flow to 0.123.0 ( #11500 )
2020-04-30 15:26:03 +02:00
Jacob Dreesen
d05334bde2
Fix typo and remove outdated doc comment ( #11472 )
...
* Fix typo
* Fix outdated doc comment [skip ci]
2020-04-25 10:24:22 +02:00
Huáng Jùnliàng
1c0970131e
polish: recommend preset for js extensions ( #11421 )
2020-04-16 21:13:57 +02:00
Huáng Jùnliàng
88b12e3dd1
fix: add classPrivateProperties and classPrivateMethods to missing plugin helper ( #11397 )
...
* fix: add classPrivateProperties and classPrivateMethods to missing plugin helper
* make flow happy
2020-04-09 19:41:14 -04:00
Huáng Jùnliàng
4bf36e64da
Create File class for babel helpers ( #10575 )
...
* add test
* fix: pass File to helper traverser
* pass babel.File to helpers.ensure
2020-03-17 09:58:46 +01:00
Nicolò Ribaudo
a875560c31
Allow defining the moduleIds-related option in the transform p… ( #11194 )
...
* Update "moduleIds" tests
* Allow defining the moduleIds related options in the transform plugins
- moduleIds
- moduleId
- getModuleId
- moduleRoot
* Sort deps
2020-03-16 23:58:04 +01:00
Rick Button
3ce7c2e394
Added support for record and tuple syntax. ( #10865 )
...
* Added support for record and tuple syntax.
This commit adds support for both the hash #{} and bar {||}
syntaxes to babel-parser, as well as adds the supporting
babel-plugin-syntax-record-and-tuple plugin to enable support
for the syntax. Does not include any transform for records and
tuples.
* typo
* added check to ensure recordAndTuple in babel-parser
* switched to syntaxType option instead of explicit entries for each record and tuple type
* switched to using recordAndTupleSyntaxType for generator options instead of adding to node
* added tests for generator option recordAndTupleSyntaxType
* added test for record and tuple bar syntax with flow typings
* added tests for invalid/missing recordAndTuple syntaxType parser option
* fixed flowcheck errors
* fix merge with class privates in tokenizer
* Update packages/babel-parser/src/types.js
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* improved recordAndTuple generator error message, added tests for invalid,missing options
* updated error messages for invalid parser syntaxType option
* updated error message
* added better error messages for when the recordAndTuple syntaxType is doesn't match the syntax used
* updated record and tuple support to use new error message templates
* added recordAndTuple to missing plugin helpers
* Fix linting
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-03-16 23:57:44 +01:00
Nicolò Ribaudo
114f6726a7
Pass URLs to import() rather than paths ( #11193 )
...
* Pass URLs to import() rather than paths
* Make tests pass
* (╯°□°)╯︵ ┻━┻
* (╯°□°)╯︵ ┻━┻ (╯°□°)╯︵ ┻━┻ (╯°□°)╯︵ ┻━┻
2020-03-03 19:54:01 +01:00
Huáng Jùnliàng
0b3dea8f54
Turn on no-fallthrough rule ( #11093 )
...
* chore: turn on no-fallthrough
* chore: fix no-fallthrough errors
2020-02-07 22:05:19 +01:00
Huáng Jùnliàng
fa975bf7cd
polish: throw human-friendly error when item-option pair is in… ( #10969 )
...
* polish: throw human-friendly error when item-option pair is incorrectly unwrapped
* add testcase for plugin
* fix: exclude false positive
* fix: validate should support plugin optionsSourceKind
* Revert "fix: validate should support plugin optionsSourceKind"
* fix: validate plugin object in assertNoUnwrappedItemOptionPairs
* fix flow error
* update test fixtures
* refactor: move to loadDescriptor catch clause
* chore: throw Error instead of builtin ReferenceError
* fix flow errors
* chore: add more test cases
2020-01-20 21:05:07 +01:00
Yordis Prieto
4c28f54152
Add babelrc.json support ( #10783 )
...
* Add babelrc.json support
* Add tests
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-01-10 23:41:42 +01:00
Nicolò Ribaudo
ae06baf22f
Add support for babel.config.mjs and .babelrc.mjs ( #10903 )
...
* Add support for babel.config.mjs and .babelrc.mjs
* Use path.extname
2020-01-10 23:14:29 +01:00
Nicolò Ribaudo
282f81bd67
Prepare @babel/core for asynchronicity ( #10507 )
...
* Prepare @babel/core for asynchronicity
* Include regenerator-runtime in standalone build
* Fix rollup build
2020-01-10 22:44:13 +01:00
Oleksandr Fediashov
c3388ea42f
Enable nullish coalescing by default in @babel/parser ( #10819 )
...
* move files, remove hasPlugin() & expectPlugin()
* restore permissions
2020-01-10 02:52:53 +01:00
Kai Cataldo
ee5b79d75d
@babel-core: parse should parse only ( #10914 )
...
* @babel/core: parse methods should parse only
* Update Flow types
2019-12-24 18:28:57 +01:00
Huáng Jùnliàng
e85c9b9ec8
fix: skip merging large input sourcemaps ( #10890 )
2019-12-19 01:16:20 +01:00
Nicolò Ribaudo
80e95d0c83
Fix flow
2019-12-18 14:34:06 +01:00
Huáng Jùnliàng
b3c7df9314
fix: avoid string copy when processing input source-map ( #10885 )
...
Co-Authored-By: Justin Ridgewell <justin@ridgewell.name>
2019-12-17 21:12:55 -06:00
Jaroslav Kubíček
26c0a32c7c
refactor: Improve error message in @babel/core when root config is not found ( #10778 )
2019-12-01 00:07:05 +01:00
Brian Ng
c37361ba2e
Bump prettier@1.19.1 ( #10728 )
2019-11-16 16:05:40 +01:00
Nicolò Ribaudo
bea1b0d0af
Add support for .cjs config files ( #10599 )
...
* Remove duplicate config loading logic and errors
* Add support for .cjs config files
* Add tests
* [tests] Fallback for fs.promises on node 6
2019-11-04 00:24:44 +01:00
Huáng Jùnliàng
d08702c9d2
inputSourceMap should work when it is in an external file ( #10623 )
...
* fix: construct comment block for fromMapFileComment
* add test
* small tweak: redundant capturing group
2019-10-31 16:12:44 -04:00