Commit Graph

253 Commits

Author SHA1 Message Date
Dan Abramov
fbfecd13ce Write a release guide (#8705)
* Write a release guide

* Style nit
2017-01-09 06:39:27 -08:00
Dan Abramov
7f0dc413a2 No longer a WIP, eh? 2017-01-06 14:17:13 +00:00
Dan Abramov
bf763fd1a5 Revert "Add es6-promisify"
This reverts commit c8cd133116.

It's not used in the code.
2017-01-06 06:00:09 -08:00
Dan Abramov
f91bff6264 Remove unused import 2017-01-06 06:00:09 -08:00
Ben Alpert
d8f166bd66 Tweaks to npm-publish task 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
441e74fa1f [rrm] Fix stable-prs command so it updates milestone correctly 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
8796a0e70f [rrm] Update version script to account for dep change 2017-01-06 06:00:09 -08:00
Christopher Chedeau
6db38a143c Abort if not on -stable branch 2017-01-06 06:00:09 -08:00
Christopher Chedeau
ad16ab519d Display the help at startup, otherwise it's hard to figure out what to do 2017-01-06 06:00:09 -08:00
Christopher Chedeau
7684c14d0c Create data/ folder instead of crashing 2017-01-06 06:00:09 -08:00
Christopher Chedeau
a0bc99409d Add es6-promisify 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
b763dc8778 [rrm] Rewrite stable-prs command
Now with
- better UX (can skip, handle each failed cherr-pick individually)
- easier to read code
- better error handling / cancellation
2017-01-06 06:00:09 -08:00
Paul O’Shannessy
7b4f3ea2e3 [rrm] Use git helper for all git commands 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
0fbe927486 [rrm] Create start-release command, create git utils
This does the essentials for starting a new release on the stable branch
2017-01-06 06:00:09 -08:00
Paul O’Shannessy
823030d26b [rrm] Update init command to use Promise style 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
14fd16b67b [rrm] Improve init & config loading experience 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
c9165e0dd1 [rrm] Update to account for new react-test-renderer package 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
c46dd23f4a [rrm] Add commands for npm access checking/granting 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
cfd782471b [rrm] Lint 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
e3a41edd83 [rrm] npm-publish command
This will publish all packages in build/packages/*.tgz to the "next" tag. If the current version is "stable" (doesn't trigger semver.prerelease()) then it will also update the "latest" dist-tag to point at that version.
2017-01-06 06:00:09 -08:00
Paul O’Shannessy
0e9aa2e9a9 [rrm] Add logging to execInRepo, dry-run option 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
114ec049d4 [rrm] stable-prs: update milestone on PRs 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
91f957cb1d [rrm] Move version reading up to app level 2017-01-06 06:00:09 -08:00
Paul O’Shannessy
a47041c0f7 Initial import of react-release-manager 2017-01-06 06:00:09 -08:00
Brandon Dail
8095ebaae7 [Fiber] Throw when attempting to unmount at an invalid node (#8688)
* Throw when attempting to unmount at an invalid node

* Remove extra character after invariant
2017-01-05 16:55:17 -08:00
Dan Abramov
ca2c71c0c5 Fix AMD and Brunch issues (#8686)
* Add manual build fixtures

* Inject ReactDOM into ReactWithAddons from ReactWithAddons

We used to read ReactDOM as a global inside ReactAddonsDOMDependenciesUMDShim.
This didn't work in AMD environments such as RequireJS and SystemJS.

Instead, I changed it so that ReactDOM gets injected into ReactWithAddons by ReactDOM itself.
This way we don't have to try to require it (which wouldn't work because AMD doesn't handle circular dependencies well).

This means you have to load ReactDOM first before using ReactDOM-dependent addons, but this was already the case before.

This commit makes all build fixtures pass.

* Memoize ReactDOM to avoid going into require on every access

* Add Brunch fixture

* Inline requires to work around Brunch bug

See #8556 and https://github.com/brunch/brunch/issues/1591#issuecomment-270742503 for context.
This appears to be a Brunch bug but we can keep a temporary fix until the next major.
2017-01-05 13:16:08 -08:00
Andrew Clark
2517a11875 Update refs even if shouldComponentUpdate returns false
Implemented using a Ref effect type.
2017-01-04 12:05:25 -08:00
Brian Vaughn
b27cb2ca2b Merge pull request #8677 from bvaughn/add-callback-validation-to-dom-render
Add callback validation to fiber-based renderers
2017-01-03 14:57:42 -08:00
Brian Vaughn
8fbcd499bd Add callback validation to fiber-based renderers
Moved ReactFiberClassComponent validateCallback() helper function into a standalone util used by both fiber and stack implementations. Validation now happens in ReactFiberUpdateQueue so that non-DOM renderers will also benefit from it.
2017-01-03 12:10:06 -08:00
Andrew Clark
47f92b940f Merge pull request #8658 from acdlite/nullupdatetest
Should not re-render as the result of a null state update
2017-01-03 10:27:32 -08:00
Andrew Clark
ad7bcdf999 Use unbatchedUpdates to opt-out of batching
Reverses the effect of batchedUpdates by resetting the current
batching context.

Does not affect nested updates, which are always deferred regardless
of whether they are inside a batch.
2017-01-03 10:24:27 -08:00
Andrew Clark
b79531eefe No nested updates
We may decide to provide this ability as an escape hatch in the future.
2016-12-30 11:30:40 -08:00
Andrew Clark
5c927b902f Should not re-render as the result of a null state update
Fiber already happens to behave this way; this just adds a test.

TODO: Should we add this feature to Stack, too?
2016-12-29 23:31:48 -08:00
Andrew Clark
79f01b2425 prepareForCommit returns info object to be passed resetAfterCommit
The DOM renderer assumes that resetAfterCommit is called after
prepareForCommit without any nested commits in between. That may not
be the case now that syncUpdates forces a nested update.

To address, this changes the type of prepareForCommit to return a value
which is later passed to resetAfterCommit.
2016-12-29 10:39:24 -08:00
Brian Vaughn
df6ca0e2c1 Merge pull request #8646 from bvaughn/focus-side-effect
Renderers can queue commit effects for initial mount
2016-12-28 15:16:50 -05:00
Brian Vaughn
a10131304b Renderers can schedule commit-time effects for initial mount
The finalizeInitialChildren HostConfig method now utilizes a boolean return type. Renderers can return true to indicate that custom effects should be processed at commit-time once host components have been mounted. This type of work is marked using the existing Update flag.

A new HostConfig method, commitMount, has been added as well for performing this type of work.

This change set is in support of the autoFocus prop.
2016-12-28 15:03:08 -05:00
Dan Abramov
6b73073557 Include owner in invalid element type invariant (#8637) 2016-12-27 08:41:23 -08:00
Dan Abramov
38ed61f4c4 Relax test about rendering top-level null (#8640) 2016-12-27 08:38:24 -08:00
Dan Abramov
119294dcae Validate that update callback is a function (#8639) 2016-12-27 08:38:10 -08:00
Ben Alpert
13980e6536 Fiber: Fix reentrant mounting in synchronous mode (#8623) 2016-12-22 11:34:35 -08:00
Dan Abramov
c978f789cc [Fiber] Push class context providers even if they crash (#8627)
* Push class context providers early

Previously we used to push them only after the instance was available. This caused issues in cases an error is thrown during componentWillMount().

In that case we never got to pushing the provider in the begin phase, but in complete phase the provider check returned true since the instance existed by that point. As a result we got mismatching context pops.

We solve the issue by making the context check independent of whether the instance actually exists. Instead we're checking the type itself.

This lets us push class context early. However there's another problem: we might not know the context value. If the instance is not yet created, we can't call getChildContext on it.

To fix this, we are introducing a way to replace current value on the stack, and a way to read the previous value. This also helps remove some branching and split the memoized from invalidated code paths.

* Add a now-passing test from #8604

Also rename another test to have a shorter name.

* Move isContextProvider() checks into push() and pop()

All uses of push() and pop() are guarded by it anyway.

This makes it more similar to how we use host context.

There is only one other place where isContextProvider() is used and that's legacy code needed for renderSubtree().

* Clarify why we read the previous context

* Use invariant instead of throwing an error

* Fix off-by-one in ReactFiberStack

* Manually keep track of the last parent context

The previous algorithm was flawed and worked by accident, as shown by the failing tests after an off-by-one was fixed.

The implementation of getPrevious() was incorrect because the context stack currently has no notion of a previous value per cursor.

Instead, we are caching the previous value directly in the ReactFiberContext in a local variable.

Additionally, we are using push() and pop() instead of adding a new replace() method.
2016-12-22 10:36:42 -08:00
Brian Vaughn
b209804cfb Jest preprocessor better aware of error-codes/codes.json WRT caching 2016-12-21 16:58:33 -08:00
Dan Abramov
a27e4f3361 [Fiber] Make requestIdleCallback() and requestAnimationFrame() shims async (#8591)
* Add a failing test for recursion check

* Make requestIdleCallback() and requestAnimationFrame() shims async

They no longer need to be sync in tests because we already made DOM renderer sync by default.
This fixes a crash when testing incrementalness in DOM renderer itself.

* Style fix

* Fix lint
2016-12-21 14:04:05 -08:00
Ben Alpert
2a5fe4c2b0 Call refs and lifecycles on indeterminate components (#8614)
This was a bug because of the split between ClassComponent and IndeterminateComponent -- we didn't mark effects or push context when we come from an indeterminate component. Now they behave the same way.

The code is even clumsier than before but I'm pretty worried we'll screw these up in the future if we don't unify the paths.

Not many components exercise this path but Relay containers do so it's noticeable.
2016-12-21 13:51:59 -08:00
Ben Alpert
eca5b1d48e Improve error messages for invalid element types (#8612) 2016-12-21 13:17:34 -08:00
Andrew Clark
15acbaa8e1 Handle errors thrown when committing root
Previously this caused an infinite loop.
2016-12-20 16:20:57 -08:00
Andrew Clark
470da6ea77 Add test for errors in host config while working on failed root
Test for a bug fixed in the previous commit that was causing an
infinite loop.
2016-12-19 18:46:13 -08:00
Andrew Clark
6c26e98ec2 Handle case where host environment throws when working on failed root
Otherwise you fall into an infinite loop where root fails -> host env
throws -> root fails...

This is a worst-case scenario that should only be possible if there's
a bug in the renderer.
2016-12-19 18:06:56 -08:00
Andrew Clark
da4ace152b Remove unmountContainer
Instead, renderers should pass null to updateContainer.
2016-12-19 16:33:25 -08:00
Andrew Clark
c6ccc19095 Use an UpdateQueue for top-level updates
...rather than mutate the pendingProps directly, which throws away any
previously scheduled work.
2016-12-19 16:33:16 -08:00