Commit Graph
8258 Commits
Author SHA1 Message Date
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
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
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
Andrew Clark 75ee3c1424 Warn about setState inside getChildContext
Stack uses a module called ReactInvalidSetStateWarningHook, but all it
does is warn about setState inside getChildContext. Doesn't seem worth
keeping around, so I didn't use it for Fiber, but if I'm mistaken I'll
change it.
2017-02-24 11:02:21 -08:00
Andrew Clark 2f3df5f0b3 Warn about setState in render 2017-02-24 11:02:21 -08:00
Andrew Clark 769c6e0ebe Merge pull request #9060 from acdlite/fixrecordtestsscript
Fix record-tests script
2017-02-24 10:59:44 -08:00
Andrew Clark 3bdc6d0c8e Fix record-tests script
Result of readConfig changed slightly in Jest 0.19.
2017-02-24 10:46:49 -08:00
Andrew Clark 1ae7436d01 Merge pull request #9058 from nihgwu/patch-1
fix version
2017-02-24 10:10:11 -08:00
Neo 18229fdeda fix version
per https://github.com/facebook/react/commit/ca4325e3eff16b86879188eb996ebcc9a933336a#commitcomment-21033948
2017-02-24 17:35:27 +08:00
Andrew Clark ca4325e3ef 16.0.0-alpha.3 v16.0.0-alpha.3 2017-02-23 15:36:08 -08:00
Andrew Clark 18217cfede Merge pull request #9054 from acdlite/fiberpreventextensions
[Fiber] Prevent extensions to fiber in DEV
2017-02-23 14:42:16 -08:00
Andrew Clark f3c2d9f308 Merge pull request #9004 from acdlite/proptypescheck
API for checking external objects against React prop types
2017-02-23 14:37:19 -08:00
Maxwel D'souza b81175d37a Removed unnecessary if (#9031) 2017-02-23 15:14:21 -06:00
mdogadailo 49840f2e6b Missing onLoad and onError events on image tag (#9042) 2017-02-23 15:05:38 -06:00
Dai Nguyen d724aed404 Update tutorial.md (#9051) 2017-02-23 14:54:03 -06:00
Andrew Clark ddf59c403a Prevent extensions to fiber in DEV
Helps us avoid accidentally adding fields to the fiber class
2017-02-23 11:23:44 -08:00
Andrew Clark 03ed3437c9 Fix build config
ReactDebugCurrentFrame is shared state.

checkPropTypes should be imported via the main React export,
not imported directly.
2017-02-23 11:14:15 -08:00
Andrew Clark 0320b8ecb4 Wrap checkPropTypes in DEV conditional so it's stripped out in prod 2017-02-23 11:14:15 -08:00
Andrew Clark e6d6ad3e88 Remove closure in checkReactTypeSpec by tracking stack info globally
There's a lot of overlap between ReactCurrentOwner,
ReactDebugCurrentFrame, and ReactDebugCurrentFiber that should
be consolidated.
2017-02-23 11:14:14 -08:00
Andrew Clark 9993fdd957 Change formatMessage parameter to getStack
Gives us flexibility in the future to deal with the stack and the
message separately.
2017-02-23 11:14:14 -08:00
Andrew Clark 6ff5211dee Remove warnOnRepeat option
Don't need this internally; doubt external users will need it either
2017-02-23 11:14:14 -08:00
Andrew Clark 3746a9dafb Invert dependency between checkPropTypes and checkReactTypeSpec
Expressing checkReactTypeSpec using the public API frees us to move it
to a separate module in the future.
2017-02-23 11:14:14 -08:00
Andrew Clark e4acd12a9b Test that checkPropTypes does not throw or return a value 2017-02-23 11:14:14 -08:00
Andrew Clark 600685bdef Add PropTypes.checkPropTypes API
Allows users to check arbitrary objects against React prop types without
relying on the implementation details of the prop validators themselves.
An example of why this is important: some prop validators may throw,
while others return an error object. Calling a prop validator manually
requires handling both cases. `checkPropTypes` does this for you.
2017-02-23 11:14:14 -08:00
Andrew Clark bef723e47f Remove ReactPropTypeLocationNames module
ReactPropTypeLocationNames was a map of location identifiers to location
display names, for use in warnings. But in practice, this did nothing
except rename "childContext" to "child context." Not worth it, IMO.

Since we are going to add an API for running prop type checks manually,
we need the ability to support arbitrary prop type locations. So
each place that used to accept a ReactPropTypeLocation now just accepts
a string.
2017-02-23 11:14:14 -08:00
Dominic Gannaway 91e8081cf0 Merge pull request #9045 from trueadm/emptyObject-reference-mismatch-due-to-mocking
[Fiber] fix ensure class components refs get re-assigned to emptyObject on mount
2017-02-23 15:38:10 +00:00
Dominic Gannaway 23f245173a Merge pull request #9043 from trueadm/fix-fiber-functional-componment-childcontext
[Fiber] adds `childContextTypes` warnings for functional components
2017-02-23 15:37:48 +00:00
Dominic Gannaway bde5df1d76 addressed code in feedback 2017-02-23 15:37:19 +00:00
Dominic Gannaway a99d77e073 added a regression test for factory components 2017-02-23 14:00:02 +00:00
Dominic Gannaway 925743bfc9 reverted ReactDOMFeatureFlags 2017-02-23 13:40:16 +00:00
Dominic Gannaway e7d7809eb1 reverted the getChildContext warning from showing on functional components in Fiber 2017-02-23 13:39:08 +00:00
Dominic Gannaway 25f4abc9d5 mountClassInstance() now re-assigns instance.refs to emptyObject 2017-02-23 12:58:37 +00:00