Commit Graph

8596 Commits

Author SHA1 Message Date
Flarnie Marchan bec0f736df Wrap fiber-only test in feature flag (#9665)
**what is the change?:**
A test was added for a change to Fiber's behavior in #9608, and because of a
bug in our CirclCI script it landed when failing for non-fiber runs of the
tests.

This just wraps the test in a feature flag because it seems clear it was
only intended to test the new fiber behavior.

Thanks to @gaearon for pairing on this! :)

**why make this change?:**
So that tests are passing on master.

**test plan:**
`npm run test ReactCompositeComponentState`

**issue:**
None - figured it out before anyone opened an issue afaik.
2017-05-11 13:32:04 +01:00
Dan Abramov cc2450b7bf Always pass error code to CI (#9663) 2017-05-11 13:13:01 +01:00
shifengchen d7e6ef0f88 Edit two errors in docs (#9659) 2017-05-11 11:34:35 +01:00
Tom Occhino ffcbb0bfc2 Move small utility modules out of ReactDOM(Fiber)?Component (#9658)
* Move small utility modules out of ReactDOM(Fiber)?Component

These are all going to be needed in the server renderer, so I'm moving them out now so I can use them from in there.

* Fix `didWarnShadyDOM = false;` line
2017-05-10 22:01:48 -07:00
Philipp Spieß b48107ed57 Remove injectReactDOMEventListener from ReactBrowserEventEmitter (#9656)
* Remove injectReactDOMEventListener from ReactBrowserEventEmitter

This PR removes the injection of ReactDOMEventListener from
ReactBrowserEventEmitter. Instead, the required initialization will
happen directly in ReactDOMInjection.

This injection was (probably) originally implemented for React Native
but never used, so we can clean it up.

* Mention how to see the full ouput of fiber tests
2017-05-10 17:05:38 -07:00
Carolina Powers 7c1e971e7f Fix typo on tutorial.md. (#9644)
The absence of the word `this` will cause CodePen
to scream at you. This fix should avoid that.
2017-05-10 08:23:53 +01:00
Dan Abramov c1ba8ef264 Mention new fixes for addons in Changelog (#9643) 2017-05-10 01:03:34 +01:00
Philipp Spieß c0e32a1b03 Rename ReactEventListener to ReactDOMEventListener (#9640)
`ReactEventListener` is a DOM-specific module although the name suggests
otherwise. This change renames the module to the more specific
`ReactDOMEventListener`.
2017-05-09 16:17:03 -07:00
Dan Abramov 831fd6940e Sync RN downstream fix (#9637) 2017-05-09 20:29:37 +01:00
Flarnie Marchan 7842ff97c2 Add PR #8356 to the change log for v15.6 (#9636)
Another change log update ~ v15.6 is closer than ever! :)

Issue:
2017-05-09 18:54:45 +01:00
Flarnie Marchan e249c935ed Add PR #9584 to 15.6 change log (#9598)
Updating the change log~ :)

**issue:**
https://github.com/facebook/react/issues/9398
2017-05-09 18:22:17 +01:00
Dominic Gannaway a7d8ebd2b5 Add React benchmarking infrastructure (#9465)
* Initial commit for WIP benchmarking infrastructure

* fixed lint issues and ran prettier

* added <rootDir>/scripts/bench/ to ignore paths for Jest

* tidied up code and fixed a few bugs in the runner.js

* fixed eslint

* improved the benchmark output from the runner

* fixed typo

* tided up print output in runner.js

* throw error if chrome canary is not installed on mac

* added better bench stats output (tables)

* added benchmark diff to table results

* adds bundle size comparisons to results

* tidied up the results

* fixed prettier output

* attempt to trigger bech for circleci build

* fixes flow exlclusion for lighthouse module

* added class components benchmark

* cleaned up stats.js

* stability changes

* circleci node version to 7

* added another benchmark

* added colours to the different benchmarks to check if being cached

* force no-cache headers

* added more info messages

* refactor chrome launching.

* fixed an issue where launcher.kill might fail

* Move server to runner. Launch it only once.

* tidy up

* changes the logic in how the remote repo is checked out

* removes bench from circleci build

* removed colors from benchmarks (no longer needed)

* added CI integration comment

* added hacker news benchmark

* added skipBuild functionality

* relabelled remote

* Add confidence intervals

* added first meaningful paint

* removed some unused code

* reverted code.json

* updated benchmark runs back to 10

* no longer breaks when results contain missing bundles

* adds CPU throttling

* renamed build to remote-repo

* small fix to build

* fixed bad merge

* upped runs to 10 from 2 again

* properly pulls master

* removes old-bench

* runs benchmarks in headless mode

* adds a --headless option

* improved the git build process

* added README

* updated based feedback from review

* adds merge base commit sha

* addressing more PR feedback

* remove built JS react files

* updated .gitignore

* added combined bundle load times to the metrics
2017-05-09 17:13:54 +01:00
Ben Alpert 542dac4a23 Fix return value of ReactDOMFiber.unmountComponentAtNode (#9619) 2017-05-05 17:54:53 -07:00
Andrew Clark 767a5d60e8 updateQueue -> newUpdateQueue
Fix typo introduced after renaming a variable to address shadowing.
2017-05-05 14:21:17 -07:00
Andrew Clark 628b82c808 Allow assigning to this.state inside componentWillMount, with a warning 2017-05-05 14:03:29 -07:00
Andrew Clark 1232666590 Don't recreate instance when resuming a class component's initial mount
Recreating the class instance causes refs (and other callbacks) to close
over stale instances.

Instead, re-use the previous instance. componentWillMount is called
again. We also call componentWillReceiveProps, to ensure that
state derived from props remains in sync.
2017-05-05 14:03:29 -07:00
Dan Abramov 6facb85f85 Fix horizontal scrolling in docs (#9613) 2017-05-05 18:03:39 +01:00
Dan Abramov 138ff5e46b Fix sequencing in the Tutorial (#9615)
* Fix sequencing in the Tutorial

* Update tutorial.md

* Update tutorial.md
2017-05-05 18:02:13 +01:00
Andrew Clark 824e991241 Update flow to 0.45 (#9603) 2017-05-04 11:31:14 -07:00
Dan Abramov 943367faa7 Tweak Tutorial based on feedback 2017-05-04 00:30:12 +01:00
Nathan Hunzaker 6875fa867f Remove loose check on non-number controlled inputs. Fix trailing dot issue. (#9584)
* Remove loose check when assigning non-number inputs

This commit removes a check I added when working on number input
issues where we perform a loose check on an input's value before we
assign it. This prevented controlled text inputs from disallowing
numeric text entry.

I also added a DOM fixture text case.

Related issues:

https://github.com/facebook/react/issues/9561#issuecomment-298394312

* Use strict equality as a guard before assigning input.value

This commit adds back the guard around assigning the value property to
an input, however it does it using a strict equals. This prevents
validated inputs, like emails and urls from losing the cursor
position.

It also adds associated test fixtures.

* Add copy command after build for interup with surge.sh
2017-05-03 13:37:56 -05:00
Flarnie Marchan 50a60dbe74 Add 'unreleased' incremental change log for v15.6.0 (#9544)
* Add 'unreleased' incremental change log for v15.6.0

**what is the change?:**
Adding a section to the change log where we start accumulating
annotations for React v15.6.0.

**why make this change?:**
- Saves us the trouble of writing the change log entry all at once when
  we do the release.
- Adds transparency about what is in the upcoming release, for those who
  aren't following https://github.com/facebook/react/issues/9398

**test plan:**
Visual inspection

**issue:**
https://github.com/facebook/react/issues/9398

* Minor tweaks to v15.6.0 changelog annotation

**what is the change?:**
- added missing `#` for commit hashes
- added minor details to two annotations

Thanks to @gaearon for the code review comments.

**why make this change?:**
Consistency and clarity.

**test plan:**
Visual inspection

**issue:**
https://github.com/facebook/react/issues/9398

* Remove hashes from commit numbers

**what is the change?:**
We had added hashes to some commit numbers, but ideally only do that
for PRs.

**why make this change?:**
Consistency - this is how github displays those types of links too. PRs
get a '#', and commits don't.

**test plan:**
Visual inspection

**issue:**
https://github.com/facebook/react/issues/9398
2017-05-03 09:00:36 -07:00
Dan Abramov 2b7012ffb0 Fix mobile layout 2017-05-03 15:39:02 +01:00
Dan Abramov ac00e849fd Fix a typo 2017-05-03 15:04:25 +01:00
Dan Abramov e6c0ac9a0a Use a more specific link 2017-05-03 11:04:18 +01:00
Addy Osmani f86256ece0 Add DEV mode note to installation doc (#8784) (#9157)
* Add DEV mode note to installation doc (#8784)

* Address feedback from Dan on wording
2017-05-03 11:03:04 +01:00
Dan Abramov 185db64c76 Add more info about building for production (#9592)
* Add more info about building for production

* Add more info to the docs
2017-05-03 11:01:53 +01:00
Andrew Clark 535afaf759 16.0.0-alpha.12 2017-05-02 14:26:42 -07:00
Dan Abramov ba72c99183 Report version and bundle type to DevTools (#9586)
* Report version and bundle type to DevTools

* Flip the flag the other way around

It's easier to remember 0 is always PROD, and 1 is like DEV flag. 2 could be PROFILE in the future.

* Add version to RN inject call
2017-05-02 20:34:10 +01:00
Joe Critchley 109d1c95e3 [Docs] Show the name 'React' first in the homepage's <title> (#9582) 2017-05-02 14:22:24 +01:00
Dan Abramov 45dbcfb67d Add missing passing test 2017-05-02 14:22:09 +01:00
Andrew Clark 4d8174480c Only perform class checks on initial mount
Avoids firing warnings multiple times
2017-05-01 15:53:19 -07:00
Andrew Clark 9145f40eb8 Fix bug where null props is passed to constructor when resuming mount
Another example of where the pending/progressed/memoized props model
would benefit from a refactor.
2017-05-01 15:53:19 -07:00
Andrew Clark ae4fa9ad94 Demonstrate failing test when resuming mount of class component 2017-05-01 15:53:14 -07:00
Dan Abramov 8dcf9c7be7 Change warning casing (#9573)
* Change warning casing

* Update ReactFiberClassComponent.js

* Update ReactCompositeComponent.js
2017-05-01 21:51:47 +01:00
Andrew Clark b1384062d2 Move AsyncUpdates flag check to class-only path (#9570) 2017-05-01 13:23:54 -07:00
Andrew Clark 835c21a5ef Don't prevent extensions on Fiber if using bad Map polyfill (#9572)
Many Map polyfills work by adding an extra field to the key type.

In the future, we'll likely print a warning.
2017-05-01 13:23:37 -07:00
Abhay Nikam 1f5693ec67 Warning message updated if defaultProps were defined as an instance property (#9493)
* Updated the warning message for setting defaultProps on instance property.

* Updated the testcases for the defaultProps warning.

* Updated the warning message for defaultProps set on instance property.
2017-05-01 13:30:40 -05:00
Dan Abramov ca4250a1e0 Remove unnecessary # in changelog 2017-05-01 18:32:08 +01:00
Frankie Bagnardi e9d6f3f10e [Tutorial] Make it easier to follow the instructions (#9454)
* tutorial: adds note about onClick

* tutorial: show full square component

* merge

* fixes line number

* tutorial: misc changes

* fixes Board render initial code sample

* [tutorial] adds codepen links and misc small fixes

* removes useless arrow functions, #9531

* {this.renderSquare} new lines

* be more explicit about history state

* fixes highlight

* following along locally

* changes todo to this.props.value

* removes calculateWinner from initial codepens and includes it in tutorial

* removes note about calculateWinner at end of file

* adds debug-view and debug-view-final

* removes debug view, updates codepen instructions

* adds another codepen

* tutorial.md

* tutorial.md

* tutorial.md

* tutorial.md

* Put . into links for consistency with docs

* Make the very first change easier to follow

* A few more changes
2017-05-01 17:22:26 +01:00
Flarnie Marchan 2e053a5be3 fix typos in CHANGELOG 2017-05-01 09:01:36 -07:00
Flarnie Marchan 0549c4506f Update Changelog for v15.5.1-15.5.4 (#9537)
* Update Changelog for v15.5.1-15.5.4

This could really use extra code review attention since the history of
these changes was a bit convoluted to follow.

After talking to @bvaughn and @acdlite, we thought it might make sense
to put the 'add-ons' changes in a separate change log. The other option,
of including them in the main React change log, seemed the more
confusing of the two.

Also this commit is related to and somewhat blocked by
https://github.com/reactjs/prop-types/pull/40

**what is the change?:**
Adding the change log for recent patch versions of React.

**why make this change?:**
We missed this step in the flurry of releasing patches, and it's useful
for folks who want info about what version to use.

**test plan:**
Visual inspection of the change log.

**issue:**
https://github.com/facebook/react/issues/9443

* Further improve CHANGELOG entries for v15.5.1-15.5.4

**what is the change?:**
- Use the '[@author] in [#PR/commit]' format for annotations
- Make annotations less technical, more clear
- Move 'React Addons' updates into main changelog
- Remove separate 'React Addons' changelog

**why make this change?:**
These changes each make things more clear and accurate.

**test plan:**
Visual inspection

**issue:**

* Fix final nits in CHANGELOG

**what is the change?:**
- Put backticks around package names
- Reformat link to to commit in '([@user](...) in [#NNNN](...))' format
- Remove newlines after subheaders; in the past we sometimes have
  included a newline after the subheader, but most recently it looks
  like we do not.
- Add some missing punctuation.

**why make this change?:**
Consistency and aesthetics

**test plan:**
Visual inspection

**issue:**
https://github.com/facebook/react/issues/9443

* Add deprecation notice to v15.5.0-15.5.3

**what is the change?:**
Adding deprecation notice to some recent React versions.

**why make this change?:**
These versions of React use a version of `prop-types` that had a
critical bug. We updated the dependency in React 15.5.4, and hopefully
people will see this notice and update.

**test plan:**
Visual inspection

**issue:**
https://github.com/facebook/react/pull/9537
2017-05-01 08:59:42 -07:00
Dan Abramov f217228326 Clarify where docs live 2017-05-01 13:39:10 +01:00
Marcos Ojeda f737d63302 docs better indicate that state updaters shallowly merge with state (#9554)
this was a surprise to me because the docs seemed to indicate that when
using an updater, the result _needed_ to be a new state object. I was
[not alone](https://twitter.com/ken_wheeler/status/857939690191806464)
i think in discovering this as a result of the previous tweet in the
thread.
2017-04-30 17:40:22 -07:00
Ben Alpert f677bfc964 Fix __proto__ bug in ReactDOMSelect (#9536)
https://twitter.com/rauschma/status/857307345231249409
2017-04-29 08:23:00 -07:00
Sebastian Markbage 50d6f9656d Don't try to load asset manifest in dev mode
We're not going to use it so don't try to load it since it may not have
been built yet.
2017-04-27 21:57:01 -07:00
Sebastian Markbåge b9da1741cb SSR fixture (#9547)
Adds a server-rendering fixture based on create-react-app without ejecting.

This is using the full-page strategy because I wanted to flush out any issues with it. Turns out there's a lot of little things that are fixable and some non-fixable. This actually surfaced some differences between the current strategy and the one I had in mind.

This uses the asset manifest from webpack to pass the final URLs to the client. This ensures that we can render the same exact mark up on the client - including the URL to our own script that we're running in.

Doing full document renders work with 15.x as long as the checksum matches. However, with the patch up reviving strategy I had in mind it would end up removing the CSS tags that webpack injects before running our render call. This is a behavior change.

In dev mode the server runs a proxy in front of the normal CRA webpack server so that we can replace the HTML request for the root page.

I don't know what the best way to link in the react and react-dom packages. Each fixture has a different strategy so here's another one. Just add NODE_PATH=../../build/packages in front of all commands.
2017-04-27 21:03:32 -07:00
Manas 182642b2ea Fiber ReactDOM shouldn't throw on import in Node environment if it's unused (#9389)
* Fixes #9102 by fake polyfilling rAF (and rIC)

* Ensure we restore globals even if test fails + minor nits

* Remove periods
2017-04-27 13:13:03 +01:00
Sriram Thiagarajan 70c01963d9 pre format only compile time errors (#9538)
* pre format only compile time errors

* Style tweak
2017-04-27 11:49:34 +01:00
Andrew Clark 0e3280e2c6 includes -> indexOf 2017-04-26 18:10:27 -07:00