Nicolò Ribaudo
a6d77d07b4
[babel 8] Remove @babel/runtime@<=7.13.0 compat check ( #14120 )
2022-01-08 21:06:40 +01:00
Sneh Khatri
ed3036d11c
Register binding for newly created vars for commonjs transforms ( #14097 )
2022-01-06 18:37:05 +01:00
Nicolò Ribaudo
2d989a983d
Run tests in a native Node.js ESM environment ( #13966 )
2021-12-03 15:32:58 +01:00
Huáng Jùnliàng
14572e1881
Sort module export names ( #13788 )
...
* fix: sort export init statements by name
* update test fixtures
* refactor: reduce memory footprint
* review comments
2021-09-26 10:12:18 -04:00
Nicolò Ribaudo
8fb50429ea
Throw a better error when transforming imported bindings in types ( #13739 )
...
* Throw a better error when transforming imported bindings in types
* Also type casts
* Update error message
2021-09-16 23:14:41 +02:00
Huáng Jùnliàng
1f79784a99
archive stage 4 parser plugins ( #13717 )
...
* archive stage 4 parser plugins
* use npm protocol for archived plugins
* fix: get module.exports from archived plugins
* remove syntax-top-level-await from test options
* use npm syntax-class-static-block
2021-09-01 15:35:24 -04:00
Federico Ciardi
7e50ee2d82
feat: add noIncompleteNsImportDetection assumption to plugin-transform-modules-commonjs ( #13290 )
2021-08-03 23:55:09 +02:00
overlookmotel
5ac5e3572f
Fix const violations in ESM imports when transformed to CJS ( #13258 )
2021-06-22 19:33:46 +02:00
Lively
950d3519e8
fix destructuring of empty string ( #13444 )
...
* fix destructuring empty string
* use variable on expect
* overwrite all tests
* fix test cases
2021-06-14 17:07:12 +02:00
Huáng Jùnliàng
9e241fc180
Better error for export * as ns without the correct plugin ( #13296 )
2021-05-12 00:40:13 +02:00
Nicolò Ribaudo
07440424d9
Archive @@babel/plugin-syntax-module-string-names ( #13246 )
...
babel/babel-archive@15c88ef856
2021-05-03 14:07:25 -04:00
Nicolò Ribaudo
910b1f266f
Archive @babel/plugin-syntax-class-properties ( #13232 )
...
babel/babel-archive@b95d3626ad
2021-04-29 23:56:03 +02:00
Nicolò Ribaudo
be03be1bc3
Implement importInterop: "node" option for module transforms ( #12838 )
2021-04-28 18:22:47 +02:00
Nicolò Ribaudo
87e35ae5c7
Fix undeclared variable in iterableToArrayLimit ( #13185 )
2021-04-21 00:39:00 +02:00
Nicolò Ribaudo
808d437cf4
Support iterating generators in browsers without Symbol ( #13129 )
2021-04-15 23:47:53 +02:00
Huáng Jùnliàng
6ee87eea49
[babel 8] fallback targets to "defaults, not ie 11" ( #12989 )
2021-03-23 20:17:16 +01:00
Nicolò Ribaudo
ea6a438315
Enable external-helpers by default in tests ( #12911 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
2021-02-26 23:33:26 +01:00
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
fb12afc289
Declare template objects inline ( #12588 )
2021-01-05 23:25:15 +01: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
Niklas Mischkulnig
a080c82777
[cjs] Skip duplicate reexported bindings in namespace reexports ( #11739 )
2020-09-28 16:22:13 +02:00
Chintan Acharya
93429f8b09
Fix helpers.unsupportedIterableToArray for Map and Set ( #11495 )
...
Fixes #11494
2020-04-28 07:27:03 +02:00
Nicolò Ribaudo
10aa97bc10
Allow rest/spread on polyfilled or builtin iterables without Symbol support ( #11268 )
...
* Allow rest/spread on polyfilled or builtin iterables when `Symbol` unsupported
Currently, when `Symbol` is not supported, we allow using rest/spread with:
- arrays
- strings
- arguments
With this PR, it will be also possible to use it with
- maps
- sets
- binary arrays
While in old browsers es6 builtins would still need to be polyfilled, it's way
easier to polyfill them because `Symbol` cannot be reliably polyfilled.
I didn't use `instanceof` becase:
- it doesn't work with polyfills not attatched to the global scope
- when using Babel to load polyfills, it would force the inclusion of `Map` and `Set` polyfills even if they are not used
Downside: the current approach of relying on `toString || construcor.name` doesn't work with subclasses.
* Don't use Array.from for array-like objects
2020-03-17 08:14:05 +01:00
Nicolò Ribaudo
1ba41f2084
Throw better errors for non-iterables when Symbol doesn't exist ( #11264 )
2020-03-16 16:34:33 +01:00
Siddhant N Trivedi
3c6a8ae200
Fix rewriteThis in helper-module-transforms for computed class… ( #11109 )
...
* Fix rewriteThis in helper-module-transforms for computed class elements
* Added test file and corrected the visitor
* Revert .gitignore
* Using skipAllButComputedKey method from plugin-replace-supers
* added tests for class methods
* Added tests for both class properties and methods and fixed skipping computed key for methods
* Fixed condition for class methods
* revised the conditions for class methods
* Added more tests and used else-if in classmethod condition
* Update packages/babel-helper-replace-supers/src/index.js
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-02-12 21:19:10 +01:00
Vedant Roy
dadba01249
Fix export bindings not updated by 'for...in' and 'for...of' ( #11074 )
...
* Correctly transpile export bindings for some for-of loops
* Correctly transform non-destructured for of loops to update exported variables
* Add tests
* Don't replace entire for of loop
* Correctly transform destructured for-of/for-in exports
* Update exported variables in array pattern and more fixes
* Refresh test output
* Update tests and rebase on master
* Refactor ForOf|ForIn visitor
* Don't transform re-declared exported vars
* Generate better name for loop id
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* Idiomatically generate UidIdentifier
* Update scope after replacing loop declaration
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-02-09 11:41:29 +01:00
Nicolò Ribaudo
a677d59a63
Archive syntax plugins enabled by default ( #10820 )
...
* Remove syntax plugins enabled by default
Moved to babel-archive: babel/babel-archive@8f23ddce03
- `@babel/plugin-syntax-async-generators`
- `@babel/plugin-syntax-bigint`
- `@babel/plugin-syntax-dynamic-import`
- `@babel/plugin-syntax-json-strings`
- `@babel/plugin-syntax-nullish-coalescing-operator`
- `@babel/plugin-syntax-object-rest-spread`
- `@babel/plugin-syntax-optional-catch-binding`
- `@babel/plugin-syntax-optional-chaining`
* Fix build script
* Fix jest config
* Remove archived plugins from tests
2020-01-13 00:31:48 +01:00
Klaus Meinhardt
b91720c1cc
helper-module-transforms: dereference imported template tag ( #10934 )
...
* Dereference imported template tag
* apply fix for OptionalCallExpression as well
2019-12-28 16:46:20 -05:00
Huáng Jùnliàng
4436ffd604
Revert "Add ".js" extension to injected polyfill imports ( #10549 )" ( #10835 )
...
This reverts commit d3a37b5d08074c007268eb15a11ae432165bad5d.
2019-12-07 23:05:35 +01:00
shimataro
d3a37b5d08
Add ".js" extension to injected polyfill imports ( #10549 )
...
* Node modules compatibility: add ".js" extension to imported polyfills
* Update fixtures
* add extensions on calling `addDefaultImport()`, not in the function.
2019-12-06 13:30:23 +01:00
Nicolò Ribaudo
43aa7e262c
Don't throw when destructuring into a var named as an import ( #10628 )
2019-11-04 22:50:36 +01:00
ExE Boss
43065a9e24
fix(babel‑helpers/interopRequireWildcard): Avoid double nullis… ( #10585 )
...
* fix(babel‑helpers/interopRequireWildcard): Avoid double nullish check
* Update fixtures
2019-10-24 23:14:44 +02:00
samuel kwok
fe258dec04
fix: _interopRequireWildcard should only cache objects ( #10574 )
...
* fix: [#10561 ] _interopRequireWildcard should cache object only
* fix: narrow down cache restriction to object/function type
* test: add interop require null module case
2019-10-19 12:01:38 +02:00
Huáng Jùnliàng
b64cb9aaf1
fix: early return when instance is not iterable ( #10396 )
...
* fix: early return when instance is not iterable
* chore: update test fixtures
* fix: gaurd against arguments for old browsers
2019-09-06 18:09:57 +02:00
ifsnow
9ec26a7d3e
Improves the logic to import objects in helpers ( #10161 )
...
* Improves the logic to import objects in helpers
* Modified to work with more cases.
* Modified by considering exception cases
* Fixed not using bundler's polyfill
Co-Authored-By: Jordan Harband <ljharb@gmail.com>
* Updated test output files
* Changes to cache logic
* Modified to use if statement
2019-08-08 11:11:50 +02:00
Daniel Tschinder
4f0840ab88
Update dev dependencies and fix linting errors ( #10228 )
...
* chore: Uppate dev dependencies
* chore: Fix lint errors
* chore: Format options.json files
* chore: Fix stupid flow errors
* Update test262 whitelist
Seems test262-stream was updated and now these tests work.
2019-07-27 15:09:30 +02:00
Nicolò Ribaudo
38f8bbac1a
Create @babel/plugin-proposal-dynamic-import ( #9552 )
...
* Create @babel/plugin-proposal-dynamic-import
* Use airbnb/babel-plugin-dynamic-import-node
Do not duplicate code, which will unavoidably lead
to bugs being fixed in one plugin and not in the other.
* Update error message
* Add error callback to amd interop
* Update babel-plugin-dynamic-import-node
2019-06-30 13:21:46 +02:00
Corey Farrell
8ca99b9f09
Fix: PrivateName Identifier should not be isReferenced. ( #9861 )
2019-04-15 22:05:16 -05:00
Corey Farrell
f31c72f310
Fix handling of class property value this in module transforms. ( #9857 )
...
Prevent module transforms from rewriting `this` to `void 0` when found in the values of private class properties. Add tests to prevent regressions.
2019-04-15 22:45:10 +02:00
Andrew Anikin
123fdfd314
Fix lazy option of babel-plugin-transform-modules-commonjs ( #9802 )
...
* Fix lazy mode of babel-plugin-transform-modules-commonjs (#9447 )
* Update output snapshots for lazy mode of babel-plugin-transform-modules-commonjs (#9447 )
2019-04-01 07:59:12 +02:00
Nicolò Ribaudo
f195daa092
Don't add params of anonymous exported function decls to the outer scope ( #9613 )
...
* Don't add params of anonymous exported function decls to the outer scope
* Test
2019-03-01 00:09:49 +01:00
Nicolò Ribaudo
5c8cc0d536
Mark FOO in "var { x: FOO }˝ as a binding, not as a reference ( #9492 )
2019-02-27 00:17:11 +01:00
Brian Ng
f77c450cda
Bump prettier ( #9373 )
2019-01-22 09:16:32 -06:00
Daniel Tschinder
f4eec5ca79
Add new flag that indicates if a module has exports ( #9171 )
2018-12-12 21:24:44 -08:00
Logan Smyth
79b2af5997
Format fixture JSON with Prettier. ( #8658 )
2018-09-09 17:57:52 -07:00
Logan Smyth
935533cff3
Ensure that the wildcard interop is used with re-export + default. ( #8316 )
2018-07-14 12:49:31 -07:00
Henry Zhu
10910a10f5
Remove yearly presets from repo, inline in standalone ( #8274 )
...
These were already deprecated in v6, just didn't remove the folders?
2018-07-09 14:23:25 -04:00
Logan Smyth
b6eba87daa
Rename some test fixtures so they run properly. ( #8265 )
2018-07-04 18:33:26 -07:00
Dennis Czombera
040ba2bf53
Remove no longer needed #__PURE__ annotations for taggedTemplateLiteral helper ( #7914 )
...
* Remove pure comment annotation
* Update outputs
2018-05-12 15:19:33 +02:00