Commit Graph

104 Commits

Author SHA1 Message Date
Paul O’Shannessy 2058ad99be Sync out latest JSX transforms
The biggest change: instead of calling functions directly, we now use
React.createElement to wrap.

The other big change: this removes the need for the @jsx pragma.
Instead we'll parse everything, assume React is in scope,
and only look for the actual XJS parts in the AST (as opposed to only
runing the transform when @jsx was specified in the docblock).

Note: this is actually a series of commits internally and should have
been syned out in pieces over the past several weeks.
2014-08-20 00:27:38 -07:00
Paul O’Shannessy d9a053d287 Don't force sourcemaps on for JSXTransformer APIs
In case somebody doesn't want sourcemaps (eg, react-rails) or r.js
2014-08-15 17:51:41 -07:00
Paul O’Shannessy d970dc45d9 Merge pull request #1826 from syranide/jsxasync
JSXTransformer respects async attribute
2014-08-14 15:13:04 -07:00
Paul O’Shannessy d7f21d760b Update recast to 0.6, update constants.js
I dropped the part of constants.js that we weren't using (namely the
part where we insert constants) but left it open to do that. It should
be trivial, we just aren't using it.

Fixes #1824
2014-08-14 11:14:20 -07:00
Andreas Svensson 079400c2a6 JSXTransformer respects async attribute
Conflicts:
	vendor/browser-transforms.js
2014-08-14 10:00:27 +02:00
Paul O’Shannessy db6e07e87d Merge pull request #1827 from syranide/jsxstrict
JSXTransformer, stricter parsing of script type
2014-07-30 21:39:37 -07:00
Andreas Svensson 0efe8ca362 JSXTransformer, stricter parsing of script type 2014-07-20 01:20:30 +02:00
petehunt e8efa2a1e9 Fix browser-tranforms 2014-07-18 19:02:31 -07:00
Ben Alpert f02264cf83 Add destructuring visitor to JSX harmony transform 2014-07-15 16:34:00 -07:00
Paul O’Shannessy 28d94d2dcf Fix react-dislayName-test
[skip ci]
2014-07-11 10:36:07 -07:00
Paul O’Shannessy 31a025a667 Add docblocks and consistent styling to JSXTransformer 2014-07-09 12:51:46 -07:00
Paul O’Shannessy 336890291e Fix sourcemaps in JSXTransformer for Firefox
Fixes #1725
2014-07-09 12:48:02 -07:00
Paul O'Shannessy 5b17e75707 Support more properties for image maps
Supporting the `<area>` tag is pretty useless if we don't support the necessary properties.
2014-06-30 20:54:44 -07:00
Paul O’Shannessy 5eb57fa51b Add support to JSX transform for <hyphenated-tags>
This only adds support for whitelisted tags, not arbitrary ones.

Closes #1539
2014-06-30 20:54:41 -07:00
Sebastian Markbage e6134c307e [react jsx transform] Spread attribute -> Object.assign
Add support for spread attributes. Transforms into an Object.assign just
like jstransform does for spread properties in object literals.

Depends on https://github.com/facebook/esprima/pull/22
2014-06-26 15:40:02 -07:00
Paul O’Shannessy 77150630e2 Merge pull request #1542 from remixz/gh-1420
Add harmony transform support in browser

Fixes #1420. Moved some code around in the merge to account for more
changes in the transform code.

Conflicts:
	vendor/browser-transforms.js
2014-06-20 10:55:06 -04:00
Paul O’Shannessy af1af19d39 Sync out transform tests 2014-06-19 15:14:54 -04:00
Paul O’Shannessy 2c85658c69 [jsx] Make sure we throw when we get XML namespaces
https://github.com/facebook/esprima/commit/aad8a2b798ca80342a744aac2869fc1feb0065dd
replaced XJSIdentifer with XJSNamespacedName for namespaced items, so we
need to adjust here accordingly.
2014-06-19 15:07:08 -04:00
Paul O’Shannessy f230e0a031 Merge pull request #1583 from nhunzaker/jsxtransform-parallel
Load external scripts in parallel in JSXTransformer
2014-05-27 14:31:25 -07:00
Jeff Morrison 9ef6156d5c Merge pull request #760 from syranide/jsxns
Support for JSX tag namespaces <React:DOM:div />
2014-05-22 15:51:49 -07:00
Nate Hunzaker 59a9251c90 Set executed after run 2014-05-21 15:09:52 -04:00
Nate Hunzaker b1247690d5 Load in parallel, evaluate linearly as they come in 2014-05-21 15:07:10 -04:00
remixz 765ee8e5d0 Merge upstream changes 2014-05-19 20:12:57 -07:00
Nate Hunzaker 0614cfa43e Load scripts in parallel 2014-05-18 16:34:40 -04:00
Nate Hunzaker bc79f623a1 Asynchronously load scripts with JSX transformer. 2014-05-18 15:41:41 -04:00
remixz 3f31ec463f Change harmony option to "harmony=true" 2014-05-14 15:50:35 -07:00
remixz 65c258a7b7 Add harmony transform support in browser (Fixes GH-1420)
I implemented this by checking for `type="text/jsx;harmony"`, since this
has a bit of a cleaner implementation rather than parsing a JSON object
out of a data attribute. If in the future there are other options to
pass, it would make sense to move to a system like that.

