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

Fix ReactiveDependencies rule #3

Closed
wants to merge 152 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
cdbfa6b
[react-is] add back proper AsyncMode symbol, for back compat (#13959)
ljharb Oct 31, 2018
d5d10d1
Simplify imports in react reconciler (#13718)
mmarkelov Nov 1, 2018
595b4f9
Remove duplicate import declarations (#14062)
chrisbianca Nov 1, 2018
c84b9bf
Tweak error message for missing fallback (#14068)
sophiebits Nov 2, 2018
c898020
Warn for forwardRef(memo(...)) (#14070)
sophiebits Nov 2, 2018
ae196e8
Rename inputsAreEqual to areHookInputsEqual & move it to shared (#14036)
Andarist Nov 2, 2018
293fed8
Warn for bad useEffect return value (#14069)
sophiebits Nov 2, 2018
8eca0ef
chore(tests): don't rely on jest fake timers scheduling real timers (…
SimenB Nov 2, 2018
6c404d8
Bugfix: Add back early return in setOffsets which was removed between…
einarq Nov 5, 2018
d34d1c3
react-reconciler: Update README.md (#13953)
marcelometal Nov 5, 2018
ce90ffd
update the benchmark script (#13994)
keyz Nov 5, 2018
b305c4e
fix(react-dom): Fix crash during server render (#14103)
tnunes Nov 5, 2018
fd1256a
Add Debug Tools Package for Introspection of Hooks (#14085)
sebmarkbage Nov 5, 2018
da04058
Use Function.prototype.apply in warningWithoutStack (#14107)
sophiebits Nov 5, 2018
8b87ebf
Rename .internal tests that aren't using internals (#14109)
sophiebits Nov 5, 2018
ebdb47d
DCE hooks code when flag is off (#14111)
sophiebits Nov 5, 2018
9d47143
Implement {,un}hideInstance on RN renderer (#14115)
sophiebits Nov 5, 2018
e9a2ec9
[suspense] Avoid double commit by re-rendering immediately and reusin…
acdlite Nov 6, 2018
600651e
Restore the Hooks dispatcher after using SSR (#14105)
gaearon Nov 6, 2018
0a0f503
Enable hooks in www build (#14116)
acdlite Nov 6, 2018
affb2b5
Enable hooks in www test renderer, too
acdlite Nov 6, 2018
e451299
Fix unhiding in IE11 (#14126)
sophiebits Nov 6, 2018
f777d19
Fix lazy() with defaultProps (#14112)
gaearon Nov 6, 2018
b67c1a2
Add DEV-only checks for assumption about instance properties (#14128)
gaearon Nov 6, 2018
b020fb1
Check correct commit phase props in fuzz tester (#14129)
acdlite Nov 6, 2018
3c69a18
Recover from errors with a boundary in completion phase (#14104)
gaearon Nov 6, 2018
b4608dd
Remove unused simulated flag parameter (#14127)
nadavkaner Nov 7, 2018
2aecbcd
"functional component" -> "function component" (#14123)
locknono Nov 7, 2018
8f2c89e
Make react-debug-tools a private package
acdlite Nov 7, 2018
bd5a6d3
Update changelog with unreleased features
acdlite Nov 7, 2018
fd4527d
Updating yarn.lock file for 16.6.1 release
acdlite Nov 7, 2018
b50e63e
Updating package versions for release 16.6.1
acdlite Nov 7, 2018
a24d510
Update error codes for 16.6.1 release
acdlite Nov 7, 2018
ba19844
Update bundle sizes for 16.6.1 release
acdlite Nov 7, 2018
ff29de4
Updating CHANGELOG.md for 16.6.1 release
acdlite Nov 7, 2018
e3a7b96
Make react-debug-tools a private package
acdlite Nov 7, 2018
aa1ffe4
Show deprecated context object warnings usage in ReactDOM server (#14…
trueadm Nov 7, 2018
e27720d
[Synchronous Suspense] Reuse deletions from primary tree (#14133)
acdlite Nov 7, 2018
be63473
Release script supports interleaved stable and alpha releases (#14138)
bvaughn Nov 7, 2018
5afa1c4
Tag MemoComponent with PerformedWork effectTag for DevTools Profiler …
bvaughn Nov 7, 2018
3ff2c7c
Invalid actualDuration+treeBaseDuration for hidden+suspended trees (#…
bvaughn Nov 7, 2018
051272f
Use Entry in `yarn build ...` Instead of Label (#14148)
sebmarkbage Nov 8, 2018
3d8bda7
Refactor ESLint configuration to enable better IDE integration (#13914)
NMinhNguyen Nov 8, 2018
7c56013
Adding logger pri (#14155)
n8schloss Nov 8, 2018
f9e9913
[Synchronous Suspense] Don't delete children of suspended component (…
acdlite Nov 8, 2018
7fd1661
Don't warn if an unmounted component is pinged (#14158)
acdlite Nov 9, 2018
e58ecda
Suspense fuzz tester (#14147)
acdlite Nov 9, 2018
4b163fe
Remove errant return assignment (#14164)
acdlite Nov 9, 2018
02e4848
Improved suspense support in ReactDOMServer (#14161)
alexmckenley Nov 9, 2018
c174f85
Add fb build of ESLint plugin (#14165)
acdlite Nov 9, 2018
9fb9199
Add global to ESLint plugin bundle config
acdlite Nov 9, 2018
5618da4
Fix comment typo (#14156)
bgord Nov 9, 2018
1034e26
Fix typos (#14124)
NE-SmallTown Nov 9, 2018
9cc631a
Don't run danger on bad build (#14143)
sophiebits Nov 9, 2018
2dd4ba1
ESlint -> ESLint
acdlite Nov 9, 2018
d5e1bf0
Renamed outdated schedule/tracing referecnes (#14177)
bvaughn Nov 9, 2018
8ae867e
Warn about conflicting style values during updates (#14181)
sophiebits Nov 9, 2018
1a6ab1e
SimpleMemoComponent should warn if a ref is given (#14178)
sophiebits Nov 9, 2018
961eb65
Use unique thread ID for each partial render to access Context (#14182)
sebmarkbage Nov 9, 2018
f8bfd58
fix typo
sebmarkbage Nov 10, 2018
b98adb6
Simplify CSS shorthand property warning (#14183)
sophiebits Nov 10, 2018
d204747
Update Readme (#14176)
mmarkelov Nov 12, 2018
f55795c
Add regression test for #14188 (#14197)
gaearon Nov 13, 2018
85f5a81
Save CI-built node_modules as build artifacts (#14205)
bvaughn Nov 13, 2018
3cd89da
Update error codes
acdlite Nov 13, 2018
d7fd679
Add 16.6.3 Changelog (#14223)
gaearon Nov 13, 2018
5bce0ef
[scheduler] Post to MessageChannel instead of window (#14234)
acdlite Nov 14, 2018
8feeed1
[scheduler] Remove window.postMessage fallback
acdlite Nov 14, 2018
5f06576
Add a checkbox to fixtures UI to choose React production build (#13786)
poeschko Nov 14, 2018
21d5f7d
Wrap shorthand CSS property collision warning in feature flag (#14245)
acdlite Nov 15, 2018
a22fabc
Reduce scheduler serialization overhead (#14249)
developit Nov 16, 2018
9b2fb24
Clear memoizedState on unmount of fiber to avoid memory leak (#14218)
trueadm Nov 19, 2018
5926765
Revert "Clear memoizedState on unmount of fiber to avoid memory leak …
trueadm Nov 19, 2018
0e9cb3f
Clear fields on unmount of fiber to avoid memory leak (#14276)
trueadm Nov 19, 2018
ccb14e2
Fix SSR useCallback in render phase (#14279)
gaearon Nov 19, 2018
c954efa
Remove `import * as` pattern from the codebase (#14282)
sebmarkbage Nov 19, 2018
327cf0e
Fix support for mixing react-dom/server@16.6 and react@<16.6 (#14291)
gaearon Nov 20, 2018
a9fdf8a
Warn about reassigning this.props (#14277)
gaearon Nov 20, 2018
1da3108
fix spelling error: Here's -> Here (#14307)
Nov 22, 2018
dd8205c
List ignored types instead of included types in the stack (#14308)
gaearon Nov 22, 2018
dc0dd4b
Use |0 to coerce to number (#14297)
gaearon Nov 22, 2018
14be29b
Add more test coverage for nested memo() (#14311)
gaearon Nov 22, 2018
0c7189d
Fix resolution of outer props with React.memo() (#14312)
gaearon Nov 22, 2018
7475120
Prevent deopts from modifying exports object in stable builds (#14309)
gaearon Nov 23, 2018
686f106
Publish a local release (canary or stable) to NPM (#14260)
bvaughn Nov 23, 2018
ed4c4a5
Add basic release script snapshot test (#14280)
bvaughn Nov 23, 2018
a7f270c
update fixtures/packaging/README.md (#14320)
Nov 24, 2018
409066a
Add progress bars to longer running async release tasks (#14322)
bvaughn Nov 26, 2018
33f6f5e
Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry…
cpojer Nov 26, 2018
ee3ef3a
Fix regression: Errors not emitted in streams (#14314)
voxpelli Nov 27, 2018
f93f340
Make useEffect(async) warning more verbose (#14327)
gaearon Nov 27, 2018
48f1e5b
Add a null type test for memo (#14325)
springuper Nov 27, 2018
c2a2d8a
Remove useMutationEffect (#14336)
sophiebits Nov 27, 2018
4f964f0
Adding isMemo check to react-is package (#14313)
jintoppy Nov 28, 2018
88ada98
Release script auto-determine the latest Canary build if none specifi…
bvaughn Nov 28, 2018
d14ba87
Validate propTypes for lazy() and memo() and warn about invalid patte…
gaearon Nov 29, 2018
16e1204
[Fire] Add initial build infrastructure (#14359)
gaearon Nov 30, 2018
f1bf281
Fix bug in cloneHook (#14364)
ioss Nov 30, 2018
1d25aa5
[Fizz] New Server Rendering Infra (#14144)
sebmarkbage Nov 30, 2018
52bea95
Fixed scheduler setTimeout fallback (#14358)
bvaughn Dec 1, 2018
f00c275
Removed unnecessary externals from Jest bundles (#14372)
bvaughn Dec 2, 2018
8482cbe
Automated fixture tests (#14370)
bvaughn Dec 2, 2018
e382b0b
Don't prompt to tag or create GitHub release for canary releases (#14…
bvaughn Dec 3, 2018
7a48c90
Prevent a v8 deopt when profiling (#14383)
bvaughn Dec 3, 2018
6bf5e85
Fix scheduler setTimeout() re-entrancy check (#14384)
bvaughn Dec 3, 2018
d987172
fix spelling error: differen -> different (#14378)
AGCB Dec 4, 2018
1dc108e
Tweaked wording for v8 "performance cliff" issue
Dec 4, 2018
39489e7
Enable hooks in fabric (#14301)
sahrens Dec 5, 2018
98eb5ae
TestRenderer toJSON should not expose the Array wrapper Suspense uses…
bvaughn Dec 5, 2018
5bb4ad7
Added ErrorBoundary tests for useEffect and useLayoutEffect (#14401)
bvaughn Dec 6, 2018
8df4d59
Implement pauseExecution, continueExecution, dumpQueue for Scheduler …
mrkev Dec 6, 2018
f64906f
Dangerfile exits early if build failed (#14400)
bvaughn Dec 7, 2018
ce43a8c
Updated version incrementing suggestion in release script based on te…
bvaughn Dec 7, 2018
947bddd
Remove redundant argument of getPlugins function (#14419)
NE-SmallTown Dec 12, 2018
a22880e
Add support for Suspense & lazy() to the react-is package (#14423)
pleunv Dec 12, 2018
7325ebe
Inject overrideProps() fn to DevTools (#14427)
bvaughn Dec 13, 2018
2743fb7
Enable hooks by default for FB React Native renderer (#14435)
bvaughn Dec 13, 2018
535804f
Removed Fabric-specific feature flag files and updated Rollup to use …
bvaughn Dec 14, 2018
4a10721
Memoize promise listeners to prevent exponential growth (#14429)
acdlite Dec 14, 2018
8bfef0d
Make scheduler debugging feature flag static
acdlite Dec 18, 2018
653bc58
Create separate SchedulerFeatureFlags instead of using ReactFeatureFl…
acdlite Dec 18, 2018
1c5aa2f
Move SchedulerFeatureFlags fork to src directory to fix lint
acdlite Dec 18, 2018
c695b23
React v16.7.0
acdlite Dec 20, 2018
84b8647
Update CHANGELOG for 16.7
acdlite Dec 20, 2018
659c139
Update ReactFiberScheduler.js (#14477)
CarlMungazi Dec 20, 2018
fef40c0
Allow node 11 as devEngine (#14450)
iljadaderko Dec 25, 2018
3494ee5
Update ReactUpdateQueue.js (#14521)
CarlMungazi Jan 2, 2019
547e059
Simplify wording of key warning (#14503)
sophiebits Jan 7, 2019
a9b035b
Separate Object.is polyfill (#14334)
mmarkelov Jan 8, 2019
19ef0ec
Separate current owner and dispatcher (#14548)
bvaughn Jan 8, 2019
ab03e3d
Inject ReactCurrentDispatcher ref to DevTools (#14550)
bvaughn Jan 9, 2019
b4ad8e9
rename useImperativeMethods -> useImperativeHandle (#14565)
Jan 10, 2019
f290138
react-debug-tools accepts currentDispatcher ref as param (#14556)
bvaughn Jan 10, 2019
0005d1e
Fix typo (#14576)
CarlMungazi Jan 12, 2019
3e15b1c
make a fork for ReactCurrentDispatcher (#14588)
Jan 14, 2019
edb1f59
Support configurable labels for custom hooks (#14559)
bvaughn Jan 14, 2019
0fc1547
Avoid new Set([iterable]) for thenables (#14592)
aweary Jan 15, 2019
7ad9806
Tweak to avoid property read (#14593)
aweary Jan 15, 2019
0ca628b
Rename release script fixture test scheduler->tracing (#14590)
bvaughn Jan 15, 2019
153a0b5
Add noop useDebugValue hook to partial/server renderer (#14597)
bvaughn Jan 15, 2019
4392e38
useDebugValue should throw if used in a class component (#14601)
bvaughn Jan 15, 2019
7ab8a8e
Added Flow type to keep hooks dispatchers in-sync (#14599)
bvaughn Jan 16, 2019
8a12009
Add ESLint rule playground (#14609)
gaearon Jan 16, 2019
f2d74d3
Add ESLint rule for useEffect/useCallback/useMemo Hook dependencies
calebmer Oct 31, 2018
41fec63
Fix ReactiveDependencies rule
jamiebuilds Oct 31, 2018
f227df8
fix lint errors
jamiebuilds Oct 31, 2018
5d5b180
Support useLayoutEffect
gaearon Jan 10, 2019
816b8ae
Add some failing tests and comments
gaearon Jan 10, 2019
e7f44f1
Gather dependencies in child scopes too
gaearon Jan 11, 2019
c1ab460
If we don't find foo.bar.baz in deps, try foo.bar, then foo
gaearon Jan 11, 2019
902cb08
foo is enough for both foo.bar and foo.baz
gaearon Jan 11, 2019
8797fa6
Shorter rule name
gaearon Jan 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ jobs:
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules

- store_artifacts:
path: ./node_modules.tgz

- store_artifacts:
path: ./scripts/error-codes/codes.json
48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';

const {
es5Paths,
esNextPaths,
} = require('./scripts/shared/pathsByLanguageVersion');

const OFF = 0;
const ERROR = 2;

Expand All @@ -16,6 +21,15 @@ module.exports = {
'react-internal',
],

parser: 'espree',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'script',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},

// We're stricter than the default config, mostly. We'll override a few rules
// and then enable some React specific ones.
rules: {
Expand Down Expand Up @@ -44,6 +58,13 @@ module.exports = {
'space-before-function-paren': OFF,
'valid-typeof': [ERROR, {requireStringLiterals: true}],

// We apply these settings to files that should run on Node.
// They can't use JSX or ES6 modules, and must be in strict mode.
// They can, however, use other ES6 features.
// (Note these rules are overridden later for source files.)
'no-var': ERROR,
strict: ERROR,

// React & JSX
// Our transforms set this automatically
'react/jsx-boolean-value': [ERROR, 'always'],
Expand Down Expand Up @@ -71,6 +92,33 @@ module.exports = {
},

overrides: [
{
// We apply these settings to files that we ship through npm.
// They must be ES5.
files: es5Paths,
parser: 'espree',
parserOptions: {
ecmaVersion: 5,
sourceType: 'script',
},
rules: {
'no-var': OFF,
strict: ERROR,
},
},
{
// We apply these settings to the source files that get compiled.
// They can use all features including JSX (but shouldn't use `var`).
files: esNextPaths,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
},
rules: {
'no-var': ERROR,
strict: OFF,
},
},
{
files: ['**/__tests__/*.js'],
rules: {
Expand Down
53 changes: 50 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,56 @@
Changes that have landed in master but are not yet released.
Click to see more.
</summary>

</details>

## 16.7.0 (December 19, 2018)

### React DOM

* Fix performance of `React.lazy` for large numbers of lazily-loaded components. ([@acdlite](http://github.com/acdlite) in [#14429](https://github.com/facebook/react/pull/14429))
* Clear fields on unmount to avoid memory leaks. ([@trueadm](http://github.com/trueadm) in [#14276](https://github.com/facebook/react/pull/14276))
* Fix bug with SSR and context when mixing `react-dom/server@16.6` and `react@<16.6`. ([@gaearon](http://github.com/gaearon) in [#14291](https://github.com/facebook/react/pull/14291))
* Fix a performance regression in profiling mode. ([@bvaughn](http://github.com/bvaughn) in [#14383](https://github.com/facebook/react/pull/14383))

### Scheduler (Experimental)

* Post to MessageChannel instead of window. ([@acdlite](http://github.com/acdlite) in [#14234](https://github.com/facebook/react/pull/14234))
* Reduce serialization overhead. ([@developit](http://github.com/developit) in [#14249](https://github.com/facebook/react/pull/14249))
* Fix fallback to `setTimeout` in testing environments. ([@bvaughn](http://github.com/bvaughn) in [#14358](https://github.com/facebook/react/pull/14358))
* Add methods for debugging. ([@mrkev](http://github.com/mrkev) in [#14053](https://github.com/facebook/react/pull/14053))


## 16.6.3 (November 12, 2018)

### React DOM

* Fix bugs in `Suspense` and `lazy`. ([@acdlite](https://github.com/acdlite) in [#14133](https://github.com/facebook/react/pull/14133), [#14157](https://github.com/facebook/react/pull/14157), and [#14164](https://github.com/facebook/react/pull/14164))
* Fix highlighting of `React.memo` updates in React DevTools. ([@bvaughn](https://github.com/bvaughn) in [#14141](https://github.com/facebook/react/pull/14141))
* Fix interaction of Suspense with the React Profiler. ([@bvaughn](https://github.com/bvaughn) in [#14065](https://github.com/facebook/react/pull/14065))
* Fix a false positive warning when using Suspense. ([@acdlite](https://github.com/acdlite) in [#14158](https://github.com/facebook/react/pull/14158))

### React DOM Server

* Fix incorrect sharing of context state between `renderToNodeStream()` calls. ([@sebmarkbage](https://github.com/sebmarkbage) in [#14182](https://github.com/facebook/react/pull/14182))
* Add a warning about incorrect usage of the context API. ([@trueadm](https://github.com/trueadm) in [#14033](https://github.com/facebook/react/pull/14033))

## 16.6.2 (November 12, 2018)

This release was published in a broken state and should be skipped.

## 16.6.1 (November 6, 2018)

### React DOM

* Fallback should not remount every time a promise resolves. ([@acdlite](https://github.com/acdlite) in [#14083](https://github.com/facebook/react/pull/14083))
* Fix bug where Suspense keeps showing fallback even after everything finishes loading. ([@acdlite](https://github.com/acdlite) in [#14083](https://github.com/facebook/react/pull/14083))
* Fix unresolved default props in lifecycle methods of a lazy component. ([@gaearon](https://github.com/gaearon) in [#14112](https://github.com/facebook/react/pull/14112))
* Fix bug when recovering from an error thrown during complete phase. ([@gaearon](https://github.com/gaearon) in [#14104](https://github.com/facebook/react/pull/14104))

### Scheduler (Experimental)

* Switch from deadline object to `shouldYield` API. ([@acdlite](https://github.com/acdlite) in [#14025](https://github.com/facebook/react/pull/14025))


## 16.6.0 (October 23, 2018)

Expand Down Expand Up @@ -95,7 +142,7 @@
* Fix incorrect data in `compositionend` event when typing Korean on IE11 ([@crux153](https://github.com/crux153) in [#12563](https://github.com/facebook/react/issues/12563))
* Fix a crash when using dynamic `children` in the `<option>` tag ([@Slowyn](https://github.com/Slowyn) in [#13261](https://github.com/facebook/react/issues/13261), [@gaearon](https://github.com/gaearon) in [#13465](https://github.com/facebook/react/pull/13465))
* Fix the `checked` attribute not getting initially set on the `input` ([@dilidili](https://github.com/dilidili) in [#13114](https://github.com/facebook/react/issues/13114))
* Fix hydration of `dangerouslySetInnerHTML` when `__html` is not a string ([@gaearon](https://github.com/gaearon) in [#13353](https://github.com/facebook/react/issues/13353))
* Fix hydration of `dangerouslySetInnerHTML` when `__html` is not a string ([@gaearon](https://github.com/gaearon) in [#13353](https://github.com/facebook/react/issues/13353))
* Fix a warning about missing controlled `onChange` to fire on falsy values too ([@nicolevy](https://github.com/nicolevy) in [#12628](https://github.com/facebook/react/issues/12628))
* Fix `submit` and `reset` buttons getting an empty label ([@ellsclytn](https://github.com/ellsclytn) in [#12780](https://github.com/facebook/react/issues/12780))
* Fix the `onSelect` event not being triggered after drag and drop ([@gaearon](https://github.com/gaearon) in [#13422](https://github.com/facebook/react/issues/13422))
Expand Down Expand Up @@ -286,7 +333,7 @@
* Deduplicate warning messages about invalid callback. ([@yenshih](https://github.com/yenshih) in [#11833](https://github.com/facebook/react/pull/11833))
* Deprecate `ReactDOM.unstable_createPortal()` in favor of `ReactDOM.createPortal()`. ([@prometheansacrifice](https://github.com/prometheansacrifice) in [#11747](https://github.com/facebook/react/pull/11747))
* Don't emit User Timing entries for context types. ([@abhaynikam](https://github.com/abhaynikam) in [#12250](https://github.com/facebook/react/pull/12250))
* Improve the error message when context consumer child isn't a function. ([@raunofreiberg](https://github.com/raunofreiberg) in [#12267](https://github.com/facebook/react/pull/12267))
* Improve the error message when context consumer child isn't a function. ([@raunofreiberg](https://github.com/raunofreiberg) in [#12267](https://github.com/facebook/react/pull/12267))
* Improve the error message when adding a ref to a functional component. ([@skiritsis](https://github.com/skiritsis) in [#11782](https://github.com/facebook/react/pull/11782))

### React DOM Server
Expand Down
11 changes: 9 additions & 2 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//
// You'll need a GitHub token, you can re-use this one:
//
// e622517d9f1136ea8900 07c6373666312cdfaa69
// 0a7d5c3cad9a6dbec2d9 9a5222cf49062a4c1ef7
//
// (Just remove the space)
//
Expand All @@ -29,9 +29,16 @@ const {markdown, danger} = require('danger');
const fetch = require('node-fetch');

const {generateResultsArray} = require('./scripts/rollup/stats');
const {readFileSync} = require('fs');
const {existsSync, readFileSync} = require('fs');
const {exec} = require('child_process');

if (!existsSync('./scripts/rollup/results.json')) {
// This indicates the build failed previously.
// In that case, there's nothing for the Dangerfile to do.
// Exit early to avoid leaving a redundant (and potentially confusing) PR comment.
process.exit(0);
}

const currentBuildResults = JSON.parse(
readFileSync('./scripts/rollup/results.json')
);
Expand Down
2 changes: 1 addition & 1 deletion fixtures/art/VectorWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class VectorWidget extends React.Component {
/**
* When the component is mounted into the document - this is similar to a
* constructor, but invoked when the instance is actually mounted into the
* document. Here's, we'll just set up an animation loop that invokes our
* document. Here, we'll just set up an animation loop that invokes our
* method. Binding of `this.onTick` is not needed because all React methods
* are automatically bound before being mounted.
*/
Expand Down
2 changes: 1 addition & 1 deletion fixtures/attribute-behavior/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"prestart":
"cp ../../build/dist/react.development.js public/ && cp ../../build/dist/react-dom.development.js public/ && cp ../../build/dist/react-dom-server.browser.development.js public/",
"cp ../../build/node_modules/react/umd/react.development.js public/ && cp ../../build/node_modules/react-dom/umd/react-dom.development.js public/ && cp ../../build/node_modules/react-dom/umd/react-dom-server.browser.development.js public/",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
Expand Down
4 changes: 2 additions & 2 deletions fixtures/attribute-behavior/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ class App extends React.Component {
});
break;
default:
throw new Error('Switch statement should be exhuastive');
throw new Error('Switch statement should be exhaustive');
}

// Sort
Expand All @@ -887,7 +887,7 @@ class App extends React.Component {
});
}
default:
throw new Error('Switch statement should be exhuastive');
throw new Error('Switch statement should be exhaustive');
}
}

Expand Down
3 changes: 3 additions & 0 deletions fixtures/dom/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ coverage
# production
build
public/react.development.js
public/react.production.min.js
public/react-dom.development.js
public/react-dom.production.min.js
public/react-dom-server.browser.development.js
public/react-dom-server.browser.production.min.js

# misc
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion fixtures/dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"scripts": {
"start": "react-scripts start",
"prestart": "cp ../../build/dist/react.development.js ../../build/dist/react-dom.development.js ../../build/dist/react-dom-server.browser.development.js public/",
"prestart": "cp ../../build/node_modules/react/umd/react.development.js ../../build/node_modules/react-dom/umd/react-dom.development.js ../../build/node_modules/react/umd/react.production.min.js ../../build/node_modules/react-dom/umd/react-dom.production.min.js ../../build/node_modules/react-dom/umd/react-dom-server.browser.development.js ../../build/node_modules/react-dom/umd/react-dom-server.browser.production.min.js public/",
"build": "react-scripts build && cp build/index.html build/200.html",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
Expand Down
21 changes: 20 additions & 1 deletion fixtures/dom/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ class Header extends React.Component {
super(props, context);
const query = parse(window.location.search);
const version = query.version || 'local';
const production = query.production || false;
const versions = [version];
this.state = {version, versions};
this.state = {version, versions, production};
}
componentWillMount() {
getVersionTags().then(tags => {
Expand All @@ -25,6 +26,14 @@ class Header extends React.Component {
}
window.location.search = stringify(query);
}
handleProductionChange(event) {
const query = parse(window.location.search);
query.production = event.target.checked;
if (!query.production) {
delete query.production;
}
window.location.search = stringify(query);
}
handleFixtureChange(event) {
window.location.pathname = event.target.value;
}
Expand All @@ -43,6 +52,16 @@ class Header extends React.Component {
</span>

<div className="header-controls">
<input
id="react_production"
className="header__checkbox"
type="checkbox"
checked={this.state.production}
onChange={this.handleProductionChange}
/>
<label htmlFor="react_production" className="header__label">
Production
</label>
<label htmlFor="example">
<span className="sr-only">Select an example</span>
<select
Expand Down
36 changes: 26 additions & 10 deletions fixtures/dom/src/react-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ function loadScript(src) {
}

export function reactPaths() {
let reactPath = 'react.development.js';
let reactDOMPath = 'react-dom.development.js';
let reactDOMServerPath = 'react-dom-server.browser.development.js';

let query = parseQuery(window.location.search);
let version = query.version || 'local';
let isProduction = query.production === 'true';

let environment = isProduction ? 'production.min' : 'development';

let reactPath = 'react.' + environment + '.js';
let reactDOMPath = 'react-dom.' + environment + '.js';
let reactDOMServerPath = 'react-dom-server.browser.' + environment + '.js';

if (version !== 'local') {
const {major, minor, prerelease} = semver(version);
Expand All @@ -51,21 +54,34 @@ export function reactPaths() {
// Load the old module location for anything less than 16 RC
if (major >= 16 && !(minor === 0 && preReleaseStage === 'alpha')) {
reactPath =
'https://unpkg.com/react@' + version + '/umd/react.development.js';
'https://unpkg.com/react@' +
version +
'/umd/react.' +
environment +
'.js';
reactDOMPath =
'https://unpkg.com/react-dom@' +
version +
'/umd/react-dom.development.js';
'/umd/react-dom.' +
environment +
'.js';
reactDOMServerPath =
'https://unpkg.com/react-dom@' +
version +
'/umd/react-dom-server.browser.development';
'/umd/react-dom-server.browser.' +
environment +
'.js';
} else {
reactPath = 'https://unpkg.com/react@' + version + '/dist/react.js';
let suffix = isProduction ? '.min.js' : '.js';

reactPath = 'https://unpkg.com/react@' + version + '/dist/react' + suffix;
reactDOMPath =
'https://unpkg.com/react-dom@' + version + '/dist/react-dom.js';
'https://unpkg.com/react-dom@' + version + '/dist/react-dom' + suffix;
reactDOMServerPath =
'https://unpkg.com/react-dom@' + version + '/dist/react-dom-server.js';
'https://unpkg.com/react-dom@' +
version +
'/dist/react-dom-server' +
suffix;
}
}

Expand Down
9 changes: 9 additions & 0 deletions fixtures/dom/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ textarea {
width: 100%;
}

.header__checkbox {
vertical-align: middle;
}

.header__label {
font-size: 12px;
color: #ccc;
}

.sr-only {
clip: rect(0, 0, 0, 0);
height: 0;
Expand Down
15 changes: 15 additions & 0 deletions fixtures/eslint/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react-hooks"],
"rules": {
"react-hooks/rules-of-hooks": 2,
"react-hooks/reactive-deps": 2
}
}
7 changes: 7 additions & 0 deletions fixtures/eslint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ESLint Playground Fixture

This is an internal playground for quick iteration on our lint rules inside an IDE like VSCode.

See instructions in `./index.js` in this directory.

![Demo](https://duaw26jehqd4r.cloudfront.net/items/2Z390a31003O0l0o0e3O/Screen%20Recording%202019-01-16%20at%2010.29%20PM.gif?v=d6856125)
Loading