Commit Graph

45 Commits

Author SHA1 Message Date
chico
90ce7f67d7 lint vendor/*.js 2015-02-20 04:37:45 +03:00
Paul O’Shannessy
0e0a8f65c5 Use same pathways for browser transforms as we use in react-tools
This makes sure we can use the same options everywhere, even from react-rails,
without having to specify each one separately in JSXTransformer as well.
2015-02-18 21:40:16 -08:00
Rick Beerendonk
3e0750a4ad Update copyright headers for 2015 2015-01-31 20:18:25 +01:00
Paul O’Shannessy
f0f431e428 Check for lineNumber support before using it 2014-12-22 13:43:59 -08:00
Gabe Levi
0d308add09 Update stripTypes transform to use fixed up jstransform transform 2014-11-14 18:25:11 -08:00
Martin Jul
c9fb57feb3 Added missing semicolons identified by using grunt jshint:project. 2014-10-23 09:54:13 +02:00
Paul O’Shannessy
dcf415c2b9 BSD + PATENTS 2014-10-10 13:34:07 -07:00
Paul O’Shannessy
cf5fea4616 JSXTransformer: don't look for docblock 2014-10-10 11:45:52 -07:00
Cotton Hou
6294d7aacc Reduce unnecessary warning while including JSX transformer in browser 2014-09-05 07:15:39 +08: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
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
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
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
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
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
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
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
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
Ingvar Stepanyan
f1b7db9aef More optimizations and fix for JSXTransformer build
* Dropped dependency on emulation of Node.js native modules.
* Added deamdify step for JSXTransformer build.
2014-01-31 21:53:08 +02:00
Fabio M. Costa
de7a92afa7 Updating error message to also show part of the code, making it easier to find the error 2014-01-20 11:57:35 -08:00
Fabio M. Costa
d829d1ab9b Adding current page's url for inline code and code improvement 2014-01-20 11:57:34 -08:00
Fabio M. Costa
b1a949ed45 Adds the filename to JSXTransform error message, making it easier to debug JSX syntax errors. 2014-01-20 11:55:17 -08:00
Ben Alpert
7675611e5f Add source map support to browser transformer 2013-12-31 12:03:34 -07:00
Andreas Svensson
595b482478 JSXTransformer now supports IE8 2013-11-08 23:04:43 +01:00
SanderSpies
6839704c4b #JSX => #jsx 2013-10-15 19:11:19 +02:00
Ben Alpert
0a45325621 Actually make exec work
The spec for eval (http://es5.github.io/x15.1.html#x15.1.2.1) says "If Type(x) is not String, return x." and that's exactly what's happening here -- it gets {code: ...} and does nothing.
2013-09-30 18:51:39 -07:00
SanderSpies
cd79ed32cb - removed creation of the id within the tooling integration doc (expect this to be done by @zpao's pull request)
- removed the if statement and now always provide a warning message (as proposed by @spicyj)
- improved the warning message
2013-09-19 06:48:38 +02:00
SanderSpies
d2bf50c63d Give the user a warning when using unoptimized JSX code and send the user to the correct location in the documentation to optimize. 2013-09-19 00:55:10 +02:00
JeffMo
2d048f1f34 Move to using jstransform and esprima-fb npm modules 2013-08-22 15:28:41 -07:00
Jakub Malinowski
795a84d60f Do not export load in JSXTransformer unless in a browser environment 2013-07-23 23:01:38 +02:00
Jakub Malinowski
2b9dd04f4d Allow to execute JSXTransformer outside of browser environment 2013-07-20 15:10:36 +02:00
Paul O’Shannessy
c79a59b599 Improve JSXTransformer
The biggest improvement is that we'll now insert each parsed JSX script
back into a `<script>` tag with the body set. This allows the browser to
execute these scripts normally. Using `Function(functionBody)` or
`eval(functionBody)` both execute in window scope, but `var` assignments
don't actually get set on window (unlike everywhere else).

I also did some cleanup to make the code a little bit more readable.
In my minimal test cases this didn't break anything (scripts loaded in
the right order).
2013-06-17 10:52:16 -07:00
Paul O’Shannessy
75897c2dcd Initial public release 2013-05-29 12:54:02 -07:00