Commit Graph
8537 Commits
Author SHA1 Message Date
Mateusz BurzyńskiandDan Abramov b64862eda9 Prevent process polyfill to be included in builds because of process guards preventing code replace (#9518) 2017-04-26 13:47:35 +01:00
Dominic GannawayandGitHub d3e6250ff5 updates yarn.lock (#9530) 2017-04-26 13:43:36 +01:00
Frankie BagnardiandDan Abramov f8eff1d3d9 adds indirect refs to docs (#9528)
* adds indirect refs to docs

* Add more info

* Explain clearer

* Rephrase

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md
2017-04-26 13:40:09 +01:00
Andrew ClarkandGitHub 96a7f13cd3 Use prop-types instead of prop-types factory (#9526)
Latest versions of prop-types don't depend on React, so the factory is
not necessary, and in fact bloats the build because it is intended for
15.5 and so doesn't strip out the checkers in prod.
2017-04-25 14:32:27 -07:00
Andrew ClarkandGitHub 5fb5819025 Rename react-dom to ReactDOM in Facebook www (#9525) 2017-04-25 13:30:48 -07:00
Brian Vaughn 679126b415 Prettier 2017-04-25 10:19:06 -07:00
Benedikt MeurerandBrian Vaughn 813a5b6488 Improve component type check in getComponentKey. (#9464)
* Improve component type check in getComponentKey.

The sequence
```
component && typeof component === 'object'
```
checks whether component is any JavaScript object except document.all.
Since document.all cannot occur here, this can be replaced with the
usual
```
typeof component === 'object' && component !== null
```
sequence, which yields true for all JavaScript objects and is well
optimized by all JavaScript engines.

* Run yarn prettier.
2017-04-25 09:39:30 -07:00
Nathan HunzakerandBen Alpert 22fbb8ed0d Consolidate events between EventConstants and BrowserEventEmitter (#9512) 2017-04-25 09:24:10 -07:00
Maciej KasprzykandDan Abramov 54cb49cfa4 Describe fixtures dir in the codebase overview (#9516)
* Describe fixtures dir in overview

* Fix folder name
2017-04-25 10:25:32 +01:00
Brian Vaughn ca0d20e1d2 Bumped version numbers and built 16.0.0-alpha.11 2017-04-24 18:52:10 -07:00
Brian VaughnandGitHub aea52e64c2 Added stack renderer to react-test-renderer bundle temporarily (#9514)
Also fixed an error in a temporary export property that had been added to the React object
2017-04-24 18:45:43 -07:00
Andrew Clark de02bef0c8 Prettier 2017-04-24 17:19:38 -07:00
Andrew ClarkandGitHub 52119683bb ReactARTStack should use ReactDOM's ReactUpdates (#9515) 2017-04-24 17:03:12 -07:00
Nathan HunzakerandFlarnie Marchan 769bd6465a Move ReactDOMFactories into separate package (#8356)
- Update examples to no longer use React.DOM
- Add package and documentation entries for react-addons-dom-factories
- Update dom-factories readme
- Set up proxy to intercept React.DOM usage
- Update ReactDOM children tests to use createElement
- Add more specific warning assertion for React DOM factories
- Do not use expectDev in ReactDOMFactories tests
2017-04-24 08:08:17 -07:00
Jen WongandBrandon Dail b56040c5b8 Updates how-to-contribute.md to use JSFiddle referenced in submit Git issue template (#9503) 2017-04-23 18:03:11 -05:00
Paul O’ShannessyandDan Abramov 21526ec16f Don't build gh-pages branch on CircleCI (#9442) 2017-04-22 22:33:43 +01:00
Flarnie MarchanandGitHub 8d9c705d01 Add link to 'Typechecking with PropTypes' under 'Advanced Guides' (#9472)
This should have been retained in our docs, since PropTypes are only
moved and not deprecated.

Partially handles #9467, and I'll make a separate PR to
https://github.com/reactjs/prop-types to add more docs to the README
there.
2017-04-22 10:41:39 -07:00
Brian VaughnandGitHub a0cb40f8fa Stop passing prevContext param to componentDidUpdate (#8631) 2017-04-21 13:15:22 -07:00
Soo Jae HwangandBrandon Dail 82dd4cfe4a [WIP] Warn in dev if shouldComponentUpdate is defined on PureComponent (#9240)
* Add test for React.PureComponent

* Add warning when shouldComponentUpdate is declared in a PureComponent

* Add actionable warning

* Add warning in Fiber

* Format added code by running yarn prettier

* Move pure sCU check to checkClassInstance

That way it warns before the component updates
2017-04-21 09:55:16 -05:00
Abhay NikamandBrandon Dail 2ccc018979 Warning added if defaultProps were defined as an instance property (#9433)
* Added warning when defaultProps was defined as an instance property

* Added testcases to check warning message for defaultProps

* Update fiber tests
2017-04-21 09:46:19 -05:00
Vitaliy PotapovandBrandon Dail 9cc170d188 Warn about Infinity in style value (#9360)
* warn about Infinity in style value

* prettier
2017-04-21 09:41:43 -05:00
Roman MatusevichandDan Abramov ae43ad37cf Remove Prev Next links from add-ons documentation (#9226) 2017-04-21 15:31:17 +01:00
David HuandDan Abramov 1cad3ddd97 Add more details in jsx-in-depth.md (#9006)
* jsx-in-depth.md add ternary statement for javascript expressions section

* jsx-in-depth.md add explanation to get falsey values for props

* update jsx-in-depth.md

* ensure links work locally, remove section about falsey prop values

* Fix links
2017-04-21 15:27:39 +01:00
Benton RochesterandDan Abramov 50c3f5e417 Ignoring files for vim users. (#9199) 2017-04-21 15:25:34 +01:00
Brandon DailandGitHub 41f5554874 Use setProperty when setting style properties (#9302)
* Use setProperty when setting style properties

setProperty is faster in all/most modern browsers. It also lets us support CSS variables.

* Only use setProperty when setting CSS variables

* Add test to ensure setting CSS variables do not warn

* Make this PR pretty again

* Run fiber test script
2017-04-20 15:25:39 -05:00
Brian VaughnandGitHub 0dc29e73c4 Bumped version numbers for alpha 10 (#9474) 2017-04-20 13:06:51 -07:00
Brian VaughnandGitHub 61dd7b4292 Updated PropTypes test to work with newer prop-types version (#9471)
The prop-types lib got an anti-spamming change in 15.5.8 that broke some of our tests (see reactjs/prop-types/commit/e1d51dd0efbd0eee5e4a8d24759f2a4d518721d3). This PR resolves that by resetting the prop-types import between tests.
2017-04-20 12:48:53 -07:00
Andrew Clark 05f985bb8c Run prettier after update to 1.2 in master 2017-04-20 11:39:04 -07:00
Andrew Clark 1eec6694ae Fix subtree tests so that async component is not top-level 2017-04-20 11:38:13 -07:00
Andrew Clark 780c5a081c Remove enableAsyncSubtreeAPI from host config
Use a ReactFeatureFlag instead. It won't be per-renderer, but we likely
won't need that.

When enableAsyncSubtreeAPI is false, unstable_asyncUpdates is ignored,
but does not warn or throw. That way if we discover a bug in async mode,
we can flip the flag and revert back to sync without code changes.
2017-04-20 11:38:13 -07:00
Andrew Clark dfb5fb2089 Change unstable_asyncUpdates from an instance to a static property
This lets us check for its existence before the instance is constructed.

Also works with functional components.
2017-04-20 11:38:13 -07:00
Andrew Clark 5462acef35 Use number type for bitfields
Unions don't enumerate all the possible combinations of bitfields. I'm
not actually sure why this was type-checking before.

number doesn't provide much safety but it's more correct.
2017-04-20 11:38:13 -07:00
Andrew Clark 6b2d3652a4 Remove unstable_asyncRender() API in favor of always using a wrapper 2017-04-20 11:38:13 -07:00
Andrew Clark e6709953b3 Rename contextTag -> internalContextTag 2017-04-20 11:38:13 -07:00
Andrew Clark 92ac2e1541 Add enableAsyncSubtreeAPI to host config
Allows us to control this feature on a per-renderer basis
2017-04-20 11:37:18 -07:00
Andrew Clark 46fc08dad5 Run Fiber test script 2017-04-20 11:37:18 -07:00
Andrew Clark 6cb2e5533e Run prettier 2017-04-20 11:37:18 -07:00
Andrew Clark 98e86c791f instance.unstable_asyncUpdates = true creates an async subtree
Same behavior as unstable_asyncRender. Can be used to wrap a specific
subtree, rather than an entire root.
2017-04-20 11:37:18 -07:00
Andrew Clark 2ae28310bf ReactDOM.unstable_asyncRender creates an async-by-default tree
The default priority of updates in a async tree is LowPriority, rather
than SynchronousPriority.

Warns if you call unstable_asyncRender on a tree that was created with
the normal, sync ReactDOM.render.
2017-04-20 11:37:18 -07:00
Andrew Clark c31435f7ae Use different default priority depending on the AsyncUpdate context flag
- A priority context of NoWork represents the default priority
- Changed the signature of getPriorityContext to accept the fiber that
is about to be updated.
2017-04-20 11:36:35 -07:00
Andrew Clark 52457072d4 Inherit contextTag from the parent on creation
A fiber has all the context flags of its parent. It may also add
additional ones during construction/mount. After mounting, contextTag
shouldn't change.
2017-04-20 11:35:08 -07:00
Andrew Clark 79ef0e6541 Add contextTag field to Fiber type
contextTag is a bitmask that describes properties about the fiber
and its subtree. For example, the AsyncUpdates flag indicates whether
the subtree should use async scheduling.

When a fiber is created, it inherits the bitmask of its parent.
2017-04-20 11:35:08 -07:00
Eric SakmarandFlarnie Marchan e2c60c5def Adds CSS Grid properties to list of unitless numbers (#9185) 2017-04-20 11:20:15 -07:00
Ben AlpertandGitHub 9f565dc060 Prettier 1.2 (#9462) 2017-04-20 11:18:33 -07:00
Ben AlpertandGitHub 53eb8de1d5 Add component stack to invalid-object-child error (#9415)
https://twitter.com/EsaMatti/status/835952325525188608 (28 likes!)
2017-04-20 09:49:46 -07:00
Dan Abramov f07dcf6f03 Bump prop-types 2017-04-20 16:40:58 +01:00
Almero SteynandDan Abramov 5e36ff2cdf [Docs: Installation] Fix tabs responsive layout - Resubmit (#9458)
* [Docs: Installation] Fix tabs responsive layout

* Move tabs a pixel down

* Remove left margin on first tab

* Remove the long line

* Fix mobile styles
2017-04-20 11:49:48 +01:00
Brian Vaughn ac8f2abe90 Fix master (ran prettier) 2017-04-19 19:03:04 -07:00
Brian VaughnandGitHub a8496401db Shallow renderer and test utils bundles (#9426)
Shallow renderer and test utils bundles

Adds new bundles introduced with React 15.5 release to master (and 16 alpha)

react-dom/test-utils:

This new bundle contains what used to be react-addons-test-utils. This bundle shares things from react-dom rather than duplicates them.

A temporary createRenderer method has been left behind as a way to access the new shallow renderer. This is for the ReactNative release cycle only and should be going away before the final release.

react-test-renderer/shallow:

This new shallow renderer is almost entirely stand-alone (in that it doesn't use the React reconciler or scheduler). The only touch points are ReactElement and prop/context validation. This renderer is stack and fiber compatible.
2017-04-19 16:45:31 -07:00
Ben AlpertandGitHub 1b11144873 Uncomment invariant in UIManager mock (#9461) 2017-04-19 16:28:59 -07:00