Commit Graph

2742 Commits

Author SHA1 Message Date
Paul O’Shannessy ef47bb753c Merge pull request #2076 from whatasunnyday/master
Add example to if else in JSX.
2014-08-20 12:45:04 -07:00
Sunny Juneja b9cf0d2bdd Add example to if else in JSX. 2014-08-20 12:29:21 -07:00
Paul O’Shannessy 4d9a2c4a29 Make npm run-script jest available
This is slightly shorter than typing `./node_modules/.bin/jest`.
2014-08-20 11:48:01 -07:00
Paul O’Shannessy 417678310c Update Object.assign polyfill
The spec changed to allow null & undefined sources without throwing.
Now our code depends on this new behavior. The only browser that
implements Object.assign has also updated its native implementation to
this behavior (Firefox Nightly).
2014-08-20 11:44:24 -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
Sebastian Markbage aae31ae24c ReactMount calls a legacy factory use createDescriptor instead
This fixes some log spew since this pattern is deprecated. This doesn't use
the validator in the descriptor creation so there's no prop type checks here.
I guess that's fine because we still have the second prop type checks.

We need to use ReactLegacyDescriptor because the constructor here will be a
legacy factory that we need to unwrap.

constructAndRenderComponent should be deprecated.
2014-08-20 00:15:43 -07:00
Sebastian Markbage 5c51f2fe46 Check if a function has a prototype first
Because somehow someone used a prototype less function with JSX.
2014-08-20 00:15:32 -07:00
Sebastian Markbage 68b7b82145 Start warning when calling a legacy factory
Let's start warning when a legacy factory is called as a plain function call.
2014-08-20 00:15:11 -07:00
Sebastian Markbage 989e6b618e Drop usage of plain functions to create descriptors
Replace plain function calls to legacy factories with createFactory or
createElement. For ReactDOMComponents the type should be replaced with
strings.

Because we don't have easy access to ReactLegacyDescriptor from within
React, we need to use the .type property to extract the real class.
This will go away later and is covered by unit tests.
2014-08-20 00:14:59 -07:00
Sebastian Markbage c901b1005e Make createDescriptor return a descriptor for components
This moves all logic around legacy descriptors to ReactLegacyDescriptor. This
is responsible for the layer that knows that createClass exports a legacy
factory. When passed one of these classes, it unwraps it to be a real class.

If it is passed a non legacy factory, it is assumed to be a non-react component
that needs to be invoked as a plain function.

The semantic change is that a descriptor is now always returned if passed a
legacy factory. Even if that factory is a mock. A mock would previously return
undefined.

For mocks, I treat the factory as the authoritative function. I call it to extract
the instance or fill it with an empty component placeholder.

Additionally, I make the classes take props as the first argument to the
constructor. This is what the new class system will do.

We currently need to set up some internals by calling the internal construct
method. Instead of doing that automatically in the constructor, I now move that
to a second pass so that mocks can get the plain props.

This means that we can assert that a mock has been called once it's mounted
with it's final props. Instead of the descriptor factory being called.
2014-08-20 00:14:32 -07:00
Paul O’Shannessy 182379305a Update vendored modules 2014-08-20 00:14:28 -07:00
Cheng Lou 25c9d6d578 Merge pull request #2068 from ChrisSki/patch-1
Update 09.1-animation.md
2014-08-19 18:10:31 -07:00
Chris Sciolla 99ed64387d Update 09.1-animation.md 2014-08-19 20:59:13 -04:00
Chris Sciolla 65e1938708 Update 09.1-animation.md
The reason I chose to submit this is because it was initially unclear from the docs that the transition group needed to already be mounted in order for it to work properly.
2014-08-19 15:11:07 -04:00
Josh Duck 5b4e2be867 Iterate over expectedFeatures correctly
This fails if Array.prototype is extended.
2014-08-18 18:18:05 -07:00
Paul O’Shannessy 326be2faa6 Merge pull request #2053 from zpao/jsx-transformer-optional-sourcemaps
Don't force sourcemaps on for JSXTransformer APIs
2014-08-18 18:10:57 -07:00
Paul O’Shannessy ea17506f6a Merge pull request #2062 from dmitriiabramov/patch-1
remove doubled whitespace chars in jsDoc
2014-08-18 16:54:06 -07:00
Paul O’Shannessy 32d3f79dc5 Upgrade Commoner
It no longer parses @providesModule directives by default.

