Commit Graph

64 Commits

Author SHA1 Message Date
Ben Alpert a7a6c425d4 Merge pull request #3549 from spicyj/trans-sync
Sync transforms from internal
2015-03-30 14:15:09 -07:00
Ben Alpert c9ef8f62ba Merge pull request #3445 from mihaip/master
Use full chain of member expressions when generating display names.
2015-03-30 11:46:54 -07:00
Ben Alpert 4d84784ca6 Sync transforms from internal 2015-03-30 11:43:26 -07:00
Jason Miller ef796790ec Put comma after any non-comments, non-whitespace in JSXEspression
Fixes #1673
Closes #3129
2015-03-20 10:27:21 -07:00
Mihai Parparita fea7bc5968 Use full chain of member expressions when generating display names.
Assumed to be namespaced names (with the exception of "exports", which is
special-cased).
2015-03-19 16:46:55 -07:00
Paul O’Shannessy e8ffb80586 [lint] fix errors from new test 2015-03-03 11:23:45 -08:00
Paul O’Shannessy e114988a2c Sync out another jsx transform test.
We added this test internally and it never got added here. We haven't broken it
with any transforms *yet* but it's still good to actually run all of our tests
here too.
2015-03-03 10:40:07 -08:00
Paul O’Shannessy 48e54da484 XJS -> JSX
Part 1: change all of our methods and AST node types.
Part 2: Rename files so there is no trace of XJS
2015-02-27 18:23:18 -08:00
Paul O’Shannessy e830cea050 Lint vendor/fbtransform as well 2015-02-19 15:26:27 -08:00
Henry Zhu 07cfd66028 lint: remove spaces from object braces 2015-02-19 00:10:31 -05:00
Henry Zhu cb49492f88 lint whitespace
- use spaces
- remove space before paren in function
-  remove space before colon in object
2015-02-14 11:12:18 -05:00
Jim b207b8698c Expecting transform not to throw. Removed meaningless comment. 2015-02-02 12:19:47 -08:00
Rick Beerendonk 3e0750a4ad Update copyright headers for 2015 2015-01-31 20:18:25 +01:00
Jim 61f7a5613b Removed unknown tag warning/whitelist. 2015-01-09 11:46:47 -08:00
Paul O’Shannessy a3509e5b42 Fixing some newline-preserving issues
Done internally as part of
f9836a3912
2014-11-05 10:36:22 -08:00
Paul O’Shannessy 1fd187b994 Merge pull request #2224 from zertosh/remove-esprima-fb-dep
Remove esprima-fb and use Syntax from jstransform
2014-11-04 14:38:09 -08:00
Andres Suarez bf0a857a92 Remove esprima-fb and use Syntax from jstransform 2014-11-04 17:10:12 -05:00
Cheng Lou eddbb0cfef Use double quote for transformed `displayName` and `data-*`
JSX currently transforms everything to double quote except these two. This way, it's at least consistent and will satisfy half of the people who do put a strict quotation linting on their project.

Test: `jest`, check the double quoted transformed `data-bla="something"`.
2014-10-31 15:49:24 -04:00
Sebastian Markbage 8210beeef4 Hide Object.assign polyfill behind a module
Because the JS community's polyfilling infrastructure sucks and we'll
have to fix it for them before we require this.

JSX spread uses React.__spread
(which might get special behavior for key/ref, not sure yet)

This never uses the native implementation and throws for prototype chains.
Once the native implementations are faster, we'll start using them.
2014-10-16 09:21:10 -07:00
Paul O’Shannessy 4dcc1161fa Update @emails in react-displayName-test 2014-10-13 12:56:02 -07:00
Paul O’Shannessy dcf415c2b9 BSD + PATENTS 2014-10-10 13:34:07 -07:00
Sebastian Markbage c4658c1728 Update React JSX Transforms
* Extract JSXDOM into separate transform
* Rename lower case variables in JSX to upper case
* Drop React.DOM docblock, use string tags instead
2014-10-07 10:48:57 -07:00
Paul O’Shannessy 79ca0c7fd2 Merge pull request #1848 from fgnass/master
add picture element and related attributes
2014-09-08 16:23:39 -07:00
Ben Alpert cc9735f889 Add newline before JSX spread when appropriate
Previously, we were losing the newline before a JSX spread attribute which would cause the lines to not match up; this fixes the problem.
2014-08-30 01:04:19 -07:00
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
Felix Gnass 5f56f4ac36 add picture to xjs.knownTags 2014-07-16 19:57:19 +02:00
Paul O’Shannessy 28d94d2dcf Fix react-dislayName-test
[skip ci]
2014-07-11 10:36:07 -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 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
aad8a2b798
replaced XJSIdentifer with XJSNamespacedName for namespaced items, so we
need to adjust here accordingly.
2014-06-19 15:07:08 -04: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
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
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 d88d479685 Merge pull request #1193 from spicyj/jsx-polygon
Add polygon tag to transform
2014-03-17 10:07:23 -07: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
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
JeffMo adcbf0806c Sync out transforms from fb internal 2014-02-15 12:35:32 -08:00
Andreas Svensson c16b5659a0 Implement stricter whitespace rules 2014-01-22 21:00:10 +01:00
Jeff Morrison 33fe8eebda Merge pull request #799 from spicyj/display-name
Add display name in more cases
2014-01-07 12:58:23 -08:00
Ben Alpert f0fdabae7b Add display name in more cases 2014-01-07 09:36:47 -08:00
Matt Harrison c4d918aca0 Added support for 4 extra SVG tags: stop, defs, linearGradient, radialGradient 2014-01-05 11:17:04 +00:00