Commit Graph
8499 Commits
Author SHA1 Message Date
Andrew Clark 3bf398bcbc 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 6f8fec4b80 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 1b388366c1 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 f1df675b93 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 648822952f Adds CSS Grid properties to list of unitless numbers (#9185) 2017-04-20 11:20:15 -07:00
Ben AlpertandGitHub b1768b5a48 Prettier 1.2 (#9462) 2017-04-20 11:18:33 -07:00
Ben AlpertandGitHub 32480a0462 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 e59506c478 Bump prop-types 2017-04-20 16:40:58 +01:00
Almero SteynandDan Abramov a92128e7fb [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 9bb7ca5001 Fix master (ran prettier) 2017-04-19 19:03:04 -07:00
Brian VaughnandGitHub 66f2097f33 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 53dbb191d6 Uncomment invariant in UIManager mock (#9461) 2017-04-19 16:28:59 -07:00
Brian VaughnandGitHub 8782ab759e Fix CI failures in master (#9455)
* Ran prettier over UIManager mock
* Temporarily disabled an invariant() in UIManager mock that was breaking tests
* Updated Fiber passing tests
2017-04-19 08:59:40 -07:00
Flarnie MarchanandGitHub 3e48422fdc Warn for keys in fragments - third approach (#9445)
* Fix tests to pass when we warn for missing keys in fragments

In most cases we just needed to add the 'key' prop.

This ignores the tests which are already failing on master when running
with ` REACT_DOM_JEST_USE_FIBER=1` - there are 8.

All tests should now pass with `npm run test`, and the 8 which fail when
running `REACT_DOM_JEST_USE_FIBER=1 npm run test` are the same 8 which
are failing on master.

* Added missing key warning for children in array fragments

After trying twice to reuse the code between the ReactChildFiber and
ReactElementValidator, I am thinking that it's simpler to just have some
duplication of code. The parts that are shared are interleaved with
parts which cannot be shared, either because of singleton modules that
must be required differently in 'isomorphic' and the 'renderers', or the
fact that 'warning' requires a hard coded string.

Test Plan:

- Added test to ReactChildren-test
- Manually tested via fixture that was not committed.

* commit updated "scripts/rollup/results.json"

* Make 'ReactChildren-test' more specific, and remove unneeded nesting

Based on helpful tips from @spicyj and @aweary's review
 - Made the unit test for the warning on missing keys more specific
 - Removed unneeded nesting in the code which generates missing key
   warning
 - Change test syntax to use JSX to be more consistent

Also fixes flow warning.

* Commit update of scripts/rollup/results.json

* run "scripts/fiber/record-tests"
2017-04-19 08:05:04 -07:00
Almero SteynandDan Abramov 9526174e30 [Docs] Add accessibility to tabs in installation documentation (#9431)
* Add accessibility to tabs in installation documentation

* Change color and fix styling
2017-04-19 12:31:39 +01:00
Joel DenningandDan Abramov 233195cb6b Fixing the instantiation of customized builtin elements (related to custom elements) (#9313)
* Fixing the creation of customized builtin elements

* Whitespace

* Running prettier

* Updating ReactDOMFiberComponent
2017-04-19 12:07:16 +01:00
Fabrizio CastellarinandDan Abramov 1ce562ead3 Reorganize the "following along" instructions (#9453)
* Reorganize the "following along" instructions

* Minor tweaks
2017-04-19 12:00:15 +01:00
Ben AlpertandGitHub b392f1e2fc Fix errors in React Native children management (#9449)
* Fix errors in React Native children management

- Support using appendChild to move an existing child (Fiber does this, but we were assuming all children here were new; Yoga throws if you insert a child that already has a parent)
- Calculate beforeChildIndex after removing old child (previously, off by one when the new position is later than the old position)

* Add better children management tests for RN
2017-04-18 17:31:33 -07:00
Filip HoškoandDan Abramov 10eaf26809 FIX: Move CRA build info under it's tab page (#9452)
* FIX: Move CRA build info under it's tab page

* Add some links
2017-04-18 18:17:28 +01:00
Dan Abramov c5783901a8 Tweak tutorial structure 2017-04-18 18:07:16 +01:00
Dan Abramov 7b80361b6b Add missing tutorial sidebar links 2017-04-18 18:00:54 +01:00
Dan Abramov a41d469bcf Minor tutorial nits 2017-04-18 17:53:53 +01:00
Dan Abramov a7f124f48f Fix duplicate sentence 2017-04-18 17:44:32 +01:00
Dan AbramovandGitHub da124f2fb1 Minor tweaks to tutorial 2017-04-18 17:40:59 +01:00
Frankie BagnardiandDan Abramov 8417534bd0 [Tutorial] ES6, installation, and button closing tag (#9441)
* adds notes to tutorial on es6 and installation

* fixes tutorial mention of opening button tag

* More writing

* Update
2017-04-18 17:34:43 +01:00
Abhishek SoniandDan Abramov d724115144 Fixed grammar (#9432)
* Update codebase-overview.md

* Some more fixes
2017-04-18 16:38:39 +01:00
hanumanthanandDan Abramov 53a3939fb0 Lift state up - Updating the documentation to mention that onClick is a synthetic event handler (#9427)
* Lift state up - Updating the documentation to mention that onClick is a synthetic event handler

* Review comments - Rephrase to handle synthetic events and event handler patterns

* Tweak
2017-04-18 16:27:45 +01:00
Michał OrdonandDan Abramov 37f9e35ad9 Sort out conferences by date (#9172) 2017-04-18 15:38:19 +01:00
Jayen AsharandDan Abramov ccb38a96cf Update jsx-in-depth.md (#9178)
* Update jsx-in-depth.md

Line 9 isn't changed

* Move selection down

* Fix
2017-04-18 15:29:17 +01:00
Fraser HaerandDan Abramov 363f6cb2e5 Unique headings for linking purposes (#9259)
Previously two headings were 'Javascript Expressions' - now 'Javascript
Expressions as Props' and 'Javascript Expressions as Children'
2017-04-18 14:47:44 +01:00
NE-SmallTownandDan Abramov 359f5d276f [Documentation] Impreove the react-component section of doc (#9349)
* Impreove react-component of doc 

[#9304](https://github.com/facebook/react/issues/9304)

* update description

* add missing space
2017-04-18 14:42:40 +01:00
Chris PearceandDan Abramov f6c4fe6cbb Only attempt to clear measures if we created the measure (#9451)
This fixes an issue where if we decided not to create a measurement we would clear ALL measurements from the performance entry buffer due to passing `undefined` as the entry name.
2017-04-18 14:31:47 +01:00
Sung Won ChoandDominic Gannaway ac9d698636 Make nodeType into constant for readability and reuse (#9113)
* Make nodeType into constant for readability and reuse

* Fix eslint line length warning

* Delete unused nodeType values

* Destructure HTMLNodeType constant

* Make nodeType into constant for readability and reuse

* Fix eslint line length warning

* Delete unused nodeType values

* Destructure HTMLNodeType constant

* Fix test

* Format using prettier
2017-04-15 18:37:12 +01:00
Ben AlpertandGitHub 7bf686b76f Add component stack to ReactControlledValuePropTypes (#9435) 2017-04-14 19:50:43 -07:00
Ben AlpertandGitHub 1447d9f1ae Add component stack to uncontrolled-to-controlled warning (#9416)
https://twitter.com/JulianVModesto/status/836089555304448000
https://twitter.com/abevoelker/status/836040051993763842
2017-04-14 16:57:47 -07:00
Arshabh Kumar AgarwalandBrandon Dail f54fdd5441 Add warning if rendering and HTMLUnknownElement (#9163)
* Add warning if rendering and HTMLUnknownElement

* Records fiber tests

* Fixes linting and server render tests

* Incorporates review comments

* Uses ownerDocument instead of document

* uses el instead of creating a new element

* Removes warning check of voidElementTags

* Add missing space to unknown element warning

* Only call isCustomComponent once

* Spy on console in menuitem test

Since menuitem is treated as an unknown element in jsdom it triggers the unknown element warning.

* Add unknown element warning to Fiber

* Replace instanceof with toString check

It is more resilient.

* Record tests
2017-04-14 11:30:38 -05:00
Abhay NikamandBrandon Dail 36c935ca8f Updated the Good First Bug section in readme (#9429)
* Updated the Good First Bug section in readme

* Inconsistent use of quotes. Prefered single quotes instead of double quotes

* Updated Good first bug link in how_to_contribute doc.

* Undo JSX attribute quote change

* don't capitalize "beginner friendly issue"
2017-04-14 11:02:07 -05:00
Vikash AgrawalandBrandon Dail db989c0f63 Updated link for good first bug's in README.md (#9273)
* Updated link for good first bug's in README.md

* Changed text for beginner friendly bugs

* update beginner friendly bugs section title
2017-04-14 10:56:38 -05:00
Abhay NikamandDan Abramov a95e1d8ffc Updated recommended links for installation in readme (#9425) 2017-04-13 23:15:13 +01:00
Dan AbramovandGitHub 4c8c5debac Switch Installation to a tab when hash is present (#9422) 2017-04-13 21:51:19 +01:00
Marks PolakovsandDan Abramov 855b8d3526 Add tabs to installation page (#9275, #9277) (#9401)
* Add tabs to installation page (#9275, #9277)

This adds tabs for create-react-app and existing apps to the installation section of the docs. The tab implementation is a simplified version of React Native's installation page.

Fixes #9275.

* Use classList instead of className

* Use same implementation as in RN
2017-04-13 20:54:12 +01:00
Eric ElliottandDan Abramov 30d6c598c6 Docs: Clarification of setState() behavior (#9329)
* Clarification of setState() behavior

`setState()` is a frequent source of confusion for people new to React, and I believe part of that is due to minimization of the impact of the asynchronous behavior of `setState()` in the documentation. This revision is an attempt to clarify that behavior. For motivation and justification, see [setState Gate](https://medium.com/javascript-scene/setstate-gate-abc10a9b2d82).

* Update reference-react-component.md

* Signature fix

* Update to address @acdlite concerns

* Add more details
2017-04-13 19:13:55 +01:00
JackandDan Abramov 4e0c57315a Update proptypes doc (#9391)
* Update proptypes doc

* Removed note
2017-04-13 18:11:23 +01:00
Gabriel Lett VivianiandDan Abramov 22655d5759 Fix the proptypes deprecation warning url on the "Don't Call PropTypes Warning" doc page (#9419)
* Use the same prop-types link on the warning docs page as the main proptypes doc page

* Link to repo instead
2017-04-13 15:15:34 +01:00
hanumanthanandDan Abramov 5cd44d21e9 Refractor docs to indicate that state set to props in constructor will not recieve the updated props (#9404) 2017-04-13 00:56:22 +01:00
Dominic GannawayandDan Abramov 446f186279 Update typechecking-with-proptypes.md (#9392)
* Update typechecking-with-proptypes.md

* Update typechecking-with-proptypes.md

* Use consistent style for PropTypes import
2017-04-12 00:04:38 +01:00
Brian Vaughn 6cd7618bd7 Bumped versions for 16.0.0-alpha.9 and re-built 2017-04-11 14:40:56 -07:00
Brian VaughnandGitHub 2beec2f308 createClass + PropTypes + checkPropTypes warnings (#9399)
(Temporarily) re-adds getters with deprecation warnings for React.PropTypes, React.checkPropTypes, and React.createClass.

* 08bd020: Replace all references to React.PropTypes with prop-types to avoid triggering our own warning message.
* ef5b5c6: Removed several references to React.createClass that appeared after rebasing this branch. (reviewed by @flarnie)
* 524ce20: Added getters for createClass and PropTypes to the main React isomorphic object, behind one-time warning messages. (reviewed by @spicyj)
* db48f54: Fixed Rollup bundles to inline 'prop-types' and 'create-react-class' for UMD builds only. (reviewed by @spicyj, @trueadm )
* cf49cfd: Updated tests-passing.txt to remove tests that were deleted in this branch.
* d34109a: Responses to PR feedback from @spicyj. (Added package.json dependencies to packages/react and packages/react-dom. Renamed a var. Expanded on an inline comment.)
* 488c8d2: Added warning for moved package to React.checkPropTypes accessor too and updated build script.
* 83bcb29: Wordsmithing for deprecation notices (added fb.me links).
* afdc9d2: Tweaked legacy module inlining to remove order-of-deps constraint
* d1348b9: Removed $FlowFixMe.
* 7dbc3e7: More wordsmithing of deprecation notices based on Dan's feedback.
2017-04-11 14:28:03 -07:00
Dan Abramov aa1f8687d7 Use caret range in blog instructions
The release was a bit broken.
2017-04-11 22:04:29 +01:00
Denis PismennyandDan Abramov cec9b07402 Fix minor typo in lifting-state-up.md (#9408) 2017-04-11 22:03:53 +01:00