Commit Graph

8287 Commits

Author SHA1 Message Date
Dominic Gannaway d00cf558dc dev/prod mode WIP 2017-03-07 17:42:00 +00:00
Dominic Gannaway 3c24a4ca53 WIP 2017-03-07 16:52:53 +00:00
Dominic Gannaway 9d78fa8c1d fbjs support 2017-03-07 16:27:36 +00:00
Dominic Gannaway 30c8371cd5 WIP 2017-03-07 16:21:22 +00:00
Andrew Clark fc4633775a Remove destructuring, since the version of node on www doesn't support it 2017-03-02 16:44:04 -08:00
Andrew Clark cf4c06ceba Merge pull request #9098 from acdlite/printwarnings
Add script to print out a list of warnings
2017-03-02 16:39:43 -08:00
Sunny Ripert 179240ca30 Fix spacing in documentation (#9070)
Replace non-breaking space by space.
2017-03-02 13:57:58 -06:00
Jason Quense 2757a53fa5 Add fixture components (#8860)
* add fixture components

* add a few more options and styles

* Test fixture updates

- Pull in React from window global
- Add field to TestCase for fix PR links
- Update some styles

* Remove unused Fixture.Result comment

* Remove leading # from resolvedBy link

* Implement tag loading utility that caches response

Don't bust the cache doing feature detection

COME ON

* Use 'local' without version for option
2017-03-02 13:38:27 -06:00
Andrew Clark 9c8547cc9f Add script to print out a list of warnings
We'll use this in the GH sync script to track which warnings have
changed since the last sync
2017-03-02 11:37:01 -08:00
Vesa Laakso a190cfce29 Update Lifting State Up not to mix up DOM value with component state (#9032)
* Update Lifting State Up not to mix up DOM value with component state

A few weeks ago when teaching my friend, she got stuck on
`this.state.value` vs. `event.target.value`. As the documentation
talked a lot about "values", and the term value could mean three
different things (values in general, the "value" prop / DOM value of
the <input> component and the value in state/props), it was not weird
that she got a bit confused.

* Rename Lifting State Up onChange props to onTemperatureChange

This is in-line with how the temperature is provided as a prop named `temperature`

* Fix one value prop not being renamed to temperature

* Update codepen examples in Lifting state up documentation

* Update devtools state change to reflect docs change
2017-03-02 00:28:09 +00:00
Dan Abramov c8f14c26b0 Add a step to the release process 2017-03-01 22:56:06 +00:00
Andrew Clark 5881371b61 Merge pull request #9087 from acdlite/fixstringcasting
Fix string casting and remove Flow suppression comments
2017-03-01 13:51:17 -08:00
Sasha Aickin 3788654d57 Adding some server rendering unit tests. (#9055)
* Added a handful of SSR unit tests, ported from a previous pull request.

* Fixing linting errors

* Fixed a test helper function to properly report errors.

* Un-nested the new rendering tests. Updated the fiber test passing/not passing lists.

* Edited to comply with the react/jsx-space-before-closing eslint rule, which will soon be merged into master.

* Response to code review from @spicyj. Moved tests to separate file, reworked wording of test names, corrected use of canUseDom, and simplified tests against tagName. Thanks for the help, @spicyj!
2017-03-01 13:39:47 -08:00
Andrew Clark 5e5bc69230 Fix string casting and remove Flow suppression comments 2017-03-01 13:07:22 -08:00
Andrew Clark d1ee199492 Fix usage of Boolean constructor 2017-03-01 12:30:32 -08:00
Bryan Braun 7a878d27e3 Replace the header_links plugin with client-side generated anchors. (#4165)
* Replace the header_links plugin with client-side generated anchors.

Fixes facebook/react#4124

* Move anchor-link code into a separate script

Also adds a couple comments, for context.
2017-03-01 11:52:54 -08:00
Andrew Clark 737dac4f03 areChildrenOffscreen -> shouldDeprioritizeSubtree 2017-03-01 10:56:31 -08:00
Andrew Clark a1cd77db6e Pass type to areChildrenOffscreen, too 2017-03-01 10:56:31 -08:00
Andrew Clark 4602e768f3 Add areChildrenOffscreen to host config
Renderers can determine whether a node's children are offscreen based on
the host component's props. If so, they are given OffscreenPriority.

useSyncScheduling takes precedence.
2017-03-01 10:56:31 -08:00
Andrew Clark 4ef197b7d4 Check if we're in sync mode before deprioritizing hidden subtrees 2017-03-01 10:56:31 -08:00
Andrew Clark 81eef12507 Test that hidden subtrees render/update synchronously
When useSyncScheduling is set to true (as it is in the DOM renderer),
we shouldn't give OffscreenPriority to hidden subtrees. Everything
should be sync/task.
2017-03-01 10:56:31 -08:00
Andrew Clark 0585ee8b22 Merge pull request #9082 from acdlite/nobooleanorstringconstructors
Enforce no boolean or string constructors
2017-03-01 10:55:42 -08:00
Dominic Gannaway 18b86bc9d8 Merge pull request #9080 from trueadm/remove-stack-dependencies-from-tests
[Fiber] Remove stack dependencies from tests
2017-03-01 18:24:10 +00:00
Fokke Zandbergen 8eb7068364 Square renders button, not div (#9084) 2017-03-01 09:40:45 -06:00
Dominic Gannaway 8bc11649df Merge branch 'master' into remove-stack-dependencies-from-tests 2017-03-01 12:32:36 +00:00
Andrew Clark b963396c61 Run test script 2017-02-28 18:57:06 -08:00
Andrew Clark 7d5cc2eee3 Add test for no-primitive-constructors rule 2017-02-28 18:57:06 -08:00
Andrew Clark 2f63b0d6c9 Add error for number constructor, too 2017-02-28 18:57:06 -08:00
Andrew Clark b9c96cfc73 Add caveat about symbols to string error message 2017-02-28 18:57:06 -08:00
Andrew Clark 6ac5fd3c2b Rename rule to no-primitive-constructors 2017-02-28 18:57:06 -08:00
Andrew Clark 1e9812e31b Convert usage of String and Boolean constructors 2017-02-28 18:56:57 -08:00
Sebastian Markbåge e452e33741 providesModule -> explicit requires for cross-package dependencies (#9078)
* Add forwarding modules

* Codemod to use full package path outside of own package

Files that require modules from a different package than their own now
does so by the npm path name instead of the providesModule.

* Codemod fbjs module dependencies

* Fix gulp module mapping config

This is a bit lame but because of our module rewrite we need to white
list all the paths that we don't *don't* want to rewrite.
2017-02-28 18:42:52 -08:00
Andrew Clark 5f92d28e52 New ESLint rule that warns against Boolean and String constructors 2017-02-28 13:04:33 -08:00
Ben Alpert a269e7ec3f Enable react/jsx-space-before-closing rule (#9077)
We mostly do this but not 100%; I fixed the stragglers here with `./node_modules/.bin/eslint --fix src` and enabled the lint rule.
2017-02-28 09:03:08 -08:00
Dominic Gannaway d2944bb5bf updates test-failing and tests-passing 2017-02-28 15:02:48 +00:00
Dominic Gannaway 04cd2b2a81 refactors/removes stack dependent tests to work with fiber 2017-02-28 15:00:42 +00:00
Sebastian Markbåge e35724a03d Move webcomponents.js polyfill to mocks (#8993)
* Move webcomponents.js polyfill to mocks

I'd like to move it out of shared to make it easier to sync this to RN.
Since this is only used for testing and a polyfill is essentially a mock.
Maybe this makes sense?

Rename to camel case to be consistent with providesModule.

* Update path to ignore in configs
2017-02-27 18:35:05 -08:00
Brian Vaughn f923adb585 Pass component stack to error boundary handler (#9073)
This information is probably more useful for custom redbox components than the call stack info we are already passing.
2017-02-27 16:53:17 -08:00
Bernard Lin fe46def5e2 Updated Chain React (#9067)
Changed conference date from "Summer 2017" to given date on website
2017-02-27 09:53:47 -06:00
Andrew Clark 07dc04d9f4 Merge pull request #8961 from acdlite/fiberbreakonuncaught
[Fiber] Preserve "Break on all/uncaught exceptions" behavior in DEV mode
2017-02-24 16:21:35 -08:00
Andrew Clark 2c59713f71 Remove invokeGuardedCallbackProd
We weren't using it anywhere except for the test suite. Instead, we can
change the environment flag and run the tests in both environments.
2017-02-24 16:19:29 -08:00
Andrew Clark 7e348acab7 Use invokeGuardedCallback in place of Fiber try-catch blocks
Only in DEV. In production, continue using a local try-catch.
2017-02-24 15:49:33 -08:00
Andrew Clark 13d4574228 invokeGuardedCallback should work when nested
Added a guard in the global error event listener to prevent nested
errors from being captured higher up the stack.

Also found a bug where the DEV version of invokeGuardedCallback would
infinite loop if there were nested invocations with the same name. Fixed
by appending the depth to the fake event name. (I'm actually not sure
why this is necessary.)
2017-02-24 15:49:33 -08:00
Andrew Clark 0304008a65 invokeGuardedCallback returns a thrown error
We can use this more flexible version for error handling in Fiber.

The DEV mode version uses same fake event trick as before to preserve
"break on uncaught exception" behavior when debugging.
2017-02-24 15:49:33 -08:00
Ben Alpert 0934ab948d Flatten Text children before rendering (#9063)
From FB-internal D4613844.
2017-02-24 13:40:08 -08:00
Andrew Clark bc86ac4380 Merge pull request #8950 from acdlite/fibercompositecomponenttests
[Fiber] ReactCompositeComponent-test.js
2017-02-24 11:17:19 -08:00
Andrew Clark 393cdbc745 Consolidate ReactCurrentFiber and ReactDebugLifeCycle 2017-02-24 11:16:58 -08:00
Andrew Clark d2c28be69b Use ReactDebugLifeCycle to track if we're inside getChildContext 2017-02-24 11:02:21 -08:00
Andrew Clark 309dea5b4c Track which lifecycle method we're in during DEV
Use this to detect setState inside of render instead of relying on
the owner.
2017-02-24 11:02:21 -08:00
Andrew Clark ebfde985d9 Warn about nested renders 2017-02-24 11:02:21 -08:00