Commit Graph
252 Commits
Author SHA1 Message Date
Dan AbramovandGitHub ff36216767 No longer a WIP, eh? 2017-01-06 14:17:13 +00:00
Dan Abramov edf1605b54 Revert "Add es6-promisify"
This reverts commit c8cd133116475677f35cb166b476c4921f59bfbb.

It's not used in the code.
2017-01-06 06:00:09 -08:00
Dan Abramov fa6317b473 Remove unused import 2017-01-06 06:00:09 -08:00
Ben AlpertandDan Abramov f0bf0bcf9b Tweaks to npm-publish task 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 1bb6c7d77d [rrm] Fix stable-prs command so it updates milestone correctly 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 217d320223 [rrm] Update version script to account for dep change 2017-01-06 06:00:09 -08:00
Christopher ChedeauandDan Abramov 0273a84a03 Abort if not on -stable branch 2017-01-06 06:00:09 -08:00
Christopher ChedeauandDan Abramov 5d2bb14654 Display the help at startup, otherwise it's hard to figure out what to do 2017-01-06 06:00:09 -08:00
Christopher ChedeauandDan Abramov 1919e78445 Create data/ folder instead of crashing 2017-01-06 06:00:09 -08:00
Christopher ChedeauandDan Abramov f312d22bcb Add es6-promisify 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 302daad21f [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’ShannessyandDan Abramov bd699783ac [rrm] Use git helper for all git commands 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 6950029891 [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’ShannessyandDan Abramov 6a25c883d4 [rrm] Update init command to use Promise style 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov b73490e8df [rrm] Improve init & config loading experience 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov aefaf6812d [rrm] Update to account for new react-test-renderer package 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 9dca908d63 [rrm] Add commands for npm access checking/granting 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 6657977761 [rrm] Lint 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov fdcd19a1a6 [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’ShannessyandDan Abramov 82337b4a97 [rrm] Add logging to execInRepo, dry-run option 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov 6eba27c4e4 [rrm] stable-prs: update milestone on PRs 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov e02f20b5f4 [rrm] Move version reading up to app level 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov c99cbb21e5 Initial import of react-release-manager 2017-01-06 06:00:09 -08:00
Brandon DailandAndrew Clark 394b06d6a6 [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 AbramovandGitHub 38d5eecdb3 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 56d69b95ba Update refs even if shouldComponentUpdate returns false
Implemented using a Ref effect type.
2017-01-04 12:05:25 -08:00
Brian VaughnandGitHub 25dacf54f2 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 37a601cc9f 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 ClarkandGitHub 66b79e16d0 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 0f7679f842 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 844864f99c 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 465a5c4631 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 8c854cd093 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 VaughnandGitHub 03812b377c 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 affd7760d1 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 AbramovandGitHub 285b64c9b1 Include owner in invalid element type invariant (#8637) 2016-12-27 08:41:23 -08:00
Dan AbramovandGitHub b6a5342cd9 Relax test about rendering top-level null (#8640) 2016-12-27 08:38:24 -08:00
Dan AbramovandGitHub f568e41650 Validate that update callback is a function (#8639) 2016-12-27 08:38:10 -08:00
Ben AlpertandGitHub 94efaa7dd8 Fiber: Fix reentrant mounting in synchronous mode (#8623) 2016-12-22 11:34:35 -08:00
Dan AbramovandGitHub 8e9e01c28c [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 0c781f9662 Jest preprocessor better aware of error-codes/codes.json WRT caching 2016-12-21 16:58:33 -08:00
Dan AbramovandGitHub 6222fa2857 [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 AlpertandGitHub ac496803e3 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 AlpertandGitHub ed33e6f962 Improve error messages for invalid element types (#8612) 2016-12-21 13:17:34 -08:00
Andrew Clark 8027c492b9 Handle errors thrown when committing root
Previously this caused an infinite loop.
2016-12-20 16:20:57 -08:00
Andrew Clark 5d84c00492 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 60a5fe1c40 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 d115b7fdc2 Remove unmountContainer
Instead, renderers should pass null to updateContainer.
2016-12-19 16:33:25 -08:00
Andrew Clark 0e85f3a989 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
Andrew ClarkandGitHub 1372b55c9d Revert "[Fiber] Queue top-level updates" 2016-12-19 15:32:59 -08:00