Commit Graph

9220 Commits

Author SHA1 Message Date
Andrew Clark 76659c418f Use sigil instead of comparing baseState to null 2017-10-18 15:39:58 -07:00
Andrew Clark d9647282e6 Better fix for base state bug (#11273) 2017-10-18 15:11:47 -07:00
Andrew Clark 8707755676 Render-phase setState bugfix (#11272)
Fixes a bug surfaced by www unit test.

I'm not yet sure the best way to test this; in the interest of landing
this fix quickly, I'll save the test for a follow-up.
2017-10-18 14:32:31 -07:00
Dan Abramov dee604dbe2 Add static injection for feature flags (#11269)
* Replace ReactDOMFeatureFlags with ReactFeatureFlags

* Add static injection for feature flags
2017-10-18 18:40:52 +01:00
Flarnie Marchan 101934646f Add note to 'unreleased' CHANGELOG about deprecating Bower (#11262)
* Add note to 'unreleased' CHANGELOG about deprecating Bower

**what is the change?:**
We will no longer release new versions of React to Bower, and we should
announce that as part of our CHANGELOG.

**why make this change?:**
We decided on this as a team.

**test plan:**
Visual inspection and spell check. :)

**issue:**
Just follow-up for https://github.com/facebook/react/pull/11223

* Improve messaging/formatting

* Move bower deprecation notice to top of changelog
2017-10-18 08:42:22 -07:00
243083df 4b7c562bba Remove unnecessary comparison; (#11215) 2017-10-18 15:00:56 +01:00
Dan Abramov d7c271e5ed Update rolling changelog 2017-10-18 14:58:34 +01:00
Michał Matyas 03a3934e0e Fix forceUpdate in shallow test renderer (#11239) 2017-10-18 14:54:06 +01:00
Dan Abramov c539be0515 Remove unused bundle flag (#11267) 2017-10-18 14:00:44 +01:00
Ethan Arrowood a3a10db22c Added component stack to contentEditable warning (#11208)
* Added component stack to contentEditable warning

* Added component stack to contentEditable warning
2017-10-18 13:59:43 +01:00
Dan Abramov 066f02281b Put NativeCS bundles into their own directory (#11266) 2017-10-18 13:56:07 +01:00
Dan Abramov ce335f7021 Delete .netlify (#11261) 2017-10-17 23:37:11 +01:00
Dan Abramov daf75f0671 Record sizes 2017-10-17 22:54:11 +01:00
Brian Vaughn 90370f28ff Removed test utils dependency on test renderer from bundle config (#11259) 2017-10-17 14:31:12 -07:00
Dan Abramov 0e5767824f Don't mark portals for updates (#11255) 2017-10-17 20:53:15 +01:00
Dustan Kasten 94e8e9d88e isPortal() is not referenced anywhere (#11256) 2017-10-17 20:27:54 +01:00
Dan Abramov 56e5288b04 Remove broken links from React ART readme 2017-10-17 14:20:48 +01:00
Dan Abramov 1ef250d881 Move Flow environment into scripts/flow (#11249)
* Move flow environment into scripts/flow

* Run Prettier
2017-10-17 14:20:00 +01:00
Dan Abramov 979fce8b72 Delete adler32 implementation (#11250) 2017-10-17 14:19:47 +01:00
Dan Abramov 5be6a1a6d1 Drop name and commonerConfig from package.json (#11244) 2017-10-17 13:34:01 +01:00
Dan Abramov 043d369210 Simplify Jest-specific tests (#11243)
* Delete tests that only mattered during createElement transition

They were added after #2576, but were only important when React.createElement was introduced as a migration path.
Now that elements are used consistently, these tests shouldn't be necessary.

I created a separate test specifically for scryRenderedComponentsWithType() though because that was the only one.

* Simplify mocking test setup

Today, the only remaining special behavior for Jest mocks is we let them render undefined.

We don't plan to introduce any other special behavior for them in the future.
(In fact, we already decided against replicating this special behavior for functional components.)

Therefore, we can remove dependency on Jest automocking mechanism in these tests completely,
and just explicitly mock the render method which is the only one for which we have special behavior.

For clarity, we add an explicit test for mockComponent() API (whose naming is a bit of a lie).
2017-10-17 13:05:44 +01:00
Dan Abramov 49d4381c67 Simplify Jest config a little bit (#11242)
* Inline getTestDocument into test cases

* Remove mention of mock file we do not use

* Remove unused configuration entries

* Move eslint-rules package into the scripts/ folder
2017-10-16 23:17:00 +01:00
Brian Vaughn 9ed78ad277 Tweaked wording of release script README 2017-10-16 15:02:41 -07:00
Brian Vaughn c371c152ab Release script (#11223)
* First chunk of new release script

* Re-ordered build steps to combine error codes and releases

* Reorganized build files; added stub publish script

* First pass at publis script. Also collect and print dry-run commits/publish commands.

* Deleted old react-release-manager scripts

* Cleaned up release package.json

* Basic README instructions

* Removed unnecessary 'async' keyword from a method

* Wordsmithing

* Tweaked README

* Renamed build -> build-commands and publish -> publish-commands to avoid conflict with .gitignore

* Bump pre-release package versions differently

* Prettier

* Improved CircleCI API token setup instructions message

* Lint fix

* Typofix
2017-10-16 15:01:14 -07:00
Dan Abramov b5a2a1349d Bump Jest version (#11241) 2017-10-16 21:38:34 +01:00
Dan Abramov f8134966c9 Record sizes 2017-10-16 20:51:36 +01:00
Clark Du b623bf43a0 Use value on <select> instead of setting selected on <option> (#11206) 2017-10-16 07:46:24 -04:00
Fatos Morina 17de6a35cf Fix typos (#11204)
* Use an MVP rather than a MVP

* Use the capital letter for React and highlight eslint-plugin

* Fix typos
2017-10-14 16:26:10 -04:00
Andrew Clark 7687962249 ReactDOM.createRoot (#11225)
* ReactDOM.createRoot

Introduce new API for creating roots. Only root.render and root.unmount
are implemented. Later we'll add root.prerender, and support for lazy
roots (roots with DOM containers that resolve lazily).

* Add hydrate option to createRoot
2017-10-13 20:08:36 -07:00
Andrew Clark 3ffb5d0876 Deterministic updates (#10715)
* Deterministic updates

High priority updates typically require less work to render than
low priority ones. It's beneficial to flush those first, in their own
batch, before working on more expensive low priority ones. We do this
even if a high priority is scheduled after a low priority one.

However, we don't want this reordering of updates to affect the terminal
state. State should be deterministic: once all work has been flushed,
the final state should be the same regardless of how they were
scheduled.

To get both properties, we store updates on the queue in insertion
order instead of priority order (always append). Then, when processing
the queue, we skip over updates with insufficient priority. Instead of
removing updates from the queue right after processing them, we only
remove them if there are no unprocessed updates before it in the list.

This means that updates may be processed more than once.

As a bonus, the new implementation is simpler and requires less code.

* Fix ceiling function

Mixed up the operators.

* Remove addUpdate, addReplaceState, et al

These functions don't really do anything. Simpler to use a single
insertUpdateIntoFiber function.

Also splits scheduleUpdate into two functions:

- scheduleWork traverses a fiber's ancestor path and updates their
  expiration times.
- scheduleUpdate inserts an update into a fiber's update queue, then
  calls scheduleWork.

* Remove getExpirationTime

The last remaining use for getExpirationTime was for top-level async
updates. I moved that check to scheduleUpdate instead.

* Move UpdateQueue insertions back to class module

Moves UpdateQueue related functions out of the scheduler and back into
the class component module. It's a bit awkward that now we need to pass
around createUpdateExpirationForFiber, too. But we can still do without
addUpdate, replaceUpdate, et al.

* Store callbacks as an array of Updates

Simpler this way.

Also moves commitCallbacks back to UpdateQueue module.

* beginUpdateQueue -> processUpdateQueue

* Updates should never have an expiration of NoWork

* Rename expiration related functions

* Fix update queue Flow types

Gets rid of an unneccessary null check
2017-10-13 17:21:25 -07:00
Sebastian Markbåge 36a2afccc5 [CS] Split Host Config Out into a Mutable or Immutable Mode (#11213)
* CS renderer

Because we didn't have enough RN experiments. I want to add one more.

* Split out hydration from the host config object

This makes it easier to do feature detection on the configuration.

* Move mutation host config to separate optional object

* Refs and life-cycles should happen even in immutable mode

* Unmount components even in non-mutation mode

This is the same as committing deletions but instead of finding host
components to delete, it only invokes componentWillUnmount and detaching
of refs.

* Add persistent updates API

This mode will use a clone based API instead of mutating host instances.

Needs implementation still.

It's awkward that there can be more than one child inserted into the root.
So we need a new API to create a "root" instance so that we can update it
atomically. Alternatively we could keep the mutable API for containers
and assume that most use cases would only have a single root.

* Package up CS renderer

* Fix reconciler package fixture
2017-10-13 14:29:59 -07:00
Andrew Clark 339d6cb32b Sync setStates inside willUpdate and didUpdate should flush at same time (#11212)
In sync mode, we downgrade sync priority work to task work when we're in
the commit phase, but not in the render phase. That means if you
schedule updates in both phases, the render phase update will flush
first, and the commit phase update will flush after that. What should
really happen is that both updates flush at the same time.

To solve this, updates in the commit phase are now given sync priority.
The distinction between task and sync really only exists to account for
a historical quirk in the behavior of top-level mounts. (Refer to the
test case titled "initial mount is sync inside batchedUpdates".)

Ideally, there would only be one priority for both sync and task. This
gets us closer to that model, while still accounting for
top-level mounts.
2017-10-12 21:05:58 -07:00
Haroen Viaene 0c5a455ecb chore(syntheticEvent): remove IE8 code (#11178)
* chore(syntheticEvent): remove IE8 code

Since IE8 has been deprecated for a while, I thought it might be useful to remove some IE8-only code

If this is not something you want to focus on yet, or is too much work to test, feel free to close this PR

* Update SyntheticUIEvent.js

* Update SyntheticUIEvent.js

* remove unused require

* completely remove UIEvent

* augment with noop

everything breaks otherwise

* comment back

* spacing
2017-10-12 17:30:47 -04:00
Nathan Hunzaker 19043236be Add exception for 16.alpha when loading React in DOM Fixtures (#11200)
The file structure was updated in 16. This wasn't the case for
alphas. We need to load the old module location for anything less than
16 RC.
2017-10-12 17:30:03 -04:00
Andrew Clark 8ac9600574 Remove priority coalescing and PriorityLevel module (#11187)
Coalescing is the only feature that depends on PriorityLevel. Since
we're not sure if coalescing is even valuable, we'll remove it for
now. If it turns out we need it, we can add it back later.
2017-10-11 14:48:44 -07:00
Dustan Kasten 111731dedd React reconciler package (#10758)
* Initial commit of react-reconciler bundle

* I think it’s working 🙀

* React reconciler: slightly better description and README

* Drop react-reconciler version to an unstable release number

* Convert to moduleType enum and fix packaging

* eslint

* s/Renderer/Reconciler in docs

* yarn prettier

* change names of things in the react-reconciler readme

* change predicate

* rollup: flip object-assign shimming check

* copy noop renderer into react-reconciler fixture

* Change reconciler fixture test

* prettier

* Remove a bunch of Noop test renderer

* Delete a bunch of stuff we don’t care about for reconciler teesting. Add flow pragmas for future flow pragma testing

* Remove PATENTS

* Update Reconciler fixture docs

* ReactDOMUnstableNativeDependencies should be ISOMORPHIC

* Inline fixture renderer

* Make it "RENDERER"

* There is no UMD build. It also doesn't need propTypes.

* Tweak how the reconciler is built

* Record sizes

* Update README.md
2017-10-11 19:29:26 +01:00
Dan Abramov fb0199b73c Add to changelog 2017-10-11 19:08:25 +01:00
Dan Abramov 6c592deac9 Record sizes 2017-10-11 19:06:43 +01:00
Dan Abramov 2228f497f3 Keep autoFocus attribute in the DOM (#11192)
* Keep autoFocus attribute in the DOM

* Don't emit autoFocus attribute on the client

* Test that hydration doesn't call focus

* Add autoFocus to SSR fixture
2017-10-11 18:52:12 +01:00
Dan Abramov b75be6a363 Move loop init variable assignment (#11182) 2017-10-11 11:46:15 +01:00
Dan Abramov 4a26b90cfa Fix DOM fixture for 16.0.0 2017-10-11 10:50:00 +01:00
Brian Vaughn 8b3ad851fd Update build scripts to put RN-RT files in the right places (#11183) 2017-10-10 13:44:43 -07:00
Dan Abramov e5db5302ac Fix false positive <noscript> rehydration text difference warning in React 16 (#11157)
* Add <noscript> with HTML in it to SSR fixture

* Wrap <noscript> into a <div> to get its "client HTML"

* Revert "Wrap <noscript> into a <div> to get its "client HTML""

This reverts commit 27a42503e2.

* Always use parent.ownerDocument
2017-10-10 19:35:43 +01:00
Dan Abramov f42dfcdb94 Fix false positive SVG hydration warning for mixed case tags (#11174)
* Add a failing test for <feMorphology> SSR

It causes a false positive warning on hydration.

* Make hydration tag comparison case insensitive
2017-10-10 19:34:37 +01:00
Dan Abramov 18f408fb6b Update changelog 2017-10-10 17:57:45 +01:00
Dan Abramov 309fa6c871 Don't set empty placeholder to work around IE11 bug (#11177)
* Don't set empty placeholder to work around IE11 bug

* Add fixture for textarea placeholders
2017-10-10 17:49:59 +01:00
Dan Abramov 10320a5331 Update changelog 2017-10-10 16:58:19 +01:00
Dustan Kasten 9b4e4e1759 Fix obscure error message when passing an invalid style value for SSR (#11173)
* Add failing iframe test

* Possible fix by returning null ownerName in SSR

* prettier

* eslolint

* gah c’mon really?

* emptyFunction.thatReturnsNull

* One less property access
2017-10-10 16:57:25 +01:00
Shirshak Bajgain 45c05c7097 Remove broken link from licence (#11176) 2017-10-10 16:57:00 +01:00
Dan Abramov 09cafa6e40 Changelog 2017-10-10 16:56:42 +01:00