17 Commits
Author SHA1 Message Date
65b1f4e89e Improve comments generation (#14979)
Co-authored-by: Nicolò Ribaudo <[email protected]>
2022-10-09 17:21:02 +02:00
d86910533e Lazily initialize and cache constant JSX elements (#12967)
Co-authored-by: Justin Ridgewell <[email protected]>
2021-03-06 17:33:43 +01:00
360e501253 Enable external-helpers by default in tests (#12911)
Co-authored-by: Huáng Jùnliàng <[email protected]>
Co-authored-by: Babel Bot <[email protected]>
2021-02-26 23:33:26 +01:00
Nicolò RibaudoandGitHub b406d255b7 Skip newlines around inline #__PURE__ annotations (#11133)
* Skip newlines around #__PURE__ annotations

* Update tests
2020-02-13 19:16:33 +01:00
Serge HavasandNicolò Ribaudo ac57ab7450 [fix] jsx helper calls order (#10307)
imitate properly react createElement calls order
2019-08-08 22:43:57 +02:00
Artem ButusovandNicolò Ribaudo d51fc842f7 Added es3 backward compatibility for react helper code (#10155)
* Added es3 backward compatibility for react helper code

* tweak comment [skip ci]
2019-07-03 16:49:20 +02:00
Logan SmythandGitHub d57db9a48c Format fixture JSON with Prettier. (#8658) 2018-09-09 17:57:52 -07:00
Mateusz BurzyńskiandGitHub ecde96cef8 Mark hoisted react constant elements as #__PURE__ (#7372) 2018-02-21 18:58:56 +01:00
Jorrit SchippersandMateusz Burzyński 7789c3ebf3 Prevent object shape change in jsx helper (#7170)
Keeping the shape of an object constant is a performance improvement for modern javascript engines. At the point of the code change it is certain that the `children` property will be set later, so the property can already be set to `undefined`.
2018-01-15 16:37:57 +01:00
Nicolò RibaudoandBrian Ng a1c0d724ae Remove old expected.{js,json} files (#7187) 2018-01-09 13:10:30 -06:00
Raja SekarandNicolò Ribaudo 4b5e34de4e Renamed files 2018-01-09 15:36:42 +01:00
Pranav PrakashandJustin Ridgewell da418a4ee9 Use new Array instead of Array for V8 optimization (#6250)
* Use new Array instead of Array for V8 optimization

* fix spacing [skip ci]

* Remove extraneous use strict clauses
2017-09-18 14:14:46 -04:00
Logan Smyth 67f69fe1ba Represent helpers as simple modules. 2017-09-12 22:15:16 -07:00
Amjad Masad 0d8e5a9e86 Fix over-parenthesizing of function expressions 2015-12-24 14:55:51 -08:00
Ben Alpert d1b8db1532 React inlining: Refactor to reduce parsing cost
- Have the `jsx` helper do the `defaultProps` work instead of calling `defaultProps` inline.
- Put `key` after `props` and make it optional.
- Inline `children` as rest args instead of in the object.
- Rename `createRawReactElement` to `jsx`. I wish I was kidding.

Most of these are silly microoptimizations. In my test file (based off an internal RN app), this reduces the parsing overhead of inlining from around 1% to 0.1% in JSC and from 0.6% to 0.0% in V8 (compared to element inlining before this commit).

Once parsed, the initial render with inlining is the same speed as not inlining in JSC and ~1% slower in V8. A second initial render in the same context (reusing the function objects, JIT, etc) is 2.0% faster in JSC and 5.5% faster in V8.
2015-11-12 18:05:57 -08:00
Ben Alpert 3cad287233 Use a helper function for React "inlining"
Either due to lower parsing costs or better type inference, this seems
to perform better than direct object inlining. (All along, the main win
was skipping a loop through props, not avoiding a function call.)
2015-11-10 21:10:06 -08:00
Sebastian McKenzie 15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00