Along with adding support, there is also a new example added that's
the basic-jsx example with Harmony syntax.
2014-05-13 22:07:02 -07:00
Jon Beebe c50dbb0ec1 Adds svg pattern and mask components 2014-05-08 07:16:28 -05:00
Andreas Svensson aa044c6b61 Add support for JSX member expressions <React.DOM.div /> 2014-05-08 00:10:10 +02:00
Sven Helmberger 8e0d17c756 Add tspan to JSX transform 2014-04-24 19:13:01 +02:00
Paul O’Shannessy 4ed9e22a44 Upgrade jstransform to 4.0
Also enables the object-concise-method transform for --harmony

closes #1438
2014-04-23 16:36:45 -07:00
Jeff Morrison 9c2b9b1eb6 Merge pull request #970 from syranide/jsxws
Normalize whitespace for transformed JSX code
2014-04-04 10:20:43 -07:00
Paul O’Shannessy 0617696ae4 Merge pull request #1251 from davidxi/patch-1
Update jasmine-support.js
2014-04-03 18:41:59 -07:00
Ben Alpert e6c93f9246 Add optional harmony support to browser transform
This mirrors the react-tools API; it doesn't include support (yet) for transforming `<script type="text/jsx">` blocks with the ES6 transforms, mostly because I don't have a good API in mind there.

Test Plan:
Ran

    JSXTransformer.transform("var two = () => 2;", {harmony: true}).code

in Chrome's dev console and got back some ES5 code.
2014-03-28 18:26:20 -10:00
Paul O’Shannessy 8d495f3b6e Revert "Merge pull request #1234 from RReverser/pure-cjs"
This reverts commit 7987e6a51d, reversing
changes made to d88d479685.
2014-03-18 11:25:21 -07:00
Ben Newman 7987e6a51d Merge pull request #1234 from RReverser/pure-cjs
Switched from browserify to pure-cjs bundler.
2014-03-18 12:04:58 -04:00
Paul O’Shannessy d88d479685 Merge pull request #1193 from spicyj/jsx-polygon
Add polygon tag to transform
2014-03-17 10:07:23 -07:00
davidxi 29abe53924 Update jasmine-support.js
fix typo in multiple error messages.
2014-03-12 14:39:14 -04:00
Andreas Svensson 60d7a02d44 Normalize whitespace for transformed JSX code 2014-03-12 10:03:16 +01:00
Andreas Svensson 280ff2e5a7 Unbreak JSX comment comma fix 2014-03-11 00:31:59 +01:00
Ingvar Stepanyan 3171436d97 Switched from browserify to pure-cjs bundler.
Optimizations and fix for JSXTransformer build.
Dropped dependency on emulation of Node.js native modules.
Added deamdify step for JSXTransformer build.
2014-03-08 16:33:58 +02:00
Andreas Svensson aa70419f9d Fix empty JSX expressions sometimes emitting erroneous commas 2014-03-06 13:01:03 +01:00
Ben Alpert 42444f6bb9 Add polygon tag to transform
Fixes #1144.
2014-02-27 12:32:24 -08:00
Paul O’Shannessy 7b773a6b3d make <hasOwnProperty/> transform correctly 2014-02-24 18:03:02 -08:00
Ben Alpert 472be09ff6 Make JSX transform not break on 'constructor' attr 2014-02-20 21:44:58 -08:00
Paul O’Shannessy 8a47813baa Update copyrights for 2014.
grep -rl 'Copyright 2013 Facebook' static_upstream | xargs perl -pi -w -e s/Copyright 2013 Facebook/Copyright 2013-2014 Facebook/g;'

Not going to check in a script to do this since it will just change every year.
Closes #1006
2014-02-18 17:06:43 -08:00
Ben Alpert 5795376961 Strip calls to warning() in __DEV__
Fixes #1120.
2014-02-17 19:01:45 -08:00
JeffMo adcbf0806c Sync out transforms from fb internal 2014-02-15 12:35:32 -08:00
Ben Alpert 89bcecc76f Disable source maps when defineProperty is missing
Fixes #1053.
2014-02-11 00:10:06 -08:00
Ben Newman 77c53dd5d4 Revert "More optimizations and fix for JSXTransformer build"
This reverts commit f1b7db9aef.
2014-02-03 19:05:15 -05:00