Fixes #1145
2014-08-18 15:12:39 -07:00
Dmitrii Abramov d50278997c remove doubled whitespace chars in jsDoc 2014-08-18 14:26:26 -07:00
Cheng Lou a43d8c588b Fix bad merge from 04c9820694
Didn't sync out correctly.
2014-08-18 10:37:18 -07:00
Cheng Lou 196030aeb5 Merge pull request #2058 from chantastic/patch-2
docs(flux-todo-list): fix TodoStore syntax
2014-08-17 19:52:54 -07:00
Michael Chan aaeb107e00 docs(flux-todo-list): fix TodoStore syntax
Add missing semicolon behind `TodoStore#addChangeListener'
2014-08-17 19:37:10 -07:00
Lee Byron 04c9820694 Merge pull request #1601 from gaearon/apply-component-and-mixin-spec-deterministically
Apply component and mixins specs deterministically
2014-08-15 18:08:03 -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 f479cffdbb Merge pull request #2042 from zpao/update-recast
Update recast to 0.6, update constants.js
2014-08-14 13:59:45 -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
Ben Alpert 5ca9e193ee Merge pull request #2038 from zpao/update-testutil-docs
TestUtils docs: isComponentOfType -> isDescriptorOfType
2014-08-13 19:29:16 -07:00
Paul O’Shannessy aa959dcb97 TestUtils docs: isComponentOfType -> isDescriptorOfType
Fixes #1946
2014-08-13 19:23:47 -07:00
Paul O’Shannessy 5df9b90c3d Merge pull request #1832 from rayqian/master
Add chinese translation for 02-displaying-data.md
2014-08-13 17:38:44 -07:00
Paul O’Shannessy d6f5ff0288 Merge pull request #1867 from WickyNilliams/patch-1
Add note about key prop being excluded by cloneWithProps
2014-08-13 17:36:48 -07:00
Paul O’Shannessy f30e5b5a72 Merge pull request #2007 from janhancic/better-docs-for-select-multiple
Add a 'note' about passing arrays into the `value` attribute
2014-08-13 17:27:26 -07:00
Paul O’Shannessy 91cdd5af24 Merge pull request #2010 from nw/patch-1
Update ref-01-top-level-api.md
2014-08-13 17:26:51 -07:00
Ben Alpert f982387c6e [docs] Move "| React" to end of OG title
For consistency!
2014-08-13 16:30:43 -07:00
Paul O’Shannessy 6d740448e2 [docs] Move "| React" to end of page title
Looks better in search results
2014-08-13 16:28:50 -07:00
Paul O’Shannessy eb3ea3f2df Move batchedUpdated to React.addons
This is a followup to #1060, where I did not read closely enough before
merging.
2014-08-13 15:40:40 -07:00
Paul O’Shannessy 938bcbecd5 Merge pull request #1060 from spicyj/gh-906
Add React.batchedUpdates to public API
2014-08-13 15:37:43 -07:00
Paul O’Shannessy ec6653aa56 Merge pull request #1952 from slorber/master
Update 09.2-form-input-binding-sugar.md -> document checkedLink
2014-08-13 15:32:27 -07:00
Paul O’Shannessy 16dfaca66a Merge pull request #2035 from zpao/jekyll-update
[Docs] Update Jekyll + more
2014-08-13 15:23:37 -07:00
Karpich Dmitry a185f09943 Add classid property for <object/> tag
This properties needed to work with ActiveX objects in IE, created by
<object/> tag.

Closes #1526
2014-08-13 13:28:19 -07:00
Paul O’Shannessy fdf97f42f7 Update README to use bundle exec *
Also, referenced rake release task
2014-08-13 12:38:09 -07:00
Paul O’Shannessy 2cbf609856 Autogenerate acknowledgements 2014-08-13 12:38:09 -07:00
Paul O’Shannessy 51df0efe34 Use jekyll-redirect-from instead of our other redirect method 2014-08-13 12:38:09 -07:00
Paul O’Shannessy 4c7cd13ab3 Set default layout for docs 2014-08-13 11:40:14 -07:00
Paul O’Shannessy 03df215bd2 Default to layout: post for posts
Just a little less boilerplate. This also removes a bit of trailing
whitespace because it shouldn't have been there.
2014-08-13 11:37:19 -07:00
Paul O’Shannessy b58b9d0b79 Update Bourbon files (4.0.2) 2014-08-13 11:20:00 -07:00
Paul O’Shannessy 8dbdd53e46 Reorder _config for sanity 2014-08-13 11:14:24 -07:00
Paul O’Shannessy 77fa3f35b5 Minimal updates for Jekyll 2.0 2014-08-13 11:10:40 -07:00
Paul O’Shannessy ed27c89748 Merge pull request #2026 from spicyj/likely-a-bug-in-the-framework
Improve Danger error message to not blame React
2014-08-12 13:23:29 -07:00