Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync #1

Merged
merged 36 commits into from
Nov 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3fb5c2a
Add .watchmanconfig to .gitignore so that Jest --watch doesn't fail a…
bvaughn Nov 16, 2017
fd03a86
Always reconcile against current children (#11564)
acdlite Nov 17, 2017
4a924a2
Updates at the same priority should not interrupt current render (#11…
acdlite Nov 17, 2017
b5e4b45
Added a .watchmanconfig file (#11581)
bvaughn Nov 17, 2017
7f68544
New feature flags to help detect unexpected lifecycle side effects (#…
bvaughn Nov 17, 2017
01a867b
Upgrade rollup dependency (#11591)
misoguy Nov 18, 2017
aa0b741
Rewrite ReactDOMComponentTree-test to test behavior using Public API …
GordyD Nov 19, 2017
962042f
Improve formatting of errors when building (#11456)
misoguy Nov 19, 2017
3f405da
Migrating to const/let and Object Spread in more places (#11535)
raphamorim Nov 19, 2017
70abda5
Switching the name property preserves radio selection
landvibe Nov 19, 2017
57aef3f
Format test fixtures
nhunzaker Nov 19, 2017
bd9dbd5
Remove MouseWheel and MouseDOMScroll event patching
cristidrg Nov 20, 2017
669a70d
Rewrite SyntheticEvent tests using public APIs only (#11525)
timjacobi Nov 20, 2017
adcf980
Re-enable UMD build for TestUtils (#11599)
andiemmadavieswilcox Nov 20, 2017
dbf715c
Read debugRenderPhaseSideEffects from GK (#11603)
bvaughn Nov 20, 2017
c6bde7b
support Call and Return components in React.Children calls (#11422)
Nov 20, 2017
7e692fb
Fixes typo in eslint script (#11607)
BRKalow Nov 21, 2017
40a176d
Remove mentions of module map in Jest config (#11611)
gaearon Nov 21, 2017
7e71273
Run Jest tests with "development" environment (#11612)
gaearon Nov 21, 2017
6041f48
Run Jest in production mode (#11616)
gaearon Nov 22, 2017
4c451f7
Add `yarn test-prod` to pull request steps
gaearon Nov 22, 2017
d1f6fbd
Record sizes
gaearon Nov 22, 2017
1cb6199
Consolidate all symbols in a single file (#11629)
gaearon Nov 22, 2017
913a125
Change DEV-only invariants to be warnings (#11630)
gaearon Nov 22, 2017
f114bad
Bug fix - SetState callback called before component state is updated …
accordeiro Nov 22, 2017
e949d57
Remove global mocks by adding support for "suppressReactErrorLogging"…
gaearon Nov 23, 2017
fa7a97f
Run 90% of tests on compiled bundles (both development and production…
gaearon Nov 23, 2017
575982b
Forbid Haste in Jest (#11647)
gaearon Nov 23, 2017
cafe352
Drop .textContent IE8 polyfill and rewrite escaping tests against pub…
jeremenichelli Nov 23, 2017
46dd197
Add a note about private API dependency for a test
gaearon Nov 24, 2017
7d27851
Issue#11510: added verification check for misspelled propTypes (#11524)
Nov 24, 2017
a67757e
Use only public API for ChangeEventPlugin-test.js (#11333)
Ethan-Arrowood Nov 24, 2017
f0ba6bb
Replace inputValueTracking-test with public API tests (#11654)
gaearon Nov 25, 2017
d235e61
Don't reset error codes on CI build (#11655)
gaearon Nov 25, 2017
d1cb28c
Refactor SyntheticKeyboardEvent tests to only use the public API (#1…
aarboleda1 Nov 25, 2017
f53bd03
Fix Jest call in the release script
gaearon Nov 25, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ module.exports = {
},

globals: {
expectDev: true,
spyOnDev: true,
},
};
9 changes: 5 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
5. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
6. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
7. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`).
8. If you haven't already, complete the CLA.
5. Run `yarn test-prod` to test in the production environment. It supports the same options as `yarn test`.
6. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
7. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
8. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`).
9. If you haven't already, complete the CLA.

**Learn more about contributing:** https://reactjs.org/docs/how-to-contribute.html
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ chrome-user-data
*.iml
.vscode
*.swp
*.swo
*.swo
Empty file added .watchmanconfig
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const React = window.React;
const noop = n => n;

class RadioNameChangeFixture extends React.Component {
state = {
updated: false,
};
onClick = () => {
this.setState(state => {
return {updated: !state.updated};
});
};
render() {
const {updated} = this.state;
const radioName = updated ? 'firstName' : 'secondName';
return (
<div>
<label>
<input
type="radio"
name={radioName}
onChange={noop}
checked={updated === true}
/>
First Radio
</label>

<label>
<input
type="radio"
name={radioName}
onChange={noop}
checked={updated === false}
/>
Second Radio
</label>

<div>
<button type="button" onClick={this.onClick}>
Toggle
</button>
</div>
</div>
);
}
}

export default RadioNameChangeFixture;
20 changes: 20 additions & 0 deletions fixtures/dom/src/components/fixtures/input-change-events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TestCase from '../../TestCase';
import RangeKeyboardFixture from './RangeKeyboardFixture';
import RadioClickFixture from './RadioClickFixture';
import RadioGroupFixture from './RadioGroupFixture';
import RadioNameChangeFixture from './RadioNameChangeFixture';
import InputPlaceholderFixture from './InputPlaceholderFixture';
const React = window.React;

Expand Down Expand Up @@ -88,6 +89,25 @@ class InputChangeEvents extends React.Component {

<InputPlaceholderFixture />
</TestCase>
<TestCase
title="Radio button groups with name changes"
description={`
A radio button group should have correct checked value when
the names changes
`}
resolvedBy="#11227"
affectedBrowsers="IE9+">
<TestCase.Steps>
<li>Click the toggle button</li>
</TestCase.Steps>

<TestCase.ExpectedResult>
The checked radio button should switch between the first and second
radio button
</TestCase.ExpectedResult>

<RadioNameChangeFixture />
</TestCase>
</FixtureSet>
);
}
Expand Down
41 changes: 9 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"art": "^0.10.1",
"async": "^1.5.0",
"babel-cli": "^6.6.5",
"babel-code-frame": "^6.26.0",
"babel-core": "^6.0.0",
"babel-eslint": "^7.1.0",
"babel-jest": "^21.3.0-beta.4",
Expand All @@ -34,6 +35,7 @@
"babel-plugin-transform-es3-property-literals": "^6.5.0",
"babel-plugin-transform-object-rest-spread": "^6.6.5",
"babel-plugin-transform-react-jsx-source": "^6.8.0",
"babel-plugin-transform-regenerator": "^6.26.0",
"babel-preset-react": "^6.5.0",
"babel-traverse": "^6.9.0",
"babylon": "6.15.0",
Expand All @@ -44,6 +46,7 @@
"core-js": "^2.2.1",
"coveralls": "^2.11.6",
"create-react-class": "^15.6.2",
"cross-env": "^5.1.1",
"del": "^2.0.2",
"derequire": "^2.0.3",
"escape-string-regexp": "^1.0.5",
Expand Down Expand Up @@ -76,7 +79,7 @@
"prettier": "1.8.1",
"prop-types": "^15.6.0",
"rimraf": "^2.6.1",
"rollup": "^0.49.3",
"rollup": "^0.51.7",
"rollup-plugin-alias": "^1.2.1",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-closure-compiler-js": "^1.0.4",
Expand All @@ -101,40 +104,14 @@
"linc": "node ./scripts/tasks/linc.js",
"lint": "node ./scripts/tasks/eslint.js",
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json",
"test": "jest",
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
"test-prod-build": "yarn test-build-prod",
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",
"flow": "node ./scripts/tasks/flow.js",
"prettier": "node ./scripts/prettier/index.js write-changed",
"prettier-all": "node ./scripts/prettier/index.js write",
"version-check": "node ./scripts/tasks/version-check.js"
},
"jest": {
"modulePathIgnorePatterns": [
"<rootDir>/scripts/rollup/shims/",
"<rootDir>/scripts/bench/"
],
"transform": {
".*": "./scripts/jest/preprocessor.js"
},
"setupFiles": [
"./scripts/jest/setup.js",
"./scripts/jest/environment.js"
],
"setupTestFrameworkScriptFile": "./scripts/jest/test-framework-setup.js",
"testRegex": "/__tests__/.*(\\.js|\\.coffee|[^d]\\.ts)$",
"moduleFileExtensions": [
"js",
"json",
"node",
"coffee",
"ts"
],
"roots": [
"<rootDir>/packages",
"<rootDir>/scripts"
],
"collectCoverageFrom": [
"packages/**/*.js"
],
"timers": "fake"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('EventPluginRegistry', () => {

beforeEach(() => {
jest.resetModuleRegistry();
// TODO: can we express this test with only public API?
// These tests are intentionally testing the private injection interface.
// The public API surface of this is covered by other tests so
// if `EventPluginRegistry` is ever deleted, these tests should be
// safe to remove too.
EventPluginRegistry = require('events/EventPluginRegistry');

createPlugin = function(properties) {
Expand Down
14 changes: 2 additions & 12 deletions packages/react-call-return/src/ReactCallReturn.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,9 @@
* @flow
*/

import type {ReactCall, ReactNodeList, ReactReturn} from 'shared/ReactTypes';
import {REACT_CALL_TYPE, REACT_RETURN_TYPE} from 'shared/ReactSymbols';

// The Symbol used to tag the special React types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_CALL_TYPE;
var REACT_RETURN_TYPE;
if (typeof Symbol === 'function' && Symbol.for) {
REACT_CALL_TYPE = Symbol.for('react.call');
REACT_RETURN_TYPE = Symbol.for('react.return');
} else {
REACT_CALL_TYPE = 0xeac8;
REACT_RETURN_TYPE = 0xeac9;
}
import type {ReactCall, ReactNodeList, ReactReturn} from 'shared/ReactTypes';

type CallHandler<T> = (props: T, returns: Array<mixed>) => ReactNodeList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import invariant from 'fbjs/lib/invariant';
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
import typeof * as CSFeatureFlagsType from './ReactNativeCSFeatureFlags';

export const debugRenderPhaseSideEffects = false;
export const enableAsyncSubtreeAPI = true;
export const enableAsyncSchedulingByDefaultInReactDOM = false;
export const enableReactFragment = false;
Expand Down
Loading