31 Commits

Author SHA1 Message Date
Nicolò Ribaudo
28d2cbcbf3
Lazily inject imports to the JSX runtime (#12493) 2020-12-15 12:55:17 +01:00
Mateusz Burzyński
c2fcd69e94
Stop using old JSX transform (#12253) 2020-12-08 22:41:13 +01:00
Luna Ruan
748897be07
Add experimental version of the `babel-plugin-transform-react-… (#11154)
* add next option for babel-plugin-transform-react-jsx

* address review comments

* chore: update test fixtures

* Update fixture

* Add "columnNumber" to the new React transform

* Update windows fixtures

* Delete unused output.js

* Update windows tests

* Fix windows again

* fix comments

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Moti Zilberman <motiz88@gmail.com>
2020-03-17 09:16:53 +01:00
Aziz Khambati
a0d76a8c0e Fix pragmaFrag spelling in error message (#10868) 2019-12-16 09:55:08 -05:00
Nicolò Ribaudo
8c7d4b55c9
Add plugins name (#8769)
* Add plugins name

* Add missing names found by the plugin

* Add eslint plugin
2018-11-18 23:02:58 +01:00
Alican Çubukçuoğlu
bf8c4785f2 Fix "TypeError: comments is not iterable" (#8701) 2018-11-09 13:58:28 -08:00
Logan Smyth
a4795408b4
Allow plugins to assert that a specific babel version has loaded the plugin. (#7450) 2018-03-04 14:36:54 -08:00
Nicolò Ribaudo
a2aabbd33d
Generate better builder names for JSX* and TS* (#6967)
e.g. JSXIdentifier -> jsxIdentifier.
The jSXIdentifier alias isn't removed, so this commit doesn't introduce breaking changes.
2017-12-07 12:17:40 +01:00
Logan Smyth
b19b66d94b Use peerDep rather than plugin param for common APIs. 2017-11-06 11:32:47 -08:00
Clement Hoang
1a7194a22f Add JSX Fragment syntax support (#6552)
* Add JSX Fragments to babel-types

* Support JSX fragments in the transform-react-jsx plugin

* Add tests JSX fragments

* Update helper-builder and transform plugin documentations for jsx fragment

* Add generator for jsx fragments

* Add test for jsx fragment generator

* Split jsx transform example into normal and fragment examples

* Remove unnecessary fields from ElementState in babel-helper-builder-react-jsx

* inline [skip ci]
2017-11-03 10:43:48 -04:00
Jakub Beneš
04d2c030be Add a 'throwIfNamespace' option for JSX transform (#6563)
* Added tests for ifThrowNamespace flag

* JSX transformator could work with XMLNamespaces (ifThrowNamespace flag)

* Use template literal instead

* Attempt to reword the message

* Added docs

* Reworded docs

* Reworded docs

* Fixed missing space in error message
2017-10-28 20:44:15 -04:00
Logan Smyth
765e920e48 Fix regression that leaks JSX pragma config between files. (#6519) 2017-10-19 16:09:56 -07:00
Henry Zhu
cde0054227 Scoped: change src imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Anton Rusinov
fcdfc61bdb Move plugin processing to top of plugins (#6381)
* centralize plugin options

* Centralize plugins options

- move more options to the top
- move validations that depend on options to the top

* use isLoose option

* Move more validations to the top

* Move ref parameter for rewriteModuleStatementsAndPrepareHeader() to the top

* fix eslint errors

* remove unused parameter

* set default systemGlobal value

* Revert "Move ref parameter for rewriteModuleStatementsAndPrepareHeader() to the top"

This reverts commit b3855302d17fa19d8acb4c8accab3680c8d2710e.

* Revert "Move more validations to the top"

This reverts commit e5861d8a034ff8f553391f55654f753bcf428a5d.

* fix allowMutablePropsOnTags option usage

* improve naming

* change Contructor definition for sake of consistency

* move allowMutablePropsOnTags validation to the top

* add missing !
2017-10-10 00:51:34 -04:00
Astha Sharma
3a2b7fe3cd JSX pragma revert (#6195)
* Removed the deprecated jsx pragma detection code and the concerned tests that included jsx-pragma

* Removed extra tests

* Restored packages/babel-plugin-transform-react-jsx/test/fixtures/react/honor-custom-jsx-pragma-option/

* Added JSX_ANNOTATION_REGEX

* Reverted the tests for jsx-pragma-options and removed those which throw deprecated message
2017-09-04 00:25:56 -04:00
Astha Sharma
62c22c7b5d Removed the deprecated jsx pragma detection code (#6145)
* Removed the deprecated jsx pragma detection code and the concerned tests that included jsx-pragma

* Removed extra tests

* Restored packages/babel-plugin-transform-react-jsx/test/fixtures/react/honor-custom-jsx-pragma-option/
2017-08-22 15:29:06 -04:00
Noah Lemen
51a293601b add JSXAttribute visitor function, wraps JSXElement attributes in a JSXExpressionContainer; also adds test fixtures (#6006) 2017-07-25 09:30:32 -04:00
Brian Ng
e4b35f680d
Run prettier 2017-06-27 12:15:00 -05:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Amjad Masad
bf600b0526 fix lint issue 2016-03-16 20:06:09 -07:00
Amjad Masad
3f4b88e638 Don't reuse same node for React.createElement
Is causing problems with path cache. See https://github.com/babel/babel/pull/3428
2016-03-16 18:14:16 -07:00
Amjad Masad
3667527d04 Revert "Remove flow"
This reverts commit 2827ff6b01dcce69e9d3c0402e96b52b3a2a47ee.
2016-03-03 14:49:20 -08:00
Sam Goldman
2827ff6b01 Remove flow 2016-03-01 22:33:30 -08:00
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
claudiopro
6d1a6dfc94 Fixes @jsx pragma detection + tests 2015-11-17 22:32:44 +01:00
Sebastian McKenzie
e62a00df50 rename NumberLiteral to NumericLiteral and RegexLiteral to RegExpLiteral 2015-11-03 01:19:35 +00:00
Sebastian McKenzie
ae7d5367f1 6.0.0
I'm extremely stupid and didn't commit as I go. To anyone reading this
I'm extremely sorry. A lot of these changes are very broad and I plan on
releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm
afraid I couldn't wait. If you're ever in London I'll buy you a beer
(or assorted beverage!) to make up for it, also I'll kiss your feet and
give you a back massage, maybe.
2015-10-29 17:51:24 +00:00
Sebastian McKenzie
9969224a93 add more plugins, rename some 2015-09-15 06:12:46 +01:00