This PR allows legacy decorators to work with strict class fields, which
are now stage 3 and have shipped in a number of browsers. Allowing this will
allow users of the legacy transform (which is currently recommended by the
champions of the decorator proposal) to use the proper class field semantics
for non-decorated fields, which should help prevent breakage later on.
This change is not a breaking change, since users had to explicitly opt into
loose mode in class fields before. This just gives them the option to remove
that opt-in.
* [transform-react-jsx] Add useSpread option to transform JSX
* Add validation for default option
* Add error when using useSpread and useBuiltIns at the same time
* Move useSpread to convertAttribute helper function
* Add useSpread option to presect-react
* Remove casting useSpread to boolean in preset-react option.
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* feat: implement create-regexp-features-plugin
* fix: test input is not effective
* refactor: leverage create-regexp-features-plugin
* test: add more test cases
* test: update test fixture
* chore: add type annotation to features
* test: add regression test for issue 9892
* add regression test for issue 9199
* address review comments from Nicolò
* address review comments from Brian
* small tweaks
* Enable dotAllFlag when flags includes u
* Flow enums parsing
* Parse exporting enums
* Enums parsing remove lookahead, other improvements
* Enums: add EnumBody and EnumMember aliases, change boolean members to use BooleaLiteral value
* Fix enum member init flow type, now that boolean members have a BooleanLiteral value
* Flow enums: use contextual utils, change members length checks to use logic operators, remove reserved word logic modification
* Flow enums: remove unnecessary code in generator, fix error message
* 🐛 fixed missing errors on assignment pattern in object expression
* ♻️ remove a non-needed comment
* 🐛 missed adding comma in the test input
* 🐛 fixed the failing valid-property-initializer test
* Changes UMD callsite to be more likely to pass in the intended object.
Fixes#10476
Note: This PR should be considered pseudocode and used as an illustration of the proposed fix. I do not know nearly enough about this project to know if this is an appropriate solution to the problem, nor do I have the confidence to update the tests appropriately.
* Update tests
* Make dir for babel --out-file
Currently there's unexpected regression after upgrade from babel 6.
On creating file with any depth like dist/index.js the error about
not existing directory is thrown.
In this diff I modified babel-cli to create deep directory for out-file
command.
I also replaced `mkdirp` with more supported `make-dir` package which
also have official promise support.
* Fix test
* fix: [#10561] _interopRequireWildcard should cache object only
* fix: narrow down cache restriction to object/function type
* test: add interop require null module case
* docs: add homepage link
Adds a homepage link to populate npmjs.com.
Update the repository property syntax.
* Update the repository link
Point to the root repo plus a reference to the subdirectory.
* style: drop HTML extension
The results of these tests will be stored in build artifacts which will be used to compare with test262 runs on PR (future work!). Robin has also done a
lot of work to ensure all babel packages are properly linked to the
test runner. Additionally, Nicolo has helped in mentorship and
contributions to babel-test262-runner which is used here.
We're no longer giving xunit output to CircleCI because once it sees failing tests it will mark babel's master as broken. As a stopgap, it will render the test results in the mocha spec format, which is human readable.
Co-Authored-By: Robin Ricard <rricard2@bloomberg.net>
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* Exclude catch clause from let identifier error
* Disallow let binding based on parameter
* Add test
* Remove unused getter
* Update packages/babel-parser/src/parser/statement.js
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* fix: disable caching when babel could not read/write cache
* emit warning when cache folder resides in readonly fs
* fix: always register save handler
* cache: maintain old behaviour
* test: add more test case
* fix: next tick tasks are FIFO
* test: disable test on Windows
* Inject corejs3 imports in Program:exit instead of post
This allows them to be requeued and transformed by other plugins.
* Also entry
* Rebase
* Update packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js [skip ci]
Co-Authored-By: Brian Ng <bng412@gmail.com>
For some reason, it looks like that the rimraf call didn't properly delete
the folder:
EEXIST: file already exists, mkdir 'C:\Users\travis\build\babel\babel\packages\babel-node\test\tmp'
150 | process.chdir(__dirname);
151 | if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc);
> 152 | fs.mkdirSync(tmpLoc);
| ^
153 | process.chdir(tmpLoc);
154 | };
Lets try to reuse the existing folder rather than deleting and recreating it