Compare commits

..

2 Commits

Author SHA1 Message Date
Jason Quense
f0664d552c Merge branch 'master' into radio-click 2018-08-02 17:31:34 -04:00
Jason Quense
7b1bbe6bef Use change or input events for checkable inputs 2018-04-18 17:21:42 -04:00
681 changed files with 10711 additions and 26822 deletions

View File

@@ -37,12 +37,10 @@ module.exports = {
'no-shadow': ERROR,
'no-unused-expressions': ERROR,
'no-unused-vars': [ERROR, {args: 'none'}],
'no-use-before-define': [ERROR, {functions: false, variables: false}],
'no-useless-concat': OFF,
'quotes': [ERROR, 'single', {avoidEscape: true, allowTemplateLiterals: true }],
'space-before-blocks': ERROR,
'space-before-function-paren': OFF,
'valid-typeof': [ERROR, {requireStringLiterals: true}],
// React & JSX
// Our transforms set this automatically
@@ -66,7 +64,6 @@ module.exports = {
// CUSTOM RULES
// the second argument of warning/invariant should be a literal string
'react-internal/no-primitive-constructors': ERROR,
'react-internal/no-to-warn-dev-within-to-throw': ERROR,
'react-internal/warning-and-invariant-args': ERROR,
},
@@ -85,6 +82,5 @@ module.exports = {
spyOnDevAndProd: true,
spyOnProd: true,
__PROFILE__: true,
__UMD__: true,
},
};

17
.flowcoverage Normal file
View File

@@ -0,0 +1,17 @@
{
"excludeGlob": [
"node_modules/**",
"packages/**/__mocks__/*.js",
"packages/**/__tests__/*.js"
],
"includeGlob": [
"packages/**/src/**/*.js"
],
"outputDir": "flow-coverage",
"threshold": 90,
"type": [
"html",
"json",
"text"
]
}

1
.gitignore vendored
View File

@@ -9,6 +9,7 @@ __benchmarks__
build/
remote-repo/
coverage/
flow-coverage/
.module-cache
fixtures/dom/public/react-dom.js
fixtures/dom/public/react.js

View File

@@ -7,104 +7,6 @@
</details>
## 16.5.2 (September 18, 2018)
### React DOM
* Fixed a recent `<iframe>` regression ([@JSteunou](https://github.com/JSteunou) in [#13650](https://github.com/facebook/react/pull/13650))
* Fix `updateWrapper` so that `<textarea>`s no longer re-render when data is unchanged ([@joelbarbosa](https://github.com/joelbarbosa) in [#13643](https://github.com/facebook/react/pull/13643))
### Schedule (Experimental)
* Renaming "tracking" API to "tracing" ([@bvaughn](https://github.com/bvaughn) in [#13641](https://github.com/facebook/react/pull/13641))
* Add UMD production+profiling entry points ([@bvaughn](https://github.com/bvaughn) in [#13642](https://github.com/facebook/react/pull/13642))
* Refactored `schedule` to remove some React-isms and improve performance for when deferred updates time out ([@acdlite](https://github.com/acdlite) in [#13582](https://github.com/facebook/react/pull/13582))
## 16.5.1 (September 13, 2018)
### React
* Improve the warning when `React.forwardRef` receives an unexpected number of arguments. ([@andresroberto](https://github.com/andresroberto) in [#13636](https://github.com/facebook/react/issues/13636))
### React DOM
* Fix a regression in unstable exports used by React Native Web. ([@aweary](https://github.com/aweary) in [#13598](https://github.com/facebook/react/issues/13598))
* Fix a crash when component defines a method called `isReactComponent`. ([@gaearon](https://github.com/gaearon) in [#13608](https://github.com/facebook/react/issues/13608))
* Fix a crash in development mode in IE9 when printing a warning. ([@link-alex](https://github.com/link-alex) in [#13620](https://github.com/facebook/react/issues/13620))
* Provide a better error message when running `react-dom/profiling` with `schedule/tracking`. ([@bvaughn](https://github.com/bvaughn) in [#13605](https://github.com/facebook/react/issues/13605))
* If a `ForwardRef` component defines a `displayName`, use it in warnings. ([@probablyup](https://github.com/probablyup) in [#13615](https://github.com/facebook/react/issues/13615))
### Schedule (Experimental)
* Add a separate profiling entry point at `schedule/tracking-profiling`. ([@bvaughn](https://github.com/bvaughn) in [#13605](https://github.com/facebook/react/issues/13605))
## 16.5.0 (September 5, 2018)
### React
* Add a warning if `React.forwardRef` render function doesn't take exactly two arguments ([@bvaughn](https://github.com/bvaughn) in [#13168](https://github.com/facebook/react/issues/13168))
* Improve the error message when passing an element to `createElement` by mistake ([@DCtheTall](https://github.com/DCtheTall) in [#13131](https://github.com/facebook/react/issues/13131))
* Don't call profiler `onRender` until after mutations ([@bvaughn](https://github.com/bvaughn) in [#13572](https://github.com/facebook/react/issues/13572))
### React DOM
* Add support for React DevTools Profiler ([@bvaughn](https://github.com/bvaughn) in [#13058](https://github.com/facebook/react/issues/13058))
* Add `react-dom/profiling` entry point alias for profiling in production ([@bvaughn](https://github.com/bvaughn) in [#13570](https://github.com/facebook/react/issues/13570))
* Add `onAuxClick` event for browsers that support it ([@jquense](https://github.com/jquense) in [#11571](https://github.com/facebook/react/issues/11571))
* Add `movementX` and `movementY` fields to mouse events ([@jasonwilliams](https://github.com/jasonwilliams) in [#9018](https://github.com/facebook/react/issues/9018))
* Add `tangentialPressure` and `twist` fields to pointer events ([@motiz88](https://github.com/motiz88) in [#13374](https://github.com/facebook/react/issues/13374))
* Minimally support iframes (nested browsing contexts) in selection event handling ([@acusti](https://github.com/acusti) in [#12037](https://github.com/facebook/react/issues/12037))
* Support passing booleans to the `focusable` SVG attribute ([@gaearon](https://github.com/gaearon) in [#13339](https://github.com/facebook/react/issues/13339))
* Ignore `<noscript>` on the client when hydrating ([@Ephem](https://github.com/Ephem) in [#13537](https://github.com/facebook/react/issues/13537))
* Fix `gridArea` to be treated as a unitless CSS property ([@mgol](https://github.com/mgol) in [#13550](https://github.com/facebook/react/issues/13550))
* 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 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))
* Fix the `onClick` event not working inside a portal on iOS ([@aweary](https://github.com/aweary) in [#11927](https://github.com/facebook/react/issues/11927))
* Fix a performance issue when thousands of roots are re-rendered ([@gaearon](https://github.com/gaearon) in [#13335](https://github.com/facebook/react/issues/13335))
* Fix a performance regression that also caused `onChange` to not fire in some cases ([@gaearon](https://github.com/gaearon) in [#13423](https://github.com/facebook/react/issues/13423))
* Handle errors in more edge cases gracefully ([@gaearon](https://github.com/gaearon) in [#13237](https://github.com/facebook/react/issues/13237) and [@acdlite](https://github.com/acdlite) in [#13269](https://github.com/facebook/react/issues/13269))
* Don't use proxies for synthetic events in development ([@gaearon](https://github.com/gaearon) in [#12171](https://github.com/facebook/react/issues/12171))
* Warn when `"false"` or `"true"` is the value of a boolean DOM prop ([@motiz88](https://github.com/motiz88) in [#13372](https://github.com/facebook/react/issues/13372))
* Warn when `this.state` is initialized to `props` ([@veekas](https://github.com/veekas) in [#11658](https://github.com/facebook/react/issues/11658))
* Don't compare `style` on hydration in IE due to noisy false positives ([@mgol](https://github.com/mgol) in [#13534](https://github.com/facebook/react/issues/13534))
* Include `StrictMode` in the component stack ([@gaearon](https://github.com/gaearon) in [#13240](https://github.com/facebook/react/issues/13240))
* Don't overwrite `window.event` in IE ([@ConradIrwin](https://github.com/ConradIrwin) in [#11696](https://github.com/facebook/react/issues/11696))
* Improve component stack for the `folder/index.js` naming convention ([@gaearon](https://github.com/gaearon) in [#12059](https://github.com/facebook/react/issues/12059))
* Improve a warning when using `getDerivedStateFromProps` without initialized state ([@flxwu](https://github.com/flxwu) in [#13317](https://github.com/facebook/react/issues/13317))
* Improve a warning about invalid textarea usage ([@raunofreiberg](https://github.com/raunofreiberg) in [#13361](https://github.com/facebook/react/issues/13361))
* Treat invalid Symbol and function values more consistently ([@raunofreiberg](https://github.com/raunofreiberg) in [#13362](https://github.com/facebook/react/issues/13362) and [#13389](https://github.com/facebook/react/issues/13389))
* Allow Electron `<webview>` tag without warnings ([@philipp-spiess](https://github.com/philipp-spiess) in [#13301](https://github.com/facebook/react/issues/13301))
* Don't show the uncaught error addendum if `e.preventDefault()` was called ([@gaearon](https://github.com/gaearon) in [#13384](https://github.com/facebook/react/issues/13384))
* Warn about rendering Generators ([@gaearon](https://github.com/gaearon) in [#13312](https://github.com/facebook/react/issues/13312))
* Remove irrelevant suggestion of a legacy method from a warning ([@zx6658](https://github.com/zx6658) in [#13169](https://github.com/facebook/react/issues/13169))
* Remove `unstable_deferredUpdates` in favor of `unstable_scheduleWork` from `schedule` ([@gaearon](https://github.com/gaearon) in [#13488](https://github.com/facebook/react/issues/13488))
* Fix unstable asynchronous mode from doing unnecessary work when an update takes too long ([@acdlite](https://github.com/acdlite) in [#13503](https://github.com/facebook/react/issues/13503))
### React DOM Server
* Fix crash with nullish children when using `dangerouslySetInnerHtml` in a selected `<option>` ([@mridgway](https://github.com/mridgway) in [#13078](https://github.com/facebook/react/issues/13078))
* Fix crash when `setTimeout` is missing ([@dustinsoftware](https://github.com/dustinsoftware) in [#13088](https://github.com/facebook/react/issues/13088))
### React Test Renderer and Test Utils
* Fix `this` in a functional component for shallow renderer to be `undefined` ([@koba04](https://github.com/koba04) in [#13144](https://github.com/facebook/react/issues/13144))
* Deprecate a Jest-specific `ReactTestUtils.mockComponent()` helper ([@bvaughn](https://github.com/bvaughn) in [#13193](https://github.com/facebook/react/issues/13193))
* Warn about `ReactDOM.createPortal` usage within the test renderer ([@bvaughn](https://github.com/bvaughn) in [#12895](https://github.com/facebook/react/issues/12895))
* Improve a confusing error message ([@gaearon](https://github.com/gaearon) in [#13351](https://github.com/facebook/react/issues/13351))
### React ART
* Add support for DevTools ([@yunchancho](https://github.com/yunchancho) in [#13173](https://github.com/facebook/react/issues/13173))
### Schedule (Experimental)
* New package for cooperatively scheduling work in a browser environment. It's used by React internally, but its public API is not finalized yet. ([@flarnie](https://github.com/flarnie) in [#12624](https://github.com/facebook/react/pull/12624))
## 16.4.2 (August 1, 2018)
### React DOM Server
@@ -909,7 +811,7 @@ Each of these changes will continue to work as before with a new warning until t
- `Object.is` is used in a number of places to compare values, which leads to fewer false positives, especially involving `NaN`. In particular, this affects the `shallowCompare` add-on. ([@chicoxyzzy](https://github.com/chicoxyzzy) in [#6132](https://github.com/facebook/react/pull/6132))
- Add-Ons: ReactPerf no longer instruments adding or removing an event listener because they dont really touch the DOM due to event delegation. ([@antoaravinth](https://github.com/antoaravinth) in [#5209](https://github.com/facebook/react/pull/5209))
### Other improvements
### Other improvements
- React now uses `loose-envify` instead of `envify` so it installs fewer transitive dependencies. ([@qerub](https://github.com/qerub) in [#6303](https://github.com/facebook/react/pull/6303))
- Shallow renderer now exposes `getMountedInstance()`. ([@glenjamin](https://github.com/glenjamin) in [#4918](https://github.com/facebook/react/pull/4918))

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
Copyright (c) 2013-present, Facebook, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -277,9 +277,9 @@
| Test Case | Flags | Result |
| --- | --- | --- |
| `action=(string)`| (changed)| `"https://reactjs.com/"` |
| `action=(empty string)`| (initial)| `"http://localhost:3000/"` |
| `action=(empty string)`| (changed)| `"http://localhost:3000/"` |
| `action=(array with string)`| (changed)| `"https://reactjs.com/"` |
| `action=(empty array)`| (initial)| `"http://localhost:3000/"` |
| `action=(empty array)`| (changed)| `"http://localhost:3000/"` |
| `action=(object)`| (changed)| `"http://localhost:3000/result%20of%20toString()"` |
| `action=(numeric string)`| (changed)| `"http://localhost:3000/42"` |
| `action=(-1)`| (changed)| `"http://localhost:3000/-1"` |
@@ -287,16 +287,16 @@
| `action=(integer)`| (changed)| `"http://localhost:3000/1"` |
| `action=(NaN)`| (changed, warning)| `"http://localhost:3000/NaN"` |
| `action=(float)`| (changed)| `"http://localhost:3000/99.99"` |
| `action=(true)`| (initial, warning)| `"http://localhost:3000/"` |
| `action=(false)`| (initial, warning)| `"http://localhost:3000/"` |
| `action=(true)`| (initial, warning)| `<empty string>` |
| `action=(false)`| (initial, warning)| `<empty string>` |
| `action=(string 'true')`| (changed)| `"http://localhost:3000/true"` |
| `action=(string 'false')`| (changed)| `"http://localhost:3000/false"` |
| `action=(string 'on')`| (changed)| `"http://localhost:3000/on"` |
| `action=(string 'off')`| (changed)| `"http://localhost:3000/off"` |
| `action=(symbol)`| (initial, warning)| `"http://localhost:3000/"` |
| `action=(function)`| (initial, warning)| `"http://localhost:3000/"` |
| `action=(null)`| (initial)| `"http://localhost:3000/"` |
| `action=(undefined)`| (initial)| `"http://localhost:3000/"` |
| `action=(symbol)`| (initial, warning)| `<empty string>` |
| `action=(function)`| (initial, warning)| `<empty string>` |
| `action=(null)`| (initial)| `<empty string>` |
| `action=(undefined)`| (initial)| `<empty string>` |
## `additive` (on `<animate>` inside `<svg>`)
| Test Case | Flags | Result |
@@ -389,8 +389,8 @@
| `allowFullScreen=(float)`| (changed)| `<boolean: true>` |
| `allowFullScreen=(true)`| (changed)| `<boolean: true>` |
| `allowFullScreen=(false)`| (initial)| `<boolean: false>` |
| `allowFullScreen=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `allowFullScreen=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `allowFullScreen=(string 'true')`| (changed)| `<boolean: true>` |
| `allowFullScreen=(string 'false')`| (changed)| `<boolean: true>` |
| `allowFullScreen=(string 'on')`| (changed)| `<boolean: true>` |
| `allowFullScreen=(string 'off')`| (changed)| `<boolean: true>` |
| `allowFullScreen=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -739,8 +739,8 @@
| `async=(float)`| (changed)| `<boolean: true>` |
| `async=(true)`| (changed)| `<boolean: true>` |
| `async=(false)`| (initial)| `<boolean: false>` |
| `async=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `async=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `async=(string 'true')`| (changed)| `<boolean: true>` |
| `async=(string 'false')`| (changed)| `<boolean: true>` |
| `async=(string 'on')`| (changed)| `<boolean: true>` |
| `async=(string 'off')`| (changed)| `<boolean: true>` |
| `async=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -802,26 +802,26 @@
| Test Case | Flags | Result |
| --- | --- | --- |
| `autoCapitalize=(string)`| (changed)| `"words"` |
| `autoCapitalize=(empty string)`| (initial)| `<empty string>` |
| `autoCapitalize=(empty string)`| (initial)| `"sentences"` |
| `autoCapitalize=(array with string)`| (changed)| `"words"` |
| `autoCapitalize=(empty array)`| (initial)| `<empty string>` |
| `autoCapitalize=(object)`| (changed)| `"sentences"` |
| `autoCapitalize=(numeric string)`| (changed)| `"sentences"` |
| `autoCapitalize=(-1)`| (changed)| `"sentences"` |
| `autoCapitalize=(0)`| (changed)| `"sentences"` |
| `autoCapitalize=(integer)`| (changed)| `"sentences"` |
| `autoCapitalize=(NaN)`| (changed, warning)| `"sentences"` |
| `autoCapitalize=(float)`| (changed)| `"sentences"` |
| `autoCapitalize=(true)`| (initial, warning)| `<empty string>` |
| `autoCapitalize=(false)`| (initial, warning)| `<empty string>` |
| `autoCapitalize=(string 'true')`| (changed)| `"sentences"` |
| `autoCapitalize=(string 'false')`| (changed)| `"sentences"` |
| `autoCapitalize=(string 'on')`| (changed)| `"sentences"` |
| `autoCapitalize=(empty array)`| (initial)| `"sentences"` |
| `autoCapitalize=(object)`| (initial)| `"sentences"` |
| `autoCapitalize=(numeric string)`| (initial)| `"sentences"` |
| `autoCapitalize=(-1)`| (initial)| `"sentences"` |
| `autoCapitalize=(0)`| (initial)| `"sentences"` |
| `autoCapitalize=(integer)`| (initial)| `"sentences"` |
| `autoCapitalize=(NaN)`| (initial, warning)| `"sentences"` |
| `autoCapitalize=(float)`| (initial)| `"sentences"` |
| `autoCapitalize=(true)`| (initial, warning)| `"sentences"` |
| `autoCapitalize=(false)`| (initial, warning)| `"sentences"` |
| `autoCapitalize=(string 'true')`| (initial)| `"sentences"` |
| `autoCapitalize=(string 'false')`| (initial)| `"sentences"` |
| `autoCapitalize=(string 'on')`| (initial)| `"sentences"` |
| `autoCapitalize=(string 'off')`| (changed)| `"none"` |
| `autoCapitalize=(symbol)`| (initial, warning)| `<empty string>` |
| `autoCapitalize=(function)`| (initial, warning)| `<empty string>` |
| `autoCapitalize=(null)`| (initial)| `<empty string>` |
| `autoCapitalize=(undefined)`| (initial)| `<empty string>` |
| `autoCapitalize=(symbol)`| (initial, warning)| `"sentences"` |
| `autoCapitalize=(function)`| (initial, warning)| `"sentences"` |
| `autoCapitalize=(null)`| (initial)| `"sentences"` |
| `autoCapitalize=(undefined)`| (initial)| `"sentences"` |
## `autoComplete` (on `<input>` inside `<div>`)
| Test Case | Flags | Result |
@@ -889,8 +889,8 @@
| `autoPlay=(float)`| (changed)| `<boolean: true>` |
| `autoPlay=(true)`| (changed)| `<boolean: true>` |
| `autoPlay=(false)`| (initial)| `<boolean: false>` |
| `autoPlay=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `autoPlay=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `autoPlay=(string 'true')`| (changed)| `<boolean: true>` |
| `autoPlay=(string 'false')`| (changed)| `<boolean: true>` |
| `autoPlay=(string 'on')`| (changed)| `<boolean: true>` |
| `autoPlay=(string 'off')`| (changed)| `<boolean: true>` |
| `autoPlay=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -1389,8 +1389,8 @@
| `checked=(float)`| (changed)| `<boolean: true>` |
| `checked=(true)`| (changed)| `<boolean: true>` |
| `checked=(false)`| (initial)| `<boolean: false>` |
| `checked=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `checked=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `checked=(string 'true')`| (changed)| `<boolean: true>` |
| `checked=(string 'false')`| (changed)| `<boolean: true>` |
| `checked=(string 'on')`| (changed)| `<boolean: true>` |
| `checked=(string 'off')`| (changed)| `<boolean: true>` |
| `checked=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -1401,23 +1401,23 @@
## `Checked` (on `<input>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `Checked=(string)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(empty string)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(array with string)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(empty array)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(object)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(numeric string)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(-1)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(0)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(integer)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(NaN)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(float)`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(string)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(empty string)`| (changed, warning)| `<empty string>` |
| `Checked=(array with string)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(empty array)`| (changed, warning)| `<empty string>` |
| `Checked=(object)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(numeric string)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(-1)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(0)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(integer)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(NaN)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(float)`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(true)`| (initial, warning)| `<null>` |
| `Checked=(false)`| (initial, warning)| `<null>` |
| `Checked=(string 'true')`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(string 'false')`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(string 'on')`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(string 'off')`| (initial, warning, ssr mismatch)| `<null>` |
| `Checked=(string 'true')`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(string 'false')`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(string 'on')`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(string 'off')`| (changed, warning, ssr mismatch)| `<empty string>` |
| `Checked=(symbol)`| (initial, warning)| `<null>` |
| `Checked=(function)`| (initial, warning)| `<null>` |
| `Checked=(null)`| (initial, warning)| `<null>` |
@@ -2139,8 +2139,8 @@
| `controls=(float)`| (changed)| `<boolean: true>` |
| `controls=(true)`| (changed)| `<boolean: true>` |
| `controls=(false)`| (initial)| `<boolean: false>` |
| `controls=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `controls=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `controls=(string 'true')`| (changed)| `<boolean: true>` |
| `controls=(string 'false')`| (changed)| `<boolean: true>` |
| `controls=(string 'on')`| (changed)| `<boolean: true>` |
| `controls=(string 'off')`| (changed)| `<boolean: true>` |
| `controls=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -2514,8 +2514,8 @@
| `default=(float)`| (changed)| `<boolean: true>` |
| `default=(true)`| (changed)| `<boolean: true>` |
| `default=(false)`| (initial)| `<boolean: false>` |
| `default=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `default=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `default=(string 'true')`| (changed)| `<boolean: true>` |
| `default=(string 'false')`| (changed)| `<boolean: true>` |
| `default=(string 'on')`| (changed)| `<boolean: true>` |
| `default=(string 'off')`| (changed)| `<boolean: true>` |
| `default=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -2551,25 +2551,25 @@
## `defaultChecked` (on `<input>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `defaultChecked=(string)`| (changed)| `<boolean: true>` |
| `defaultChecked=(string)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(empty string)`| (initial)| `<boolean: false>` |
| `defaultChecked=(array with string)`| (changed)| `<boolean: true>` |
| `defaultChecked=(empty array)`| (changed)| `<boolean: true>` |
| `defaultChecked=(object)`| (changed)| `<boolean: true>` |
| `defaultChecked=(numeric string)`| (changed)| `<boolean: true>` |
| `defaultChecked=(-1)`| (changed)| `<boolean: true>` |
| `defaultChecked=(array with string)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(empty array)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(object)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(numeric string)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(-1)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(0)`| (initial)| `<boolean: false>` |
| `defaultChecked=(integer)`| (changed)| `<boolean: true>` |
| `defaultChecked=(integer)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(NaN)`| (initial, warning, ssr warning)| `<boolean: false>` |
| `defaultChecked=(float)`| (changed)| `<boolean: true>` |
| `defaultChecked=(true)`| (changed)| `<boolean: true>` |
| `defaultChecked=(float)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(true)`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(false)`| (initial)| `<boolean: false>` |
| `defaultChecked=(string 'true')`| (changed)| `<boolean: true>` |
| `defaultChecked=(string 'false')`| (changed)| `<boolean: true>` |
| `defaultChecked=(string 'on')`| (changed)| `<boolean: true>` |
| `defaultChecked=(string 'off')`| (changed)| `<boolean: true>` |
| `defaultChecked=(symbol)`| (changed, ssr mismatch)| `<boolean: true>` |
| `defaultChecked=(function)`| (changed, ssr mismatch)| `<boolean: true>` |
| `defaultChecked=(string 'true')`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(string 'false')`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(string 'on')`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(string 'off')`| (initial, ssr mismatch)| `<boolean: false>` |
| `defaultChecked=(symbol)`| (initial)| `<boolean: false>` |
| `defaultChecked=(function)`| (initial)| `<boolean: false>` |
| `defaultChecked=(null)`| (initial)| `<boolean: false>` |
| `defaultChecked=(undefined)`| (initial)| `<boolean: false>` |
@@ -2639,8 +2639,8 @@
| `defer=(float)`| (changed)| `<boolean: true>` |
| `defer=(true)`| (changed)| `<boolean: true>` |
| `defer=(false)`| (initial)| `<boolean: false>` |
| `defer=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `defer=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `defer=(string 'true')`| (changed)| `<boolean: true>` |
| `defer=(string 'false')`| (changed)| `<boolean: true>` |
| `defer=(string 'on')`| (changed)| `<boolean: true>` |
| `defer=(string 'off')`| (changed)| `<boolean: true>` |
| `defer=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -2764,8 +2764,8 @@
| `disabled=(float)`| (changed)| `<boolean: true>` |
| `disabled=(true)`| (changed)| `<boolean: true>` |
| `disabled=(false)`| (initial)| `<boolean: false>` |
| `disabled=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `disabled=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `disabled=(string 'true')`| (changed)| `<boolean: true>` |
| `disabled=(string 'false')`| (changed)| `<boolean: true>` |
| `disabled=(string 'on')`| (changed)| `<boolean: true>` |
| `disabled=(string 'off')`| (changed)| `<boolean: true>` |
| `disabled=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -3587,8 +3587,8 @@
| `focusable=(integer)`| (changed)| `"1"` |
| `focusable=(NaN)`| (changed, warning)| `"NaN"` |
| `focusable=(float)`| (changed)| `"99.99"` |
| `focusable=(true)`| (changed)| `"true"` |
| `focusable=(false)`| (changed)| `"false"` |
| `focusable=(true)`| (initial, warning)| `<null>` |
| `focusable=(false)`| (initial, warning)| `<null>` |
| `focusable=(string 'true')`| (changed)| `"true"` |
| `focusable=(string 'false')`| (changed)| `"false"` |
| `focusable=(string 'on')`| (changed)| `"on"` |
@@ -4139,8 +4139,8 @@
| `formNoValidate=(float)`| (changed)| `<boolean: true>` |
| `formNoValidate=(true)`| (changed)| `<boolean: true>` |
| `formNoValidate=(false)`| (initial)| `<boolean: false>` |
| `formNoValidate=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `formNoValidate=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `formNoValidate=(string 'true')`| (changed)| `<boolean: true>` |
| `formNoValidate=(string 'false')`| (changed)| `<boolean: true>` |
| `formNoValidate=(string 'on')`| (changed)| `<boolean: true>` |
| `formNoValidate=(string 'off')`| (changed)| `<boolean: true>` |
| `formNoValidate=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -4764,8 +4764,8 @@
| `hidden=(float)`| (changed)| `<boolean: true>` |
| `hidden=(true)`| (changed)| `<boolean: true>` |
| `hidden=(false)`| (initial)| `<boolean: false>` |
| `hidden=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `hidden=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `hidden=(string 'true')`| (changed)| `<boolean: true>` |
| `hidden=(string 'false')`| (changed)| `<boolean: true>` |
| `hidden=(string 'on')`| (changed)| `<boolean: true>` |
| `hidden=(string 'off')`| (changed)| `<boolean: true>` |
| `hidden=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -5489,8 +5489,8 @@
| `itemScope=(float)`| (changed)| `<empty string>` |
| `itemScope=(true)`| (changed)| `<empty string>` |
| `itemScope=(false)`| (initial)| `<null>` |
| `itemScope=(string 'true')`| (changed, warning)| `<empty string>` |
| `itemScope=(string 'false')`| (changed, warning)| `<empty string>` |
| `itemScope=(string 'true')`| (changed)| `<empty string>` |
| `itemScope=(string 'false')`| (changed)| `<empty string>` |
| `itemScope=(string 'on')`| (changed)| `<empty string>` |
| `itemScope=(string 'off')`| (changed)| `<empty string>` |
| `itemScope=(symbol)`| (initial, warning)| `<null>` |
@@ -6239,8 +6239,8 @@
| `loop=(float)`| (changed)| `<boolean: true>` |
| `loop=(true)`| (changed)| `<boolean: true>` |
| `loop=(false)`| (initial)| `<boolean: false>` |
| `loop=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `loop=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `loop=(string 'true')`| (changed)| `<boolean: true>` |
| `loop=(string 'false')`| (changed)| `<boolean: true>` |
| `loop=(string 'on')`| (changed)| `<boolean: true>` |
| `loop=(string 'off')`| (changed)| `<boolean: true>` |
| `loop=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -7064,8 +7064,8 @@
| `multiple=(float)`| (changed)| `<boolean: true>` |
| `multiple=(true)`| (changed)| `<boolean: true>` |
| `multiple=(false)`| (initial)| `<boolean: false>` |
| `multiple=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `multiple=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `multiple=(string 'true')`| (changed)| `<boolean: true>` |
| `multiple=(string 'false')`| (changed)| `<boolean: true>` |
| `multiple=(string 'on')`| (changed)| `<boolean: true>` |
| `multiple=(string 'off')`| (changed)| `<boolean: true>` |
| `multiple=(symbol)`| (changed, warning, ssr mismatch)| `<boolean: true>` |
@@ -7076,23 +7076,23 @@
## `muted` (on `<video>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `muted=(string)`| (changed)| `<boolean: true>` |
| `muted=(string)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(empty string)`| (initial)| `<boolean: false>` |
| `muted=(array with string)`| (changed)| `<boolean: true>` |
| `muted=(empty array)`| (changed)| `<boolean: true>` |
| `muted=(object)`| (changed)| `<boolean: true>` |
| `muted=(numeric string)`| (changed)| `<boolean: true>` |
| `muted=(-1)`| (changed)| `<boolean: true>` |
| `muted=(array with string)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(empty array)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(object)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(numeric string)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(-1)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(0)`| (initial)| `<boolean: false>` |
| `muted=(integer)`| (changed)| `<boolean: true>` |
| `muted=(integer)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(NaN)`| (initial, warning)| `<boolean: false>` |
| `muted=(float)`| (changed)| `<boolean: true>` |
| `muted=(true)`| (changed)| `<boolean: true>` |
| `muted=(float)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(true)`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(false)`| (initial)| `<boolean: false>` |
| `muted=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `muted=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `muted=(string 'on')`| (changed)| `<boolean: true>` |
| `muted=(string 'off')`| (changed)| `<boolean: true>` |
| `muted=(string 'true')`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(string 'false')`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(string 'on')`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(string 'off')`| (changed, ssr mismatch)| `<boolean: true>` |
| `muted=(symbol)`| (initial, warning)| `<boolean: false>` |
| `muted=(function)`| (initial, warning)| `<boolean: false>` |
| `muted=(null)`| (initial)| `<boolean: false>` |
@@ -7148,31 +7148,6 @@
| `name=(null)`| (initial)| `<null>` |
| `name=(undefined)`| (initial)| `<null>` |
## `noModule` (on `<script>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `noModule=(string)`| (changed)| `<boolean: true>` |
| `noModule=(empty string)`| (initial)| `<boolean: false>` |
| `noModule=(array with string)`| (changed)| `<boolean: true>` |
| `noModule=(empty array)`| (changed)| `<boolean: true>` |
| `noModule=(object)`| (changed)| `<boolean: true>` |
| `noModule=(numeric string)`| (changed)| `<boolean: true>` |
| `noModule=(-1)`| (changed)| `<boolean: true>` |
| `noModule=(0)`| (initial)| `<boolean: false>` |
| `noModule=(integer)`| (changed)| `<boolean: true>` |
| `noModule=(NaN)`| (initial, warning)| `<boolean: false>` |
| `noModule=(float)`| (changed)| `<boolean: true>` |
| `noModule=(true)`| (changed)| `<boolean: true>` |
| `noModule=(false)`| (initial)| `<boolean: false>` |
| `noModule=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `noModule=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `noModule=(string 'on')`| (changed)| `<boolean: true>` |
| `noModule=(string 'off')`| (changed)| `<boolean: true>` |
| `noModule=(symbol)`| (initial, warning)| `<boolean: false>` |
| `noModule=(function)`| (initial, warning)| `<boolean: false>` |
| `noModule=(null)`| (initial)| `<boolean: false>` |
| `noModule=(undefined)`| (initial)| `<boolean: false>` |
## `nonce` (on `<div>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
@@ -7198,6 +7173,31 @@
| `nonce=(null)`| (initial)| `<null>` |
| `nonce=(undefined)`| (initial)| `<null>` |
## `noModule` (on `<script>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `noModule=(string)`| (changed)| `<boolean: true>` |
| `noModule=(empty string)`| (initial)| `<boolean: false>` |
| `noModule=(array with string)`| (changed)| `<boolean: true>` |
| `noModule=(empty array)`| (changed)| `<boolean: true>` |
| `noModule=(object)`| (changed)| `<boolean: true>` |
| `noModule=(numeric string)`| (changed)| `<boolean: true>` |
| `noModule=(-1)`| (changed)| `<boolean: true>` |
| `noModule=(0)`| (initial)| `<boolean: false>` |
| `noModule=(integer)`| (changed)| `<boolean: true>` |
| `noModule=(NaN)`| (initial, warning)| `<boolean: false>` |
| `noModule=(float)`| (changed)| `<boolean: true>` |
| `noModule=(true)`| (changed)| `<boolean: true>` |
| `noModule=(false)`| (initial)| `<boolean: false>` |
| `noModule=(string 'true')`| (changed)| `<boolean: true>` |
| `noModule=(string 'false')`| (changed)| `<boolean: true>` |
| `noModule=(string 'on')`| (changed)| `<boolean: true>` |
| `noModule=(string 'off')`| (changed)| `<boolean: true>` |
| `noModule=(symbol)`| (initial, warning)| `<boolean: false>` |
| `noModule=(function)`| (initial, warning)| `<boolean: false>` |
| `noModule=(null)`| (initial)| `<boolean: false>` |
| `noModule=(undefined)`| (initial)| `<boolean: false>` |
## `noValidate` (on `<form>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
@@ -7214,8 +7214,8 @@
| `noValidate=(float)`| (changed)| `<boolean: true>` |
| `noValidate=(true)`| (changed)| `<boolean: true>` |
| `noValidate=(false)`| (initial)| `<boolean: false>` |
| `noValidate=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `noValidate=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `noValidate=(string 'true')`| (changed)| `<boolean: true>` |
| `noValidate=(string 'false')`| (changed)| `<boolean: true>` |
| `noValidate=(string 'on')`| (changed)| `<boolean: true>` |
| `noValidate=(string 'off')`| (changed)| `<boolean: true>` |
| `noValidate=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -7464,8 +7464,8 @@
| `open=(float)`| (changed)| `<boolean: true>` |
| `open=(true)`| (changed)| `<boolean: true>` |
| `open=(false)`| (initial)| `<boolean: false>` |
| `open=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `open=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `open=(string 'true')`| (changed)| `<boolean: true>` |
| `open=(string 'false')`| (changed)| `<boolean: true>` |
| `open=(string 'on')`| (changed)| `<boolean: true>` |
| `open=(string 'off')`| (changed)| `<boolean: true>` |
| `open=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -8014,8 +8014,8 @@
| `playsInline=(float)`| (changed)| `<empty string>` |
| `playsInline=(true)`| (changed)| `<empty string>` |
| `playsInline=(false)`| (initial)| `<null>` |
| `playsInline=(string 'true')`| (changed, warning)| `<empty string>` |
| `playsInline=(string 'false')`| (changed, warning)| `<empty string>` |
| `playsInline=(string 'true')`| (changed)| `<empty string>` |
| `playsInline=(string 'false')`| (changed)| `<empty string>` |
| `playsInline=(string 'on')`| (changed)| `<empty string>` |
| `playsInline=(string 'off')`| (changed)| `<empty string>` |
| `playsInline=(symbol)`| (initial, warning)| `<null>` |
@@ -8227,26 +8227,26 @@
| Test Case | Flags | Result |
| --- | --- | --- |
| `preload=(string)`| (changed)| `"none"` |
| `preload=(empty string)`| (changed)| `"auto"` |
| `preload=(empty string)`| (initial)| `"auto"` |
| `preload=(array with string)`| (changed)| `"none"` |
| `preload=(empty array)`| (changed)| `"auto"` |
| `preload=(object)`| (initial)| `"metadata"` |
| `preload=(numeric string)`| (initial)| `"metadata"` |
| `preload=(-1)`| (initial)| `"metadata"` |
| `preload=(0)`| (initial)| `"metadata"` |
| `preload=(integer)`| (initial)| `"metadata"` |
| `preload=(NaN)`| (initial, warning)| `"metadata"` |
| `preload=(float)`| (initial)| `"metadata"` |
| `preload=(true)`| (initial, warning)| `"metadata"` |
| `preload=(false)`| (initial, warning)| `"metadata"` |
| `preload=(string 'true')`| (initial)| `"metadata"` |
| `preload=(string 'false')`| (initial)| `"metadata"` |
| `preload=(string 'on')`| (initial)| `"metadata"` |
| `preload=(string 'off')`| (initial)| `"metadata"` |
| `preload=(symbol)`| (initial, warning)| `"metadata"` |
| `preload=(function)`| (initial, warning)| `"metadata"` |
| `preload=(null)`| (initial)| `"metadata"` |
| `preload=(undefined)`| (initial)| `"metadata"` |
| `preload=(empty array)`| (initial)| `"auto"` |
| `preload=(object)`| (initial)| `"auto"` |
| `preload=(numeric string)`| (initial)| `"auto"` |
| `preload=(-1)`| (initial)| `"auto"` |
| `preload=(0)`| (initial)| `"auto"` |
| `preload=(integer)`| (initial)| `"auto"` |
| `preload=(NaN)`| (initial, warning)| `"auto"` |
| `preload=(float)`| (initial)| `"auto"` |
| `preload=(true)`| (initial, warning)| `"auto"` |
| `preload=(false)`| (initial, warning)| `"auto"` |
| `preload=(string 'true')`| (initial)| `"auto"` |
| `preload=(string 'false')`| (initial)| `"auto"` |
| `preload=(string 'on')`| (initial)| `"auto"` |
| `preload=(string 'off')`| (initial)| `"auto"` |
| `preload=(symbol)`| (initial, warning)| `"auto"` |
| `preload=(function)`| (initial, warning)| `"auto"` |
| `preload=(null)`| (initial)| `"auto"` |
| `preload=(undefined)`| (initial)| `"auto"` |
## `preserveAlpha` (on `<feConvolveMatrix>` inside `<svg>`)
| Test Case | Flags | Result |
@@ -8489,8 +8489,8 @@
| `readOnly=(float)`| (changed)| `<boolean: true>` |
| `readOnly=(true)`| (changed)| `<boolean: true>` |
| `readOnly=(false)`| (initial)| `<boolean: false>` |
| `readOnly=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `readOnly=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `readOnly=(string 'true')`| (changed)| `<boolean: true>` |
| `readOnly=(string 'false')`| (changed)| `<boolean: true>` |
| `readOnly=(string 'on')`| (changed)| `<boolean: true>` |
| `readOnly=(string 'off')`| (changed)| `<boolean: true>` |
| `readOnly=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -8714,8 +8714,8 @@
| `required=(float)`| (changed)| `<boolean: true>` |
| `required=(true)`| (changed)| `<boolean: true>` |
| `required=(false)`| (initial)| `<boolean: false>` |
| `required=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `required=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `required=(string 'true')`| (changed)| `<boolean: true>` |
| `required=(string 'false')`| (changed)| `<boolean: true>` |
| `required=(string 'on')`| (changed)| `<boolean: true>` |
| `required=(string 'off')`| (changed)| `<boolean: true>` |
| `required=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -8889,8 +8889,8 @@
| `reversed=(float)`| (changed)| `<boolean: true>` |
| `reversed=(true)`| (changed)| `<boolean: true>` |
| `reversed=(false)`| (initial)| `<boolean: false>` |
| `reversed=(string 'true')`| (changed, warning)| `<boolean: true>` |
| `reversed=(string 'false')`| (changed, warning)| `<boolean: true>` |
| `reversed=(string 'true')`| (changed)| `<boolean: true>` |
| `reversed=(string 'false')`| (changed)| `<boolean: true>` |
| `reversed=(string 'on')`| (changed)| `<boolean: true>` |
| `reversed=(string 'off')`| (changed)| `<boolean: true>` |
| `reversed=(symbol)`| (initial, warning)| `<boolean: false>` |
@@ -8983,7 +8983,7 @@
| `rowSpan=(object)`| (initial, ssr error, ssr mismatch)| `<number: 1>` |
| `rowSpan=(numeric string)`| (changed, ssr error, ssr mismatch)| `<number: 42>` |
| `rowSpan=(-1)`| (initial, ssr error, ssr mismatch)| `<number: 1>` |
| `rowSpan=(0)`| (changed, ssr error, ssr mismatch)| `<number: 0>` |
| `rowSpan=(0)`| (initial, ssr error, ssr mismatch)| `<number: 1>` |
| `rowSpan=(integer)`| (initial, ssr error, ssr mismatch)| `<number: 1>` |
| `rowSpan=(NaN)`| (initial, warning, ssr error, ssr mismatch)| `<number: 1>` |
| `rowSpan=(float)`| (changed, ssr error, ssr mismatch)| `<number: 99>` |
@@ -9139,8 +9139,8 @@
| `scoped=(float)`| (changed)| `<empty string>` |
| `scoped=(true)`| (changed)| `<empty string>` |
| `scoped=(false)`| (initial)| `<null>` |
| `scoped=(string 'true')`| (changed, warning)| `<empty string>` |
| `scoped=(string 'false')`| (changed, warning)| `<empty string>` |
| `scoped=(string 'true')`| (changed)| `<empty string>` |
| `scoped=(string 'false')`| (changed)| `<empty string>` |
| `scoped=(string 'on')`| (changed)| `<empty string>` |
| `scoped=(string 'off')`| (changed)| `<empty string>` |
| `scoped=(symbol)`| (initial, warning)| `<null>` |
@@ -9189,8 +9189,8 @@
| `seamless=(float)`| (changed)| `<empty string>` |
| `seamless=(true)`| (changed)| `<empty string>` |
| `seamless=(false)`| (initial)| `<null>` |
| `seamless=(string 'true')`| (changed, warning)| `<empty string>` |
| `seamless=(string 'false')`| (changed, warning)| `<empty string>` |
| `seamless=(string 'true')`| (changed)| `<empty string>` |
| `seamless=(string 'false')`| (changed)| `<empty string>` |
| `seamless=(string 'on')`| (changed)| `<empty string>` |
| `seamless=(string 'off')`| (changed)| `<empty string>` |
| `seamless=(symbol)`| (initial, warning)| `<null>` |
@@ -9264,8 +9264,8 @@
| `selected=(float)`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(true)`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(false)`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(string 'true')`| (initial, warning)| `<boolean: true>` |
| `selected=(string 'false')`| (initial, warning)| `<boolean: true>` |
| `selected=(string 'true')`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(string 'false')`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(string 'on')`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(string 'off')`| (initial, warning, ssr warning)| `<boolean: true>` |
| `selected=(symbol)`| (initial, warning)| `<boolean: true>` |
@@ -11868,8 +11868,8 @@
| `value=(string 'false')`| (changed)| `"false"` |
| `value=(string 'on')`| (changed)| `"on"` |
| `value=(string 'off')`| (changed)| `"off"` |
| `value=(symbol)`| (initial, warning, ssr error, ssr mismatch)| `<empty string>` |
| `value=(function)`| (initial, warning, ssr mismatch)| `<empty string>` |
| `value=(symbol)`| (changed, error, warning, ssr error)| `` |
| `value=(function)`| (changed, warning, ssr warning)| `"function f() {}"` |
| `value=(null)`| (initial, warning, ssr warning)| `<empty string>` |
| `value=(undefined)`| (initial)| `<empty string>` |
@@ -11893,8 +11893,8 @@
| `value=(string 'false')`| (changed)| `"false"` |
| `value=(string 'on')`| (changed)| `"on"` |
| `value=(string 'off')`| (changed)| `"off"` |
| `value=(symbol)`| (initial, warning)| `<empty string>` |
| `value=(function)`| (initial, warning)| `<empty string>` |
| `value=(symbol)`| (changed, error, warning, ssr mismatch)| `` |
| `value=(function)`| (changed, warning, ssr mismatch)| `"function f() {}"` |
| `value=(null)`| (initial)| `<empty string>` |
| `value=(undefined)`| (initial)| `<empty string>` |

View File

@@ -10,7 +10,6 @@ coverage
build
public/react.development.js
public/react-dom.development.js
public/react-dom-server.browser.development.js
# misc
.DS_Store

View File

@@ -6,19 +6,17 @@
"react-scripts": "^1.0.11"
},
"dependencies": {
"@babel/standalone": "^7.0.0",
"classnames": "^2.2.5",
"codemirror": "^5.40.0",
"core-js": "^2.4.1",
"prop-types": "^15.6.0",
"query-string": "^4.2.3",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"semver": "^5.5.0"
"semver": "^5.3.0"
},
"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/dist/react.development.js public/ && cp ../../build/dist/react-dom.development.js public/",
"build": "react-scripts build && cp build/index.html build/200.html",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"

View File

@@ -1,86 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Renderer</title>
<style>
*,
*:before,
*:after {
box-sizing: border-box;
}
html,
body {
font-family: sans-serif;
margin: 0;
height: 100%;
}
body {
padding-top: 32px;
}
#status {
font-size: 12px;
left: 8px;
letter-spacing: 0.05em;
line-height: 16px;
margin: -8px 0 0;
max-width: 50%;
overflow: hidden;
position: absolute;
text-align: left;
text-overflow: ellipsis;
top: 50%;
white-space: nowrap;
width: 100%;
}
#output {
margin: 16px;
}
.header {
background: white;
border-bottom: 1px solid #d9d9d9;
padding: 4px;
top: 0;
left: 0;
position: fixed;
width: 100%;
text-align: right;
}
.controls {
display: inline-block;
margin: 0;
}
.button {
background: #eee;
border-radius: 2px;
border: 1px solid #aaa;
font-size: 11px;
padding: 4px 6px;
text-transform: uppercase;
}
</style>
</head>
<body>
<header class="header">
<p id="status">Loading</p>
<menu class="controls">
<button class="button" id="hydrate">Hydrate</button>
<button class="button" id="reload">Reload</button>
</menu>
</header>
<div id="output"></div>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="renderer.js"></script>
</body>
</html>

View File

@@ -1,141 +0,0 @@
/**
* Supports render.html, a piece of the hydration fixture. See /hydration
*/
'use strict';
(function() {
var Fixture = null;
var output = document.getElementById('output');
var status = document.getElementById('status');
var hydrate = document.getElementById('hydrate');
var reload = document.getElementById('reload');
var renders = 0;
var failed = false;
function getQueryParam(key) {
var pattern = new RegExp(key + '=([^&]+)(&|$)');
var matches = window.location.search.match(pattern);
if (matches) {
return decodeURIComponent(matches[1]);
}
handleError(new Error('No key found for' + key));
}
function getBooleanQueryParam(key) {
return getQueryParam(key) === 'true';
}
function setStatus(label) {
status.innerHTML = label;
}
function prerender() {
setStatus('Generating markup');
output.innerHTML = ReactDOMServer.renderToString(
React.createElement(Fixture)
);
setStatus('Markup only (No React)');
}
function render() {
setStatus('Hydrating');
if (ReactDOM.hydrate) {
ReactDOM.hydrate(React.createElement(Fixture), output);
} else {
ReactDOM.render(React.createElement(Fixture), output);
}
setStatus(renders > 0 ? 'Re-rendered (' + renders + 'x)' : 'Hydrated');
renders += 1;
hydrate.innerHTML = 'Re-render';
}
function handleError(error) {
console.log(error);
failed = true;
setStatus('Javascript Error');
output.innerHTML = error;
}
function loadScript(src) {
return new Promise(function(resolve, reject) {
var script = document.createElement('script');
script.async = true;
script.src = src;
script.onload = resolve;
script.onerror = function(error) {
reject(new Error('Unable to load ' + src));
};
document.body.appendChild(script);
});
}
function injectFixture(src) {
Fixture = new Function(src + '\nreturn Fixture;')();
if (typeof Fixture === 'undefined') {
setStatus('Failed');
output.innerHTML = 'Please name your root component "Fixture"';
} else {
prerender();
if (getBooleanQueryParam('hydrate')) {
render();
}
}
}
function reloadFixture(code) {
renders = 0;
ReactDOM.unmountComponentAtNode(output);
injectFixture(code);
}
window.onerror = handleError;
reload.onclick = function() {
window.location.reload();
};
hydrate.onclick = render;
loadScript(getQueryParam('reactPath'))
.then(function() {
return getBooleanQueryParam('needsReactDOM')
? loadScript(getQueryParam('reactDOMPath'))
: null;
})
.then(function() {
return loadScript(getQueryParam('reactDOMServerPath'));
})
.then(function() {
if (failed) {
return;
}
window.addEventListener('message', function(event) {
var data = JSON.parse(event.data);
switch (data.type) {
case 'code':
reloadFixture(data.payload);
break;
default:
throw new Error(
'Renderer Error: Unrecognized message "' + data.type + '"'
);
}
});
window.parent.postMessage(JSON.stringify({type: 'ready'}), '*');
})
.catch(handleError);
})();

View File

@@ -8,7 +8,9 @@ function App() {
return (
<div>
<Header />
<Fixtures />
<div className="container">
<Fixtures />
</div>
</div>
);
}

View File

@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
const PropTypes = window.PropTypes;
const React = window.React;
const propTypes = {

View File

@@ -3,7 +3,7 @@ const React = window.React;
const propTypes = {
title: PropTypes.node.isRequired,
description: PropTypes.node,
description: PropTypes.node.isRequired,
};
class FixtureSet extends React.Component {
@@ -11,7 +11,7 @@ class FixtureSet extends React.Component {
const {title, description, children} = this.props;
return (
<div className="container">
<div>
<h1>{title}</h1>
{description && <p>{description}</p>}

View File

@@ -35,11 +35,11 @@ class Header extends React.Component {
<span className="header__logo">
<img
src={process.env.PUBLIC_URL + '/react-logo.svg'}
alt="React"
width="20"
height="20"
alt=""
width="32"
height="32"
/>
<a href="/">DOM Test Fixtures (v{React.version})</a>
React Sandbox (v{React.version})
</span>
<div className="header-controls">
@@ -48,8 +48,7 @@ class Header extends React.Component {
<select
value={window.location.pathname}
onChange={this.handleFixtureChange}>
<option value="/">Home</option>
<option value="/hydration">Hydration</option>
<option value="/">Select a Fixture</option>
<option value="/range-inputs">Range Inputs</option>
<option value="/text-inputs">Text Inputs</option>
<option value="/number-inputs">Number Input</option>
@@ -67,8 +66,6 @@ class Header extends React.Component {
<option value="/media-events">Media Events</option>
<option value="/pointer-events">Pointer Events</option>
<option value="/mouse-events">Mouse Events</option>
<option value="/selection-events">Selection Events</option>
<option value="/suspense">Suspense</option>
</select>
</label>
<label htmlFor="react_version">

View File

@@ -1,58 +0,0 @@
const React = window.React;
const ReactDOM = window.ReactDOM;
class IframePortal extends React.Component {
iframeRef = null;
handleRef = ref => {
if (ref !== this.iframeRef) {
this.iframeRef = ref;
if (ref) {
if (ref.contentDocument && this.props.head) {
ref.contentDocument.head.innerHTML = this.props.head;
}
// Re-render must take place in the next tick (Firefox)
setTimeout(() => {
this.forceUpdate();
});
}
}
};
render() {
const ref = this.iframeRef;
let portal = null;
if (ref && ref.contentDocument) {
portal = ReactDOM.createPortal(
this.props.children,
ref.contentDocument.body
);
}
return (
<div>
<iframe
title="Iframe portal"
style={{border: 'none', height: this.props.height}}
ref={this.handleRef}
/>
{portal}
</div>
);
}
}
class IframeSubtree extends React.Component {
warned = false;
render() {
if (!this.warned) {
console.error(
`IFrame has not yet been implemented for React v${React.version}`
);
this.warned = true;
}
return <div>{this.props.children}</div>;
}
}
export default (ReactDOM.createPortal ? IframePortal : IframeSubtree);

View File

@@ -10,7 +10,7 @@ function onButtonClick() {
export default class ButtonTestCases extends React.Component {
render() {
return (
<FixtureSet title="Buttons">
<FixtureSet title="Buttons" description="">
<TestCase
title="onClick with disabled buttons"
description="The onClick event handler should not be invoked when clicking on a disabled buyaton">

View File

@@ -8,7 +8,7 @@ const React = window.React;
class DateInputFixtures extends React.Component {
render() {
return (
<FixtureSet title="Dates">
<FixtureSet title="Dates" description="">
<TestCase title="Switching between date and datetime-local">
<TestCase.Steps>
<li>Type a date into the date picker</li>

View File

@@ -7,21 +7,9 @@ const ReactDOM = window.ReactDOM;
function BadRender(props) {
props.doThrow();
}
class BadDidMount extends React.Component {
componentDidMount() {
this.props.doThrow();
}
render() {
return null;
}
}
class ErrorBoundary extends React.Component {
static defaultProps = {
buttonText: 'Trigger error',
badChildType: BadRender,
};
state = {
shouldThrow: false,
@@ -45,8 +33,7 @@ class ErrorBoundary extends React.Component {
}
}
if (this.state.shouldThrow) {
const BadChild = this.props.badChildType;
return <BadChild doThrow={this.props.doThrow} />;
return <BadRender doThrow={this.props.doThrow} />;
}
return <button onClick={this.triggerError}>{this.props.buttonText}</button>;
}
@@ -97,154 +84,10 @@ class TriggerErrorAndCatch extends React.Component {
}
}
function silenceWindowError(event) {
event.preventDefault();
}
class SilenceErrors extends React.Component {
state = {
silenceErrors: false,
};
componentDidMount() {
if (this.state.silenceErrors) {
window.addEventListener('error', silenceWindowError);
}
}
componentDidUpdate(prevProps, prevState) {
if (!prevState.silenceErrors && this.state.silenceErrors) {
window.addEventListener('error', silenceWindowError);
} else if (prevState.silenceErrors && !this.state.silenceErrors) {
window.removeEventListener('error', silenceWindowError);
}
}
componentWillUnmount() {
if (this.state.silenceErrors) {
window.removeEventListener('error', silenceWindowError);
}
}
render() {
return (
<div>
<label>
<input
type="checkbox"
value={this.state.silenceErrors}
onChange={() =>
this.setState(state => ({
silenceErrors: !state.silenceErrors,
}))
}
/>
Silence errors
</label>
{this.state.silenceErrors && (
<div>
{this.props.children}
<br />
<hr />
<b style={{color: 'red'}}>
Don't forget to uncheck "Silence errors" when you're done with
this test!
</b>
</div>
)}
</div>
);
}
}
class GetEventTypeDuringUpdate extends React.Component {
state = {};
onClick = () => {
this.expectUpdate = true;
this.forceUpdate();
};
componentDidUpdate() {
if (this.expectUpdate) {
this.expectUpdate = false;
this.setState({eventType: window.event.type});
setTimeout(() => {
this.setState({cleared: !window.event});
});
}
}
render() {
return (
<div className="test-fixture">
<button onClick={this.onClick}>Trigger callback in event.</button>
{this.state.eventType ? (
<p>
Got <b>{this.state.eventType}</b> event.
</p>
) : (
<p>Got no event</p>
)}
{this.state.cleared ? (
<p>Event cleared correctly.</p>
) : (
<p>Event failed to clear.</p>
)}
</div>
);
}
}
class SilenceRecoverableError extends React.Component {
render() {
return (
<SilenceErrors>
<ErrorBoundary
badChildType={BadRender}
buttonText={'Throw (render phase)'}
doThrow={() => {
throw new Error('Silenced error (render phase)');
}}
/>
<ErrorBoundary
badChildType={BadDidMount}
buttonText={'Throw (commit phase)'}
doThrow={() => {
throw new Error('Silenced error (commit phase)');
}}
/>
</SilenceErrors>
);
}
}
class TrySilenceFatalError extends React.Component {
container = document.createElement('div');
triggerErrorAndCatch = () => {
try {
ReactDOM.flushSync(() => {
ReactDOM.render(
<BadRender
doThrow={() => {
throw new Error('Caught error');
}}
/>,
this.container
);
});
} catch (e) {}
};
render() {
return (
<SilenceErrors>
<button onClick={this.triggerErrorAndCatch}>Throw fatal error</button>
</SilenceErrors>
);
}
}
export default class ErrorHandlingTestCases extends React.Component {
render() {
return (
<FixtureSet title="Error handling">
<FixtureSet title="Error handling" description="">
<TestCase
title="Break on uncaught exceptions"
description="In DEV, errors should be treated as uncaught, even though React catches them internally">
@@ -260,12 +103,6 @@ export default class ErrorHandlingTestCases extends React.Component {
the BadRender component. After resuming, the "Trigger error" button
should be replaced with "Captured an error: Oops!" Clicking reset
should reset the test case.
<br />
<br />
In the console, you should see <b>two</b> messages: the actual error
("Oops") printed natively by the browser with its JavaScript stack,
and our addendum ("The above error occurred in BadRender component")
with a React component stack.
</TestCase.ExpectedResult>
<Example
doThrow={() => {
@@ -318,59 +155,10 @@ export default class ErrorHandlingTestCases extends React.Component {
</TestCase.Steps>
<TestCase.ExpectedResult>
Open the console. "Uncaught Error: Caught error" should have been
logged by the browser. You should also see our addendum ("The above
error...").
logged by the browser.
</TestCase.ExpectedResult>
<TriggerErrorAndCatch />
</TestCase>
<TestCase
title="Recoverable errors can be silenced with preventDefault (development mode only)"
description="">
<TestCase.Steps>
<li>Check the "Silence errors" checkbox below</li>
<li>Click the "Throw (render phase)" button</li>
<li>Click the "Throw (commit phase)" button</li>
<li>Uncheck the "Silence errors" checkbox</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
Open the console. You shouldn't see <b>any</b> messages in the
console: neither the browser error, nor our "The above error"
addendum, from either of the buttons. The buttons themselves should
get replaced by two labels: "Captured an error: Silenced error
(render phase)" and "Captured an error: Silenced error (commit
phase)".
</TestCase.ExpectedResult>
<SilenceRecoverableError />
</TestCase>
<TestCase
title="Fatal errors cannot be silenced with preventDefault (development mode only)"
description="">
<TestCase.Steps>
<li>Check the "Silence errors" checkbox below</li>
<li>Click the "Throw fatal error" button</li>
<li>Uncheck the "Silence errors" checkbox</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
Open the console. "Error: Caught error" should have been logged by
React. You should also see our addendum ("The above error...").
</TestCase.ExpectedResult>
<TrySilenceFatalError />
</TestCase>
{window.hasOwnProperty('event') ? (
<TestCase
title="Error handling does not interfere with window.event"
description="">
<TestCase.Steps>
<li>Click the "Trigger callback in event" button</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
You should see "Got <b>click</b> event" and "Event cleared
successfully" below.
</TestCase.ExpectedResult>
<GetEventTypeDuringUpdate />
</TestCase>
) : null}
</FixtureSet>
);
}

View File

@@ -7,7 +7,7 @@ const React = window.React;
class EventPooling extends React.Component {
render() {
return (
<FixtureSet title="Event Pooling">
<FixtureSet title="Event Pooling" description="">
<MouseMove />
<Persistence />
</FixtureSet>

View File

@@ -1,117 +0,0 @@
const React = window.React;
export default function Home() {
return (
<main className="container">
<h1>DOM Test Fixtures</h1>
<p>
Use this site to test browser quirks and other behavior that can not be
captured through unit tests.
</p>
<section>
<h2>Tested Browsers</h2>
<table>
<thead>
<tr>
<th>Browser</th>
<th>Versions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chrome - Desktop</td>
<td>
49<sup>*</sup>, Latest
</td>
</tr>
<tr>
<td>Chrome - Android</td>
<td>Latest</td>
</tr>
<tr>
<td>Firefox Desktop</td>
<td>
<a href="https://www.mozilla.org/en-US/firefox/organizations/">
ESR<sup></sup>
</a>, Latest
</td>
</tr>
<tr>
<td>Internet Explorer</td>
<td>9, 10, 11</td>
</tr>
<tr>
<td>Microsoft Edge</td>
<td>14, Latest</td>
</tr>
<tr>
<td>Safari - Desktop</td>
<td>7, Latest</td>
</tr>
<tr>
<td>Safari - iOS</td>
<td>7, Latest</td>
</tr>
</tbody>
</table>
<footer>
<small>* Chrome 49 is the last release for Windows XP.</small>
<br />
<small>
Firefox Extended Support Release (ESR) is used by many
institutions.
</small>
</footer>
</section>
<section>
<h2>How do I test browsers I don't have access to?</h2>
<p>
Getting test coverage across all of these browsers can be difficult,
particularly for older versions of evergreen browsers. Fortunately
there are a handful of tools that make browser testing easy.
</p>
<section>
<h3>Paid services</h3>
<ul>
<li>
<a href="https://browserstack.com">BrowserStack</a>
</li>
<li>
<a href="https://saucelabs.com">Sauce Labs</a>
</li>
<li>
<a href="https://crossbrowsertesting.com/">CrossBrowserTesting</a>
</li>
</ul>
<p>
These services provide access to all browsers we test, however they
cost money. There is no obligation to pay for them. Maintainers have
access to a BrowserStack subscription; feel free to contact a
maintainer or mention browsers where extra testing is required.
</p>
</section>
<section>
<h3>Browser downloads</h3>
<p>A handful of browsers are available for download directly:</p>
<ul>
<li>
<a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/">
Internet Explorer (9-11) and MS Edge virtual machines
</a>
</li>
<li>
<a href="https://www.chromium.org/getting-involved/download-chromium#TOC-Downloading-old-builds-of-Chrome-Chromium">
Chromium snapshots (for older versions of Chrome)
</a>
</li>
<li>
<a href="https://www.mozilla.org/en-US/firefox/organizations/">
Firefox Extended Support Release (ESR)
</a>
</li>
</ul>
</section>
</section>
</main>
);
}

View File

@@ -1,85 +0,0 @@
const React = window.React;
export class CodeEditor extends React.Component {
shouldComponentUpdate() {
return false;
}
componentDidMount() {
// Important: CodeMirror incorrectly lays out the editor
// if it executes before CSS has loaded
// https://github.com/graphql/graphiql/issues/33#issuecomment-318188555
Promise.all([
import('codemirror'),
import('codemirror/mode/jsx/jsx'),
import('codemirror/lib/codemirror.css'),
import('./codemirror-paraiso-dark.css'),
]).then(([CodeMirror]) => this.install(CodeMirror));
}
install(CodeMirror) {
if (!this.textarea) {
return;
}
const {onChange} = this.props;
this.editor = CodeMirror.fromTextArea(this.textarea, {
mode: 'jsx',
theme: 'paraiso-dark',
lineNumbers: true,
});
this.editor.on('change', function(doc) {
onChange(doc.getValue());
});
}
componentWillUnmount() {
if (this.editor) {
this.editor.toTextArea();
}
}
render() {
return (
<textarea
ref={ref => (this.textarea = ref)}
defaultValue={this.props.code}
autoComplete="off"
hidden={true}
/>
);
}
}
/**
* Prevent IE9 from raising an error on an unrecognized element:
* See https://github.com/facebook/react/issues/13610
*/
const supportsDetails = !(
document.createElement('details') instanceof HTMLUnknownElement
);
export class CodeError extends React.Component {
render() {
const {error, className} = this.props;
if (!error) {
return null;
}
if (supportsDetails) {
const [summary, ...body] = error.message.split(/\n+/g);
return (
<details className={className}>
<summary>{summary}</summary>
{body.join('\n')}
</details>
);
}
return <div className={className}>{error.message}</div>;
}
}

View File

@@ -1,18 +0,0 @@
/**
* Babel works across all browsers, however it requires many polyfills.
*/
import 'core-js/es6/weak-map';
import 'core-js/es6/weak-set';
import 'core-js/es6/number';
import 'core-js/es6/string';
import 'core-js/es6/array';
import 'core-js/modules/es6.object.set-prototype-of';
import {transform} from '@babel/standalone';
const presets = ['es2015', 'stage-3', 'react'];
export function compile(raw) {
return transform(raw, {presets}).code;
}

View File

@@ -1,38 +0,0 @@
/**
* Name: Paraíso (Dark)
* Author: Jan T. Sott
* License: Creative Commons Attribution-ShareAlike 4.0 Unported License.
* https://creativecommons.org/licenses/by-sa/4.0/deed.en_US
*
* Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)
* Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
*/
.cm-s-paraiso-dark.CodeMirror { background: #2f1e2e; color: #b9b6b0; }
.cm-s-paraiso-dark div.CodeMirror-selected { background: #41323f; }
.cm-s-paraiso-dark .CodeMirror-line::selection, .cm-s-paraiso-dark .CodeMirror-line > span::selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::selection { background: rgba(65, 50, 63, .99); }
.cm-s-paraiso-dark .CodeMirror-line::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(65, 50, 63, .99); }
.cm-s-paraiso-dark .CodeMirror-gutters { background: #2f1e2e; border-right: 0px; }
.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; }
.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; }
.cm-s-paraiso-dark .CodeMirror-linenumber { color: #776e71; }
.cm-s-paraiso-dark .CodeMirror-cursor { border-left: 1px solid #8d8687; }
.cm-s-paraiso-dark span.cm-comment { color: #e96ba8; }
.cm-s-paraiso-dark span.cm-atom { color: #815ba4; }
.cm-s-paraiso-dark span.cm-number { color: #815ba4; }
.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute { color: #48b685; }
.cm-s-paraiso-dark span.cm-keyword { color: #ef6155; }
.cm-s-paraiso-dark span.cm-string { color: #fec418; }
.cm-s-paraiso-dark span.cm-variable { color: #48b685; }
.cm-s-paraiso-dark span.cm-variable-2 { color: #06b6ef; }
.cm-s-paraiso-dark span.cm-def { color: #f99b15; }
.cm-s-paraiso-dark span.cm-bracket { color: #b9b6b0; }
.cm-s-paraiso-dark span.cm-tag { color: #ef6155; }
.cm-s-paraiso-dark span.cm-link { color: #815ba4; }
.cm-s-paraiso-dark span.cm-error { background: #ef6155; color: #8d8687; }
.cm-s-paraiso-dark .CodeMirror-activeline-background { background: #4D344A; }
.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }

View File

@@ -1,22 +0,0 @@
export const SAMPLE_CODE = `
class Fixture extends React.Component {
state = {
value: 'asdf'
}
onChange(event) {
this.setState({ value: event.target.value });
}
render() {
const { value } = this.state;
return (
<form>
<input value={value} onChange={this.onChange.bind(this)} />
<p>Value: {value}</p>
</form>
);
}
}
`.trim();

View File

@@ -1,68 +0,0 @@
.hydration {
background: #2f1e2e;
margin: 0;
position: relative;
height: calc(100vh - 40px); /* height of header */
overflow: auto;
padding-top: 32px;
}
.hydration-options {
background: #171717;
border-top: 1px dashed rgba(215, 235, 255, 0.12);
color: #def5ff;
height: 32px;
line-height: 28px;
padding: 0 8px;
width: 100%;
position: absolute;
top: 0;
left: 0;
}
.hydration-options label {
font-size: 13px;
}
.hydration-options input[type=checkbox] {
display: inline-block;
margin-right: 4px;
vertical-align: middle;
}
.hydration .CodeMirror {
font-size: 13px;
padding-top: 8px;
padding-bottom: 68px;
height: calc(100vh - 72px);
width: 55%;
}
.hydration-sandbox {
background: white;
border-radius: 2px;
border: 0;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.54);
height: calc(100% - 34px);
position: absolute;
right: 16px;
top: 16px;
width: calc(45% - 24px);
}
.hydration-code-error {
background: #df3f3f;
border-radius: 2px;
bottom: 18px;
color: white;
font-family: monospace;
font-size: 13px;
left: 16px;
line-height: 1.25;
overflow: auto;
padding: 12px;
position: fixed;
white-space: pre;
max-width: calc(55% - 26px);
z-index: 10;
}

View File

@@ -1,109 +0,0 @@
import './hydration.css';
import {SAMPLE_CODE} from './data';
import {CodeEditor, CodeError} from './Code';
import {compile} from './code-transformer';
import {reactPaths} from '../../../react-loader';
import qs from 'query-string';
const React = window.React;
class Hydration extends React.Component {
state = {
error: null,
code: SAMPLE_CODE,
hydrate: true,
};
ready = false;
componentDidMount() {
window.addEventListener('message', this.handleMessage);
}
componentWillUnmount() {
window.removeEventListener('message', this.handleMessage);
}
handleMessage = event => {
var data = JSON.parse(event.data);
switch (data.type) {
case 'ready':
this.ready = true;
this.injectCode();
break;
default:
throw new Error(
'Editor Error: Unrecognized message "' + data.type + '"'
);
}
};
injectCode = () => {
try {
this.send({
type: 'code',
payload: compile(this.state.code),
});
this.setState({error: null});
} catch (error) {
this.setState({error});
}
};
send = message => {
if (this.ready) {
this.frame.contentWindow.postMessage(JSON.stringify(message), '*');
}
};
setFrame = frame => {
this.frame = frame;
};
setCode = code => {
this.setState({code}, this.injectCode);
};
setCheckbox = event => {
this.setState({
[event.target.name]: event.target.checked,
});
};
render() {
const {code, error, hydrate} = this.state;
const src = '/renderer.html?' + qs.stringify({hydrate, ...reactPaths()});
return (
<div className="hydration">
<header className="hydration-options">
<label htmlFor="hydrate">
<input
id="hydrate"
name="hydrate"
type="checkbox"
checked={hydrate}
onChange={this.setCheckbox}
/>
Auto-Hydrate
</label>
</header>
<CodeEditor code={code} onChange={this.setCode} />
<CodeError error={error} className="hydration-code-error" />
<iframe
ref={this.setFrame}
className="hydration-sandbox"
title="Hydration Preview"
src={src}
/>
</div>
);
}
}
export default Hydration;

View File

@@ -1,62 +1,60 @@
import RangeInputFixtures from './range-inputs';
import TextInputFixtures from './text-inputs';
import SelectFixtures from './selects';
import TextAreaFixtures from './textareas';
import InputChangeEvents from './input-change-events';
import NumberInputFixtures from './number-inputs';
import PasswordInputFixtures from './password-inputs';
import ButtonFixtures from './buttons';
import DateInputFixtures from './date-inputs';
import ErrorHandling from './error-handling';
import EventPooling from './event-pooling';
import CustomElementFixtures from './custom-elements';
import MediaEventsFixtures from './media-events';
import PointerEventsFixtures from './pointer-events';
import MouseEventsFixtures from './mouse-events';
const React = window.React;
const fixturePath = window.location.pathname;
/**
* A simple routing component that renders the appropriate
* fixture based on the location pathname.
*/
class FixturesPage extends React.Component {
static defaultProps = {
fixturePath: fixturePath === '/' ? '/home' : fixturePath,
};
state = {
isLoading: true,
error: null,
Fixture: null,
};
componentDidMount() {
this.loadFixture();
function FixturesPage() {
switch (window.location.pathname) {
case '/text-inputs':
return <TextInputFixtures />;
case '/range-inputs':
return <RangeInputFixtures />;
case '/selects':
return <SelectFixtures />;
case '/textareas':
return <TextAreaFixtures />;
case '/input-change-events':
return <InputChangeEvents />;
case '/number-inputs':
return <NumberInputFixtures />;
case '/password-inputs':
return <PasswordInputFixtures />;
case '/buttons':
return <ButtonFixtures />;
case '/date-inputs':
return <DateInputFixtures />;
case '/error-handling':
return <ErrorHandling />;
case '/event-pooling':
return <EventPooling />;
case '/custom-elements':
return <CustomElementFixtures />;
case '/media-events':
return <MediaEventsFixtures />;
case '/pointer-events':
return <PointerEventsFixtures />;
case '/mouse-events':
return <MouseEventsFixtures />;
default:
return <p>Please select a test fixture.</p>;
}
async loadFixture() {
const {fixturePath} = this.props;
try {
const module = await import(`.${fixturePath}`);
this.setState({Fixture: module.default});
} catch (error) {
console.error(error);
this.setState({error});
} finally {
this.setState({isLoading: false});
}
}
render() {
const {Fixture, error, isLoading} = this.state;
if (isLoading) {
return null;
}
if (error) {
return <FixtureError error={error} />;
}
return <Fixture />;
}
}
function FixtureError({error}) {
return (
<section>
<h2>Error loading fixture</h2>
<p>{error.message}</p>
</section>
);
}
export default FixturesPage;

View File

@@ -60,7 +60,7 @@ export default class MediaEvents extends React.Component {
}, {});
return (
<FixtureSet title="Media Events">
<FixtureSet title="Media Events" description="">
<TestCase
title="Event bubbling"
description="Media events should synthetically bubble">

View File

@@ -6,7 +6,7 @@ const React = window.React;
class MouseEvents extends React.Component {
render() {
return (
<FixtureSet title="Mouse Events">
<FixtureSet title="Mouse Events" description="">
<MouseMovement />
</FixtureSet>
);

View File

@@ -6,7 +6,7 @@ const React = window.React;
function NumberInputs() {
return (
<FixtureSet title="Password inputs">
<FixtureSet title="Password inputs" description="">
<TestCase
title="The show password icon"
description={`

View File

@@ -1,5 +1,3 @@
import FixtureSet from '../../FixtureSet';
const React = window.React;
class RangeInputs extends React.Component {
@@ -9,26 +7,22 @@ class RangeInputs extends React.Component {
};
render() {
return (
<FixtureSet
title="Range Inputs"
description="Note: Range inputs are not supported in IE9.">
<form>
<fieldset>
<legend>Controlled</legend>
<input
type="range"
value={this.state.value}
onChange={this.onChange}
/>
<span className="hint">Value: {this.state.value}</span>
</fieldset>
<form>
<fieldset>
<legend>Controlled</legend>
<input
type="range"
value={this.state.value}
onChange={this.onChange}
/>
<span className="hint">Value: {this.state.value}</span>
</fieldset>
<fieldset>
<legend>Uncontrolled</legend>
<input type="range" defaultValue={0.5} />
</fieldset>
</form>
</FixtureSet>
<fieldset>
<legend>Uncontrolled</legend>
<input type="range" defaultValue={0.5} />
</fieldset>
</form>
);
}
}

View File

@@ -1,50 +0,0 @@
import TestCase from '../../TestCase';
import Iframe from '../../Iframe';
const React = window.React;
class OnSelectIframe extends React.Component {
state = {count: 0, value: 'Select Me!'};
_onSelect = event => {
this.setState(({count}) => ({count: count + 1}));
};
_onChange = event => {
this.setState({value: event.target.value});
};
render() {
const {count, value} = this.state;
return (
<Iframe height={60}>
Selection Event Count: {count}
<input
type="text"
onSelect={this._onSelect}
value={value}
onChange={this._onChange}
/>
</Iframe>
);
}
}
export default class OnSelectEventTestCase extends React.Component {
render() {
return (
<TestCase
title="onSelect events within iframes"
description="onSelect events should fire for elements rendered inside iframes">
<TestCase.Steps>
<li>Highlight some of the text in the input below</li>
<li>Move the cursor around using the arrow keys</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The displayed count should increase as you highlight or move the
cursor
</TestCase.ExpectedResult>
<OnSelectIframe />
</TestCase>
);
}
}

View File

@@ -1,44 +0,0 @@
import TestCase from '../../TestCase';
import Iframe from '../../Iframe';
const React = window.React;
export default class ReorderedInputsTestCase extends React.Component {
state = {count: 0};
componentDidMount() {
this.interval = setInterval(() => {
this.setState({count: this.state.count + 1});
}, 2000);
}
componentWillUnmount() {
clearInterval(this.interval);
}
renderInputs() {
const inputs = [
<input key={1} defaultValue="Foo" />,
<input key={2} defaultValue="Bar" />,
];
if (this.state.count % 2 === 0) {
inputs.reverse();
}
return inputs;
}
render() {
return (
<TestCase title="Reordered input elements in iframes" description="">
<TestCase.Steps>
<li>The two inputs below swap positions every two seconds</li>
<li>Select the text in either of them</li>
<li>Wait for the swap to occur</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The selection you made should be maintained
</TestCase.ExpectedResult>
<Iframe height={50}>{this.renderInputs()}</Iframe>
</TestCase>
);
}
}

View File

@@ -1,19 +0,0 @@
import FixtureSet from '../../FixtureSet';
import ReorderedInputsTestCase from './ReorderedInputsTestCase';
import OnSelectEventTestCase from './OnSelectEventTestCase';
const React = window.React;
export default function SelectionEvents() {
return (
<FixtureSet
title="Selection Restoration"
description="
When React commits changes it may perform operations which cause existing
selection state to be lost. This is manually managed by reading the
selection state before commits and then restoring it afterwards.
">
<ReorderedInputsTestCase />
<OnSelectEventTestCase />
</FixtureSet>
);
}

View File

@@ -46,7 +46,7 @@ class SelectFixture extends React.Component {
render() {
return (
<FixtureSet title="Selects">
<FixtureSet title="Selects" description="">
<form className="field-group">
<fieldset>
<legend>Controlled</legend>
@@ -159,25 +159,6 @@ class SelectFixture extends React.Component {
</div>
</TestCase>
<TestCase title="A multiple select being scrolled to first selected option">
<TestCase.ExpectedResult>
First selected option should be visible
</TestCase.ExpectedResult>
<div className="test-fixture">
<form>
<select multiple defaultValue={['tiger']}>
<option value="gorilla">gorilla</option>
<option value="giraffe">giraffe</option>
<option value="monkey">monkey</option>
<option value="lion">lion</option>
<option value="mongoose">mongoose</option>
<option value="tiger">tiget</option>
</select>
</form>
</div>
</TestCase>
<TestCase
title="An option which contains conditional render fails"
relatedIssues="11911">

View File

@@ -1,321 +0,0 @@
import Fixture from '../../Fixture';
import FixtureSet from '../../FixtureSet';
import TestCase from '../../TestCase';
const React = window.React;
const ReactDOM = window.ReactDOM;
const Suspense = React.unstable_Suspense;
let cache = new Set();
function AsyncStep({text, ms}) {
if (!cache.has(text)) {
throw new Promise(resolve =>
setTimeout(() => {
cache.add(text);
resolve();
}, ms)
);
}
return null;
}
let suspendyTreeIdCounter = 0;
class SuspendyTreeChild extends React.Component {
id = suspendyTreeIdCounter++;
state = {
step: 1,
isHidden: false,
};
increment = () => this.setState(s => ({step: s.step + 1}));
componentDidMount() {
document.addEventListener('keydown', this.onKeydown);
}
componentWillUnmount() {
document.removeEventListener('keydown', this.onKeydown);
}
onKeydown = event => {
if (event.metaKey && event.key === 'Enter') {
this.increment();
}
};
render() {
return (
<React.Fragment>
<Suspense fallback={<div>(display: none)</div>}>
<div>
<AsyncStep text={`${this.state.step} + ${this.id}`} ms={500} />
{this.props.children}
</div>
</Suspense>
<button onClick={this.increment}>Hide</button>
</React.Fragment>
);
}
}
class SuspendyTree extends React.Component {
parentContainer = React.createRef(null);
container = React.createRef(null);
componentDidMount() {
this.setState({});
document.addEventListener('keydown', this.onKeydown);
}
componentWillUnmount() {
document.removeEventListener('keydown', this.onKeydown);
}
onKeydown = event => {
if (event.metaKey && event.key === '/') {
this.removeAndRestore();
}
};
removeAndRestore = () => {
const parentContainer = this.parentContainer.current;
const container = this.container.current;
parentContainer.removeChild(container);
parentContainer.textContent = '(removed from DOM)';
setTimeout(() => {
parentContainer.textContent = '';
parentContainer.appendChild(container);
}, 500);
};
render() {
return (
<React.Fragment>
<div ref={this.parentContainer}>
<div ref={this.container} />
</div>
<div>
{this.container.current !== null
? ReactDOM.createPortal(
<React.Fragment>
<SuspendyTreeChild>{this.props.children}</SuspendyTreeChild>
<button onClick={this.removeAndRestore}>Remove</button>
</React.Fragment>,
this.container.current
)
: null}
</div>
</React.Fragment>
);
}
}
class TextInputFixtures extends React.Component {
render() {
return (
<FixtureSet
title="Suspense"
description="Preserving the state of timed-out children">
<p>
Clicking "Hide" will hide the fixture context using{' '}
<code>display: none</code> for 0.5 seconds, then restore. This is the
built-in behavior for timed-out children. Each fixture tests whether
the state of the DOM is preserved. Clicking "Remove" will remove the
fixture content from the DOM for 0.5 seconds, then restore. This is{' '}
<strong>not</strong> how timed-out children are hidden, but is
included for comparison purposes.
</p>
<div className="footnote">
As a shortcut, you can use Command + Enter (or Control + Enter on
Windows, Linux) to "Hide" all the fixtures, or Command + / to "Remove"
them.
</div>
<TestCase title="Text selection where entire range times out">
<TestCase.Steps>
<li>Use your cursor to select the text below.</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
Text selection is preserved when hiding, but not when removing.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
Select this entire sentence (and only this sentence).
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Text selection that extends outside timed-out subtree">
<TestCase.Steps>
<li>
Use your cursor to select a range that includes both the text and
the "Go" button.
</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
Text selection is preserved when hiding, but not when removing.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
Select a range that includes both this sentence and the "Go"
button.
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Focus">
<TestCase.Steps>
<li>
Use your cursor to select a range that includes both the text and
the "Go" button.
</li>
<li>
Intead of clicking "Go", which switches focus, press Command +
Enter (or Control + Enter on Windows, Linux).
</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The ideal behavior is that the focus would not be lost, but
currently it is (both when hiding and removing).
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<button>Focus me</button>
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Uncontrolled form input">
<TestCase.Steps>
<li>Type something ("Hello") into the text input.</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
Input is preserved when hiding, but not when removing.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<input type="text" />
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Image flicker">
<TestCase.Steps>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The image should reappear without flickering. The text should not
reflow.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/Atom_%282%29.png" />React
is cool
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Iframe">
<TestCase.Steps>
<li>
The iframe shows a nested version of this fixtures app. Navigate
to the "Text inputs" page.
</li>
<li>Select one of the checkboxes.</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
When removing, the iframe is reloaded. When hiding, the iframe
should still be on the "Text inputs" page. The checkbox should still
be checked. (Unfortunately, scroll position is lost.)
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<iframe width="500" height="300" src="/" />
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Video playback">
<TestCase.Steps>
<li>Start playing the video, or seek to a specific position.</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The playback position should stay the same. When hiding, the video
plays in the background for the entire duration. When removing, the
video stops playing, but the position is not lost.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<video controls>
<source
src="http://techslides.com/demos/sample-videos/small.webm"
type="video/webm"
/>
<source
src="http://techslides.com/demos/sample-videos/small.ogv"
type="video/ogg"
/>
<source
src="http://techslides.com/demos/sample-videos/small.mp4"
type="video/mp4"
/>
<source
src="http://techslides.com/demos/sample-videos/small.3gp"
type="video/3gp"
/>
</video>
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Audio playback">
<TestCase.Steps>
<li>Start playing the audio, or seek to a specific position.</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
The playback position should stay the same. When hiding, the audio
plays in the background for the entire duration. When removing, the
audio stops playing, but the position is not lost.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<audio controls={true}>
<source src="https://upload.wikimedia.org/wikipedia/commons/e/ec/Mozart_K448.ogg" />
</audio>
</SuspendyTree>
</Fixture>
</TestCase>
<TestCase title="Scroll position">
<TestCase.Steps>
<li>Scroll to a position in the list.</li>
<li>Click "Hide" or "Remove".</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
Scroll position is preserved when hiding, but not when removing.
</TestCase.ExpectedResult>
<Fixture>
<SuspendyTree>
<div style={{height: 200, overflow: 'scroll'}}>
{Array(20)
.fill()
.map((_, i) => <h2 key={i}>{i + 1}</h2>)}
</div>
</SuspendyTree>
</Fixture>
</TestCase>
</FixtureSet>
);
}
}
export default TextInputFixtures;

View File

@@ -1,4 +1,3 @@
import 'core-js/es6/symbol';
import 'core-js/es6/promise';
import 'core-js/es6/set';
import 'core-js/es6/map';

View File

@@ -1,5 +1,3 @@
import semver from 'semver';
/**
* Take a version from the window query string and load a specific
* version of React.
@@ -36,51 +34,36 @@ 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';
export default function loadReact() {
let REACT_PATH = 'react.development.js';
let DOM_PATH = 'react-dom.development.js';
let query = parseQuery(window.location.search);
let version = query.version || 'local';
if (version !== 'local') {
const {major, minor, prerelease} = semver(version);
const [preReleaseStage] = prerelease;
// The file structure was updated in 16. This wasn't the case for alphas.
// Load the old module location for anything less than 16 RC
if (major >= 16 && !(minor === 0 && preReleaseStage === 'alpha')) {
reactPath =
if (parseInt(version, 10) >= 16 && version.indexOf('alpha') < 0) {
REACT_PATH =
'https://unpkg.com/react@' + version + '/umd/react.development.js';
reactDOMPath =
DOM_PATH =
'https://unpkg.com/react-dom@' +
version +
'/umd/react-dom.development.js';
reactDOMServerPath =
'https://unpkg.com/react-dom@' +
version +
'/umd/react-dom-server.browser.development';
} else {
reactPath = 'https://unpkg.com/react@' + version + '/dist/react.js';
reactDOMPath =
REACT_PATH = 'https://unpkg.com/react@' + version + '/dist/react.js';
DOM_PATH =
'https://unpkg.com/react-dom@' + version + '/dist/react-dom.js';
reactDOMServerPath =
'https://unpkg.com/react-dom@' + version + '/dist/react-dom-server.js';
}
}
const needsReactDOM = version === 'local' || parseFloat(version, 10) > 0.13;
return {reactPath, reactDOMPath, reactDOMServerPath, needsReactDOM};
}
export default function loadReact() {
const {reactPath, reactDOMPath, needsReactDOM} = reactPaths();
let request = loadScript(reactPath);
let request = loadScript(REACT_PATH);
if (needsReactDOM) {
request = request.then(() => loadScript(reactDOMPath));
request = request.then(() => loadScript(DOM_PATH));
} else {
// Aliasing React to ReactDOM for compatibility.
request = request.then(() => {

View File

@@ -4,13 +4,14 @@
box-sizing: border-box;
}
html {
font-size: 10px;
}
body {
color: #333;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Arimo", "Roboto", "Oxygen",
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-size: 15px;
line-height: 24px;
font-size: 1.4rem;
margin: 0;
padding: 0;
}
@@ -25,82 +26,23 @@ button {
padding: 6px 8px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #171717;
font-weight: 600;
}
h1 {
font-size: 32px;
margin: 24px 0;
}
h2 {
font-size: 24px;
margin: 24px 0 16px;
}
h3 {
font-size: 18px;
margin: 8px 0 16px;
}
h4, h4, h5, h6 {
font-size: 16px;
margin: 0 0 16px;
}
code {
font-size: 90%;
}
a {
text-decoration: none;
}
a:link:hover,
a:link:focus {
text-decoration: underline;
}
textarea {
border-radius: 2px;
border: 1px solid #d9d9d9;
font-size: 12px;
min-height: 100px;
min-width: 300px;
padding: 8px;
}
.header {
background: #171717;
background: #222;
box-shadow: inset 0 -1px 3px #000;
font-size: 1.6rem;
line-height: 3.2rem;
overflow: hidden;
padding: 8px;
}
.header a {
text-decoration: none;
color: white;
}
.header a:hover,
.header a:focus{
text-decoration: underline;
padding: .8rem 1.6rem;
}
.header select {
margin-left: 8px;
max-width: 150px;
width: 12rem;
}
.header__inner {
display: table;
margin: 0 auto;
max-width: 1000px;
overflow: hidden;
text-align: center;
width: 100%;
@@ -166,11 +108,11 @@ fieldset {
ul,
ol {
margin: 0 0 16px 0;
margin: 0 0 2rem 0;
}
p {
margin: 16px 0;
li {
margin-bottom: 0.4rem;
}
.type-subheading {
@@ -188,10 +130,11 @@ p {
.footnote {
border-left: 4px solid #aaa;
color: #444;
font-size: 14px;
font-style: italic;
margin-left: 8px;
padding-left: 16px;
line-height: 1.5;
margin-bottom: 2.4rem;
margin-left: 0.4rem;
padding-left: 1.6rem;
}
.test-case {
@@ -215,7 +158,7 @@ p {
}
.test-case__body {
padding: 10px;
padding: 0 15px;
}
.test-case__desc {
@@ -279,24 +222,3 @@ p {
.field-group {
overflow: hidden;
}
table {
border: 1px solid #d9d9d9;
border-width: 1px 1px 1px 0;
border-collapse: collapse;
margin: 16px 0;
font-size: 14px;
line-height: 20px;
width: 100%;
}
td,
th {
text-align: left;
border: 1px solid #d9d9d9;
padding: 6px;
}
tbody tr:nth-child(even) {
background: #f0f0f0;
}

View File

@@ -52,9 +52,7 @@ export default function getVersionTags() {
cachedTags = JSON.parse(cachedTags);
resolve(cachedTags);
} else {
fetch('https://api.github.com/repos/facebook/react/tags?per_page=1000', {
mode: 'cors',
})
fetch('https://api.github.com/repos/facebook/react/tags', {mode: 'cors'})
.then(res => res.json())
.then(tags => {
// A message property indicates an error was sent from the API

View File

@@ -2,10 +2,6 @@
# yarn lockfile v1
"@babel/standalone@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.0.0.tgz#856446641620c1c5f0ca775621d478324ebd1f52"
abab@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d"
@@ -1560,10 +1556,6 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
codemirror@^5.40.0:
version "5.40.0"
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.40.0.tgz#2f5ed47366e514f41349ba0fe34daaa39be4e257"
color-convert@^1.3.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.8.2.tgz#be868184d7c8631766d54e7078e2672d7c7e3339"
@@ -5886,10 +5878,6 @@ semver@^5.0.3:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
semver@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
send@0.14.1:
version "0.14.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.14.1.tgz#a954984325392f51532a7760760e459598c89f7a"

View File

@@ -2,10 +2,11 @@
"private": true,
"name": "browserify-dev-fixture",
"dependencies": {
"browserify": "^13.3.0"
"browserify": "^13.3.0",
"react": "link:../../../../build/node_modules/react",
"react-dom": "link:../../../../build/node_modules/react-dom"
},
"scripts": {
"build": "rm -f output.js && browserify ./input.js -o output.js",
"prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
"build": "rm -f output.js && browserify ./input.js -o output.js"
}
}

View File

@@ -25,6 +25,10 @@ array-reduce@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
asap@~2.0.3:
version "2.0.6"
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
asn1.js@^4.0.0:
version "4.9.1"
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40"
@@ -250,6 +254,10 @@ convert-source-map@~1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -357,6 +365,12 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
encoding@^0.1.11:
version "0.1.12"
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
dependencies:
iconv-lite "~0.4.13"
events@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
@@ -368,6 +382,18 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
md5.js "^1.3.4"
safe-buffer "^5.1.1"
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -429,6 +455,10 @@ https-browserify@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
iconv-lite@~0.4.13:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
@@ -475,6 +505,10 @@ is-buffer@^1.1.0:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
is-stream@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -483,6 +517,17 @@ isarray@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
node-fetch "^1.0.1"
whatwg-fetch ">=0.10.0"
js-tokens@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
json-stable-stringify@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
@@ -515,6 +560,12 @@ lodash.memoize@~3.0.3:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"
md5.js@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -567,6 +618,17 @@ module-deps@^4.0.8:
through2 "^2.0.0"
xtend "^4.0.0"
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"
object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -631,6 +693,20 @@ process@~0.11.0:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
promise@^7.1.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
dependencies:
asap "~2.0.3"
prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"
public-encrypt@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
@@ -663,6 +739,14 @@ randombytes@^2.0.0, randombytes@^2.0.1:
dependencies:
safe-buffer "^5.1.0"
"react-dom@link:../../../../build/node_modules/react-dom":
version "0.0.0"
uid ""
"react@link:../../../../build/node_modules/react":
version "0.0.0"
uid ""
read-only-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
@@ -713,6 +797,10 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0,
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4:
version "2.4.9"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d"
@@ -822,6 +910,10 @@ typedarray@~0.0.5:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
umd@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e"
@@ -849,6 +941,10 @@ vm-browserify@~0.0.1:
dependencies:
indexof "0.0.1"
whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"

View File

@@ -2,11 +2,12 @@
"private": true,
"name": "browserify-prod-fixture",
"dependencies": {
"browserify": "^13.3.0"
"browserify": "^13.3.0",
"react": "link:../../../../build/node_modules/react",
"react-dom": "link:../../../../build/node_modules/react-dom"
},
"scripts": {
"build": "rm -f output.js && browserify ./input.js -g [envify --NODE_ENV 'production'] -o output.js",
"prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
"build": "rm -f output.js && browserify ./input.js -g [envify --NODE_ENV 'production'] -o output.js"
},
"devDependencies": {
"envify": "^4.0.0"

View File

@@ -25,6 +25,10 @@ array-reduce@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
asap@~2.0.3:
version "2.0.6"
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
asn1.js@^4.0.0:
version "4.9.1"
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40"
@@ -250,6 +254,10 @@ convert-source-map@~1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -357,6 +365,12 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
encoding@^0.1.11:
version "0.1.12"
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
dependencies:
iconv-lite "~0.4.13"
envify@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/envify/-/envify-4.1.0.tgz#f39ad3db9d6801b4e6b478b61028d3f0b6819f7e"
@@ -379,6 +393,18 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
md5.js "^1.3.4"
safe-buffer "^5.1.1"
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -440,6 +466,10 @@ https-browserify@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
iconv-lite@~0.4.13:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
@@ -486,6 +516,10 @@ is-buffer@^1.1.0:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
is-stream@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -494,6 +528,17 @@ isarray@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
node-fetch "^1.0.1"
whatwg-fetch ">=0.10.0"
js-tokens@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
json-stable-stringify@~0.0.0:
version "0.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
@@ -526,6 +571,12 @@ lodash.memoize@~3.0.3:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"
md5.js@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -578,6 +629,17 @@ module-deps@^4.0.8:
through2 "^2.0.0"
xtend "^4.0.0"
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"
object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -642,6 +704,20 @@ process@~0.11.0:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
promise@^7.1.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
dependencies:
asap "~2.0.3"
prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"
public-encrypt@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
@@ -674,6 +750,14 @@ randombytes@^2.0.0, randombytes@^2.0.1:
dependencies:
safe-buffer "^5.1.0"
"react-dom@link:../../../../build/node_modules/react-dom":
version "0.0.0"
uid ""
"react@link:../../../../build/node_modules/react":
version "0.0.0"
uid ""
read-only-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
@@ -724,6 +808,10 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0,
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4:
version "2.4.9"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d"
@@ -833,6 +921,10 @@ typedarray@~0.0.5:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
umd@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e"
@@ -860,6 +952,10 @@ vm-browserify@~0.0.1:
dependencies:
indexof "0.0.1"
whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"

View File

@@ -3,10 +3,11 @@
"name": "brunch-dev-fixture",
"devDependencies": {
"brunch": "^2.9.1",
"javascript-brunch": "^2.0.0"
"javascript-brunch": "^2.0.0",
"react": "link:../../../../build/node_modules/react",
"react-dom": "link:../../../../build/node_modules/react-dom"
},
"scripts": {
"build": "rm -rf public && brunch build",
"prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
"build": "rm -rf public && brunch build"
}
}

View File

@@ -78,6 +78,10 @@ array-unique@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
asap@~2.0.3:
version "2.0.6"
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
asn1.js@^4.0.0:
version "4.9.1"
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40"
@@ -409,6 +413,10 @@ cookie@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -596,6 +604,12 @@ encodeurl@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
encoding@^0.1.11:
version "0.1.12"
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
dependencies:
iconv-lite "~0.4.13"
es-abstract@^1.6.1:
version "1.9.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227"
@@ -712,6 +726,18 @@ fast-levenshtein@^1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9"
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"
fcache@~0.3:
version "0.3.0"
resolved "https://registry.yarnpkg.com/fcache/-/fcache-0.3.0.tgz#d45f2f908642b91b798e88195ec47881a51c3d44"
@@ -1001,7 +1027,7 @@ https-browserify@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
iconv-lite@0.4.19:
iconv-lite@0.4.19, iconv-lite@~0.4.13:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
@@ -1126,6 +1152,10 @@ is-regex@^1.0.4:
dependencies:
has "^1.0.1"
is-stream@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
@@ -1152,6 +1182,13 @@ isobject@^2.0.0:
dependencies:
isarray "1.0.0"
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
node-fetch "^1.0.1"
whatwg-fetch ">=0.10.0"
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
@@ -1162,6 +1199,10 @@ javascript-brunch@^2.0.0:
dependencies:
esprima "~3.0.0"
js-tokens@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
@@ -1223,6 +1264,12 @@ loggy@~0.3.0:
ansicolors "~0.3.2"
growl "~1.8.1"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"
md5.js@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -1376,6 +1423,13 @@ node-browser-modules@^0.1.0:
util "~0.10.3"
vm-browserify "~0.0.4"
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"
node-pre-gyp@^0.6.36:
version "0.6.38"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.38.tgz#e92a20f83416415bb4086f6d1fb78b3da73d113d"
@@ -1425,7 +1479,7 @@ oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-assign@^4.1.0:
object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -1551,6 +1605,20 @@ promise.prototype.finally@^2:
es-abstract "^1.6.1"
function-bind "^1.1.0"
promise@^7.1.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
dependencies:
asap "~2.0.3"
prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"
proxy-addr@~2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
@@ -1636,6 +1704,14 @@ rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
"react-dom@link:../../../../build/node_modules/react-dom":
version "0.0.0"
uid ""
"react@link:../../../../build/node_modules/react":
version "0.0.0"
uid ""
read-components@~0.7:
version "0.7.0"
resolved "https://registry.yarnpkg.com/read-components/-/read-components-0.7.0.tgz#77dce7adcb72a514240c47a675b9bcf7a3509dd9"
@@ -1794,6 +1870,10 @@ set-immediate-shim@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
setprototypeof@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
@@ -1973,6 +2053,10 @@ type-is@~1.6.15:
media-typer "0.3.0"
mime-types "~2.1.15"
ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
uid-number@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
@@ -2034,6 +2118,10 @@ vm-browserify@~0.0.4:
dependencies:
indexof "0.0.1"
whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
which@^1.2.12:
version "1.3.0"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"

View File

@@ -3,10 +3,11 @@
"name": "brunch-prod-fixture",
"devDependencies": {
"brunch": "^2.9.1",
"javascript-brunch": "^2.0.0"
"javascript-brunch": "^2.0.0",
"react": "link:../../../../build/node_modules/react",
"react-dom": "link:../../../../build/node_modules/react-dom"
},
"scripts": {
"build": "rm -rf public && brunch build -p",
"prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
"build": "rm -rf public && brunch build -p"
}
}

View File

@@ -78,6 +78,10 @@ array-unique@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
asap@~2.0.3:
version "2.0.6"
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
asn1.js@^4.0.0:
version "4.9.1"
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40"
@@ -409,6 +413,10 @@ cookie@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -596,6 +604,12 @@ encodeurl@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
encoding@^0.1.11:
version "0.1.12"
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
dependencies:
iconv-lite "~0.4.13"
es-abstract@^1.6.1:
version "1.9.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227"
@@ -712,6 +726,18 @@ fast-levenshtein@^1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9"
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"
fcache@~0.3:
version "0.3.0"
resolved "https://registry.yarnpkg.com/fcache/-/fcache-0.3.0.tgz#d45f2f908642b91b798e88195ec47881a51c3d44"
@@ -1001,7 +1027,7 @@ https-browserify@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
iconv-lite@0.4.19:
iconv-lite@0.4.19, iconv-lite@~0.4.13:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
@@ -1126,6 +1152,10 @@ is-regex@^1.0.4:
dependencies:
has "^1.0.1"
is-stream@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
@@ -1152,6 +1182,13 @@ isobject@^2.0.0:
dependencies:
isarray "1.0.0"
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
node-fetch "^1.0.1"
whatwg-fetch ">=0.10.0"
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
@@ -1162,6 +1199,10 @@ javascript-brunch@^2.0.0:
dependencies:
esprima "~3.0.0"
js-tokens@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
@@ -1223,6 +1264,12 @@ loggy@~0.3.0:
ansicolors "~0.3.2"
growl "~1.8.1"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"
md5.js@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -1376,6 +1423,13 @@ node-browser-modules@^0.1.0:
util "~0.10.3"
vm-browserify "~0.0.4"
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"
node-pre-gyp@^0.6.36:
version "0.6.38"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.38.tgz#e92a20f83416415bb4086f6d1fb78b3da73d113d"
@@ -1425,7 +1479,7 @@ oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-assign@^4.1.0:
object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -1551,6 +1605,20 @@ promise.prototype.finally@^2:
es-abstract "^1.6.1"
function-bind "^1.1.0"
promise@^7.1.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
dependencies:
asap "~2.0.3"
prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"
proxy-addr@~2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
@@ -1636,6 +1704,14 @@ rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
"react-dom@link:../../../../build/node_modules/react-dom":
version "0.0.0"
uid ""
"react@link:../../../../build/node_modules/react":
version "0.0.0"
uid ""
read-components@~0.7:
version "0.7.0"
resolved "https://registry.yarnpkg.com/read-components/-/read-components-0.7.0.tgz#77dce7adcb72a514240c47a675b9bcf7a3509dd9"
@@ -1794,6 +1870,10 @@ set-immediate-shim@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
setprototypeof@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
@@ -1973,6 +2053,10 @@ type-is@~1.6.15:
media-typer "0.3.0"
mime-types "~2.1.15"
ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
uid-number@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
@@ -2034,6 +2118,10 @@ vm-browserify@~0.0.4:
dependencies:
indexof "0.0.1"
whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
which@^1.2.12:
version "1.3.0"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"

View File

@@ -42,51 +42,51 @@
</div>
<div class="frame">
<h2>browserify (dev)</h2>
<iframe src="/fixtures/packaging/browserify/dev/"></iframe>
<iframe src="/fixtures/packaging/browserify/dev/index.html"></iframe>
</div>
<div class="frame">
<h2>browserify (prod)</h2>
<iframe src="/fixtures/packaging/browserify/prod/"></iframe>
<iframe src="/fixtures/packaging/browserify/prod/index.html"></iframe>
</div>
<div class="frame">
<h2>brunch (dev)</h2>
<iframe src="/fixtures/packaging/brunch/dev/"></iframe>
<iframe src="/fixtures/packaging/brunch/dev/index.html"></iframe>
</div>
<div class="frame">
<h2>brunch (prod)</h2>
<iframe src="/fixtures/packaging/brunch/prod/"></iframe>
<iframe src="/fixtures/packaging/brunch/prod/index.html"></iframe>
</div>
<div class="frame">
<h2>rjs (dev)</h2>
<iframe src="/fixtures/packaging/rjs/dev/"></iframe>
<iframe src="/fixtures/packaging/rjs/dev/index.html"></iframe>
</div>
<div class="frame">
<h2>rjs (prod)</h2>
<iframe src="/fixtures/packaging/rjs/prod/"></iframe>
<iframe src="/fixtures/packaging/rjs/prod/index.html"></iframe>
</div>
<div class="frame">
<h2>systemjs-builder (dev)</h2>
<iframe src="/fixtures/packaging/systemjs-builder/dev/"></iframe>
<iframe src="/fixtures/packaging/systemjs-builder/dev/index.html"></iframe>
</div>
<div class="frame">
<h2>systemjs-builder (prod)</h2>
<iframe src="/fixtures/packaging/systemjs-builder/prod/"></iframe>
<iframe src="/fixtures/packaging/systemjs-builder/prod/index.html"></iframe>
</div>
<div class="frame">
<h2>webpack (dev)</h2>
<iframe src="/fixtures/packaging/webpack/dev/"></iframe>
<iframe src="/fixtures/packaging/webpack/dev/index.html"></iframe>
</div>
<div class="frame">
<h2>webpack (prod)</h2>
<iframe src="/fixtures/packaging/webpack/prod/"></iframe>
<iframe src="/fixtures/packaging/webpack/prod/index.html"></iframe>
</div>
<div class="frame">
<h2>webpack-alias (dev)</h2>
<iframe src="/fixtures/packaging/webpack-alias/dev/"></iframe>
<iframe src="/fixtures/packaging/webpack-alias/dev/index.html"></iframe>
</div>
<div class="frame">
<h2>webpack-alias (prod)</h2>
<iframe src="/fixtures/packaging/webpack-alias/prod/"></iframe>
<iframe src="/fixtures/packaging/webpack-alias/prod/index.html"></iframe>
</div>
</body>
</html>

View File

@@ -6,6 +6,5 @@ module.exports = {
paths: {
react: '../../../../build/dist/react.development',
'react-dom': '../../../../build/dist/react-dom.development',
schedule: '../../../../build/dist/schedule.development',
},
};

View File

@@ -6,6 +6,5 @@ module.exports = {
paths: {
react: '../../../../build/dist/react.production.min',
'react-dom': '../../../../build/dist/react-dom.production.min',
schedule: '../../../../build/dist/schedule.development',
},
};

View File

@@ -2,6 +2,5 @@ System.config({
paths: {
react: '../../../../build/dist/react.development.js',
'react-dom': '../../../../build/dist/react-dom.development.js',
schedule: '../../../../build/dist/schedule.development',
},
});

View File

@@ -2,6 +2,5 @@ System.config({
paths: {
react: '../../../../build/dist/react.production.min.js',
'react-dom': '../../../../build/dist/react-dom.production.min.js',
schedule: '../../../../build/dist/schedule.development',
},
});

View File

@@ -1,9 +1,8 @@
<!DOCTYPE html>
<html style="width: 100%; height: 100%;">
<head>
<meta charset="utf-8">
<title>Scheduler Test Page</title>
<head>
<meta charset="utf-8">
<title>Schedule Test Page</title>
<style>
.correct {
border: solid green 2px;
@@ -12,94 +11,88 @@
border: dashed red 2px;
}
</style>
</head>
<body>
<h1>Scheduler Fixture</h1>
<p>
This fixture is for manual testing purposes, and the patterns used in
implementing it should not be used as a model. This is mainly for anyone
working on making changes to the `schedule` module.
</p>
<h2>Tests:</h2>
<ol>
<li>
<button onClick="runTestOne()">Run Test 1</button>
<p>Calls the callback within the frame when not blocked:</p>
<div><b>Expected:</b></div>
<div id="test-1-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
</head>
<body>
<h1>Schedule Fixture</h1>
<p>
This fixture is for manual testing purposes, and the patterns used in
implementing it should not be used as a model. This is mainly for anyone
working on making changes to the `schedule` module.
</p>
<h2>Tests:</h2>
<ol>
<li>
<button onClick="runTestOne()">Run Test 1</button>
<p>Calls the callback within the frame when not blocked:</p>
<div><b>Expected:</b></div>
<div id="test-1-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
<div> -------------------------------------------------</div>
<div><b>Actual:</b></div>
<div id="test-1"></div>
</li>
<li>
<p>Accepts multiple callbacks and calls within frame when not blocked</p>
<button onClick="runTestTwo()">Run Test 2</button>
<div><b>Expected:</b></div>
<div id="test-2-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
</li>
<li>
<p>Accepts multiple callbacks and calls within frame when not blocked</p>
<button onClick="runTestTwo()">Run Test 2</button>
<div><b>Expected:</b></div>
<div id="test-2-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
<div> -------------------------------------------------</div>
<div><b>Actual:</b></div>
<div id="test-2"></div>
</li>
<li>
<p>Schedules callbacks in correct order when they use scheduleWork to schedule themselves</p>
<button onClick="runTestThree()">Run Test 3</button>
<div><b>Expected:</b></div>
<div id="test-3-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
</li>
<li>
<p>Schedules callbacks in correct order when they use scheduleWork to schedule themselves</p>
<button onClick="runTestThree()">Run Test 3</button>
<div><b>Expected:</b></div>
<div id="test-3-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
<div> -------------------------------------------------</div>
<div><b>Actual:</b></div>
<div id="test-3"></div>
</li>
<li>
<p>Calls timed out callbacks and then any more pending callbacks, defers others if time runs out</p>
<button onClick="runTestFour()">Run Test 4</button>
<div><b>Expected:</b></div>
<div id="test-4-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
</li>
<li>
<p>Calls timed out callbacks and then any more pending callbacks, defers others if time runs out</p>
<button onClick="runTestFour()">Run Test 4</button>
<div><b>Expected:</b></div>
<div id="test-4-expected">
</div>
<div> -------------------------------------------------</div>
<div> If you see the same above and below it's correct.
<div> -------------------------------------------------</div>
<div><b>Actual:</b></div>
<div id="test-4"></div>
</li>
<li>
<p>When some callbacks throw errors, still calls them all within the same frame</p>
<p><b>IMPORTANT:</b> Open the console when you run this! Inspect the logs there!</p>
<button onClick="runTestFive()">Run Test 5</button>
</li>
<li>
<p>When some callbacks throw errors <b> and some also time out</b>, still calls them all within the same frame</p>
<p><b>IMPORTANT:</b> Open the console when you run this! Inspect the logs there!</p>
<button onClick="runTestSix()">Run Test 6</button>
</li>
<li>
<p>Continues calling callbacks even when user switches away from this tab</p>
<button onClick="runTestSeven()">Run Test 7</button>
<div><b>Click the button above, observe the counter, then switch to
another tab and switch back:</b></div>
<div id="test-7">
</div>
<div> If the counter advanced while you were away from this tab, it's correct.</div>
</li>
</ol>
<script src="../../build/dist/react.development.js"></script>
<script src="../../build/node_modules/scheduler/umd/scheduler.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script type="text/babel">
const {
unstable_scheduleCallback: scheduleCallback,
unstable_cancelCallback: cancelCallback,
unstable_now: now
} = Scheduler;
</li>
<li>
<p>When some callbacks throw errors, still calls them all within the same frame</p>
<p><b>IMPORTANT:</b> Open the console when you run this! Inspect the logs there!</p>
<button onClick="runTestFive()">Run Test 5</button>
</li>
<li>
<p>When some callbacks throw errors <b> and some also time out</b>, still calls them all within the same frame</p>
<p><b>IMPORTANT:</b> Open the console when you run this! Inspect the logs there!</p>
<button onClick="runTestSix()">Run Test 6</button>
</li>
<li>
<p>Continues calling callbacks even when user switches away from this tab</p>
<button onClick="runTestSeven()">Run Test 7</button>
<div><b>Click the button above, observe the counter, then switch to
another tab and switch back:</b></div>
<div id="test-7">
</div>
<div> If the counter advanced while you were away from this tab, it's correct.</div>
</li>
</ol>
<script src="../../build/dist/react-scheduler.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script type="text/babel">
const {scheduleWork, cancelWork, now} = ReactScheduler;
function displayTestResult(testNumber) {
const expectationNode = document.getElementById('test-' + testNumber + '-expected');
const resultNode = document.getElementById('test-' + testNumber);
@@ -498,4 +491,4 @@ function runTestSeven() {
}
</script type="text/babel">
</body>
</html>
</html>

View File

@@ -1334,6 +1334,10 @@ cookie@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
core-js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
@@ -2053,6 +2057,18 @@ fb-watchman@^1.8.0, fb-watchman@^1.9.0:
dependencies:
bser "1.0.2"
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"
figures@^1.3.5:
version "1.7.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
@@ -2737,6 +2753,13 @@ isobject@^2.0.0:
dependencies:
isarray "1.0.0"
isomorphic-fetch@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
dependencies:
node-fetch "^1.0.1"
whatwg-fetch ">=0.10.0"
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
@@ -3242,7 +3265,7 @@ longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
loose-envify@^1.0.0:
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
@@ -3423,6 +3446,13 @@ node-emoji@^1.4.1:
dependencies:
string.prototype.codepointat "^0.2.0"
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"
node-fetch@^1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04"
@@ -3558,7 +3588,7 @@ oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0:
object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -4071,6 +4101,20 @@ promise@7.1.1:
dependencies:
asap "~2.0.3"
promise@^7.1.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
dependencies:
asap "~2.0.3"
prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"
proxy-addr@~1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3"
@@ -4546,7 +4590,7 @@ set-immediate-shim@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
setimmediate@^1.0.4:
setimmediate@^1.0.4, setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
@@ -4941,6 +4985,10 @@ typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
uglify-js@2.8.x, uglify-js@^2.6:
version "2.8.21"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.21.tgz#1733f669ae6f82fc90c7b25ec0f5c783ee375314"
@@ -5194,6 +5242,10 @@ whatwg-fetch@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.2.tgz#fe294d1d89e36c5be8b3195057f2e4bc74fc980e"
whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
whatwg-url@^4.3.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.0.tgz#202035ac1955b087cdd20fa8b58ded3ab1cd2af5"

View File

@@ -1,72 +0,0 @@
<!DOCTYPE html>
<html style="width: 100%; height: 100%;">
<head>
<meta charset="utf-8">
<title>Test tracing UMD</title>
<style>
body {
font-family: sans-serif;
}
ol {
display: inline-flex;
flex-direction: column;
align-items: flex-start;
}
li {
background-color: #F7F7F7;
border: solid #CCC 0.125rem;
margin-bottom: 0.5rem;
border-radius: 0.25rem;
padding: 0.5rem;
}
li:after {
content: attr(data-value);
margin-left: 0.25rem;
}
.correct {
border-color: #0C0;
border-style: solid;
background: #EFE;
}
.incorrect {
border-color: #F00;
border-style: dashed;
background-color: #FEE;
}
</style>
</head>
<body>
<h1>Test tracing UMD</h1>
<p>
This fixture tests that the new tracing API is accessible via UMD build using the UMD shim.
It does not exhaustively test API functionality, only that the forwarded methods can be called.
</p>
<p>
Before running the tests below, check the console to make sure there are no errors.
</p>
<h3>
Tests
<button onClick="runAllTests()">Run all tests</button>
</h3>
<ol>
<li id="checkSchedulerAPI" data-value="...">
<strong>Test scheduler API</strong>
</li>
<li id="checkSchedulerTracingAPI" data-value="...">
<strong>Test tracing API</strong>
</li>
<li id="checkSchedulerTracingSubscriptionsAPI" data-value="...">
<strong>Test tracing subscriptions API</strong>
</li>
<li id="checkEndToEndIntegration" data-value="...">
<strong>Test end-to-end integration</strong>
</li>
</ol>
<!-- Load the tracing API before react to test that it's lazily evaluated -->
<script src="../../build/node_modules/scheduler/umd/scheduler.development.js"></script>
<script src="../../build/node_modules/scheduler/umd/scheduler-tracing.development.js"></script>
<script src="../../build/node_modules/react/umd/react.development.js"></script>
<script src="../../build/node_modules/react-dom/umd/react-dom.development.js"></script>
<script src="./script.js"></script>
</body>
</html>

View File

@@ -1,205 +0,0 @@
function runTest(listItem, callback) {
try {
callback();
listItem.className = 'correct';
listItem.setAttribute('data-value', 'All checks pass');
} catch (error) {
listItem.className = 'incorrect';
listItem.setAttribute('data-value', error);
}
}
function runAllTests() {
try {
checkSchedulerAPI();
} finally {
try {
checkSchedulerTracingAPI();
} finally {
try {
checkSchedulerTracingSubscriptionsAPI();
} finally {
checkEndToEndIntegration();
}
}
}
}
function checkSchedulerAPI() {
runTest(document.getElementById('checkSchedulerAPI'), () => {
if (
typeof Scheduler === 'undefined' ||
typeof Scheduler.unstable_now !== 'function' ||
typeof Scheduler.unstable_scheduleCallback !== 'function' ||
typeof Scheduler.unstable_cancelCallback !== 'function'
) {
throw 'API is not defined';
}
if (Scheduler.unstable_now() !== performance.now()) {
throw 'API does not work';
}
// There is no real way to verify that the two APIs are connected.
});
}
function checkSchedulerTracingAPI() {
runTest(document.getElementById('checkSchedulerTracingAPI'), () => {
if (
typeof SchedulerTracing === 'undefined' ||
typeof SchedulerTracing.unstable_clear !== 'function' ||
typeof SchedulerTracing.unstable_getCurrent !== 'function' ||
typeof SchedulerTracing.unstable_getThreadID !== 'function' ||
typeof SchedulerTracing.unstable_trace !== 'function' ||
typeof SchedulerTracing.unstable_wrap !== 'function'
) {
throw 'API is not defined';
}
try {
let interactionsSet;
SchedulerTracing.unstable_trace('test', 123, () => {
interactionsSet = SchedulerTracing.unstable_getCurrent();
});
if (interactionsSet.size !== 1) {
throw null;
}
const interaction = Array.from(interactionsSet)[0];
if (interaction.name !== 'test' || interaction.timestamp !== 123) {
throw null;
}
} catch (error) {
throw 'API does not work';
}
const ForwardedSchedulerTracing =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing;
if (
SchedulerTracing.unstable_getThreadID() ===
ForwardedSchedulerTracing.unstable_getThreadID()
) {
throw 'API forwarding is broken';
}
});
}
function checkSchedulerTracingSubscriptionsAPI() {
runTest(
document.getElementById('checkSchedulerTracingSubscriptionsAPI'),
() => {
if (
typeof SchedulerTracing === 'undefined' ||
typeof SchedulerTracing.unstable_subscribe !== 'function' ||
typeof SchedulerTracing.unstable_unsubscribe !== 'function'
) {
throw 'API is not defined';
}
const onInteractionScheduledWorkCompletedCalls = [];
const onInteractionTracedCalls = [];
const onWorkCanceledCalls = [];
const onWorkScheduledCalls = [];
const onWorkStartedCalls = [];
const onWorkStoppedCalls = [];
const subscriber = {
onInteractionScheduledWorkCompleted: (...args) =>
onInteractionScheduledWorkCompletedCalls.push(args),
onInteractionTraced: (...args) => onInteractionTracedCalls.push(args),
onWorkCanceled: (...args) => onWorkCanceledCalls.push(args),
onWorkScheduled: (...args) => onWorkScheduledCalls.push(args),
onWorkStarted: (...args) => onWorkStartedCalls.push(args),
onWorkStopped: (...args) => onWorkStoppedCalls.push(args),
};
try {
SchedulerTracing.unstable_subscribe(subscriber);
SchedulerTracing.unstable_trace('foo', 123, () => {});
SchedulerTracing.unstable_unsubscribe(subscriber);
if (onInteractionTracedCalls.length !== 1) {
throw null;
}
const interaction = onInteractionTracedCalls[0][0];
if (interaction.name !== 'foo' || interaction.timestamp !== 123) {
throw null;
}
SchedulerTracing.unstable_trace('bar', 456, () => {});
if (onInteractionTracedCalls.length !== 1) {
throw null;
}
} catch (error) {
throw 'API does not forward methods';
}
const ForwardedSchedulerTracing =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.SchedulerTracing;
try {
ForwardedSchedulerTracing.unstable_subscribe(subscriber);
SchedulerTracing.unstable_trace('foo', 123, () => {});
ForwardedSchedulerTracing.unstable_trace('bar', 456, () => {});
SchedulerTracing.unstable_unsubscribe(subscriber);
if (onInteractionTracedCalls.length !== 3) {
throw null;
}
const interactionFoo = onInteractionTracedCalls[1][0];
const interactionBar = onInteractionTracedCalls[2][0];
if (
interactionFoo.name !== 'foo' ||
interactionFoo.timestamp !== 123 ||
interactionBar.name !== 'bar' ||
interactionBar.timestamp !== 456
) {
throw null;
}
ForwardedSchedulerTracing.unstable_trace('baz', 789, () => {});
if (onInteractionTracedCalls.length !== 3) {
throw null;
}
} catch (error) {
throw 'API forwarding is broken';
}
}
);
}
function checkEndToEndIntegration() {
runTest(document.getElementById('checkEndToEndIntegration'), () => {
try {
const onRenderCalls = [];
const onRender = (...args) => onRenderCalls.push(args);
const container = document.createElement('div');
SchedulerTracing.unstable_trace('render', 123, () => {
ReactDOM.render(
React.createElement(
React.unstable_Profiler,
{id: 'profiler', onRender},
React.createElement('div', null, 'hi')
),
container
);
});
if (container.textContent !== 'hi') {
throw null;
}
if (onRenderCalls.length !== 1) {
throw null;
}
const call = onRenderCalls[0];
if (call.length !== 7) {
throw null;
}
const interaction = Array.from(call[6])[0];
if (interaction.name !== 'render' || interaction.timestamp !== 123) {
throw null;
}
} catch (error) {
throw 'End to end integration is broken';
}
});
}

View File

@@ -1,21 +0,0 @@
<!DOCTYPE html>
<html style="width: 100%; height: 100%;">
<head>
<meta charset="utf-8">
<title>Test tracing UMD</title>
<style>
body {
font-family: sans-serif;
}
</style>
</head>
<body>
<div id="root"></div>
<!-- Load the tracing API before react to test that it's lazily evaluated -->
<script src="../../build/node_modules/scheduler/umd/scheduler.development.js"></script>
<script src="../../build/node_modules/scheduler/umd/scheduler-tracing.development.js"></script>
<script src="../../build/node_modules/react/umd/react.development.js"></script>
<script src="../../build/node_modules/react-dom/umd/react-dom.development.js"></script>
<script src="./test.js"></script>
</body>
</html>

View File

@@ -1,103 +0,0 @@
const {createElement, Component, Placeholder} = React;
const {unstable_createRoot: createRoot} = ReactDOM;
const {
unstable_subscribe: subscribe,
unstable_trace: trace,
unstable_wrap: wrap,
} = SchedulerTracing;
const createLogger = (backgroundColor, color, enabled) => (
message,
...args
) => {
if (enabled === false) return;
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
);
console.log(
new Error('stack').stack
.split('\n')
.slice(2)
.join('\n')
);
console.groupEnd();
};
window.log = {
app: createLogger('#37474f', '#fff'),
interaction: createLogger('#6a1b9a', '#fff'),
react: createLogger('#ff5722', '#fff'),
tracing: createLogger('#2962ff', '#fff'),
work: createLogger('#e1bee7', '#000'),
};
// Fake suspense
const resolvedValues = {};
const read = key => {
if (!resolvedValues[key]) {
log.app(`Suspending for "${key}" ...`);
throw new Promise(
wrap(resolve => {
setTimeout(
wrap(() => {
log.app(`Loaded "${key}" ...`);
resolvedValues[key] = true;
resolve(key);
}),
1000
);
})
);
}
return key;
};
const TestApp = () =>
createElement(
Placeholder,
{delayMs: 100, fallback: createElement(PlaceholderText)},
createElement(SuspendingChild, {text: 'foo'}),
createElement(SuspendingChild, {text: 'bar'}),
createElement(SuspendingChild, {text: 'baz'})
);
const PlaceholderText = () => 'Loading ...';
const SuspendingChild = ({text}) => {
const resolvedValue = read(text);
return resolvedValue;
};
subscribe({
onInteractionScheduledWorkCompleted: interaction =>
log.interaction(
'onInteractionScheduledWorkCompleted',
JSON.stringify(interaction)
),
onInteractionTraced: interaction =>
log.interaction('onInteractionTraced', JSON.stringify(interaction)),
onWorkCanceled: interactions =>
log.work('onWorkCanceled', JSON.stringify(Array.from(interactions))),
onWorkScheduled: interactions =>
log.work('onWorkScheduled', JSON.stringify(Array.from(interactions))),
onWorkStarted: interactions =>
log.work('onWorkStarted', JSON.stringify(Array.from(interactions))),
onWorkStopped: interactions =>
log.work('onWorkStopped', JSON.stringify(Array.from(interactions))),
});
const element = document.getElementById('root');
trace('initial_render', performance.now(), () => {
const root = createRoot(element);
const batch = root.createBatch();
log.app('batch.render()');
batch.render(createElement(TestApp));
batch.then(
wrap(() => {
log.app('batch.commit()');
batch.commit();
})
);
});

View File

@@ -14,13 +14,15 @@ No. The APIs being tested here are unstable and some of them have still not been
Clone the React repository.
Follow these steps:
Open `packages/shared/ReactFeatureFlags.js` locally (make sure you didn't open a similarly named file!) and set [the `enableSuspense` flag](https://github.com/facebook/react/blob/d79238f1eeb6634ba7a3df23c3b2709b56cbb8b2/packages/shared/ReactFeatureFlags.js#L19) to `true`.
Then follow these steps:
```shell
# 1: Build react from source
cd /path/to/react
yarn
yarn build dom-client,core,react-cache,scheduler --type=NODE
yarn build dom,core,interaction,simple-cache-provider --type=NODE
# 2: Install fixture dependencies
cd fixtures/unstable-async/suspense/

View File

@@ -10,11 +10,12 @@
"dependencies": {
"clipboard": "^1.7.1",
"github-fork-ribbon-css": "^0.2.1",
"react-draggable": "^3.0.5"
"react": "../../../build/node_modules/react",
"react-dom": "../../../build/node_modules/react-dom",
"react-draggable": "^3.0.5",
"simple-cache-provider": "../../../build/node_modules/simple-cache-provider"
},
"scripts": {
"prestart": "cp -r ../../../build/node_modules/* ./node_modules/",
"prebuild": "cp -r ../../../build/node_modules/* ./node_modules/",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="./src/favicon.ico">
<title>React Core Team</title>
<title>Movie List</title>
</head>
<body>
<div id="root"></div>

View File

@@ -1,4 +1,4 @@
import {createCache} from 'react-cache';
import {createCache} from 'simple-cache-provider';
export let cache;
function initCache() {

View File

@@ -1,13 +1,16 @@
import React, {lazy, unstable_Suspense as Suspense, PureComponent} from 'react';
import {unstable_scheduleCallback} from 'scheduler';
import {
unstable_trace as trace,
unstable_wrap as wrap,
} from 'scheduler/tracing';
import React, {Fragment, Placeholder, PureComponent} from 'react';
import {unstable_deferredUpdates} from 'react-dom';
import {createResource} from 'simple-cache-provider';
import {cache} from '../cache';
import Spinner from './Spinner';
import ContributorListPage from './ContributorListPage';
const UserPage = lazy(() => import('./UserPage'));
const UserPageResource = createResource(() => import('./UserPage'));
function UserPageLoader(props) {
const UserPage = UserPageResource.read(cache).default;
return <UserPage {...props} />;
}
export default class App extends PureComponent {
state = {
@@ -18,38 +21,28 @@ export default class App extends PureComponent {
componentDidUpdate(prevProps, prevState) {
if (
prevState.showDetail !== this.state.showDetail ||
(prevState.currentId !== this.state.currentId && this.state.showDetail)
prevState.currentId !== this.state.currentId
) {
window.scrollTo(0, 0);
}
}
handleUserClick = id => {
trace(`View ${id}`, performance.now(), () => {
trace(`View ${id} (high-pri)`, performance.now(), () =>
this.setState({
currentId: id,
})
);
unstable_scheduleCallback(
wrap(() =>
trace(`View ${id} (low-pri)`, performance.now(), () =>
this.setState({
showDetail: true,
})
)
)
);
this.setState({
currentId: id,
});
unstable_deferredUpdates(() => {
this.setState({
showDetail: true,
});
});
};
handleBackClick = () =>
trace('View list', performance.now(), () =>
this.setState({
currentId: null,
showDetail: false,
})
);
this.setState({
currentId: null,
showDetail: false,
});
render() {
const {currentId, showDetail} = this.state;
@@ -69,21 +62,21 @@ export default class App extends PureComponent {
}}>
Return to list
</button>
<Suspense maxDuration={2000} fallback={<Spinner size="large" />}>
<UserPage id={id} />
</Suspense>
<Placeholder delayMs={2000} fallback={<Spinner size="large" />}>
<UserPageLoader id={id} />
</Placeholder>
</div>
);
}
renderList(loadingId) {
return (
<Suspense maxDuration={1500} fallback={<Spinner size="large" />}>
<Placeholder delayMs={1500} fallback={<Spinner size="large" />}>
<ContributorListPage
loadingId={loadingId}
onUserClick={this.handleUserClick}
/>
</Suspense>
</Placeholder>
);
}
}

View File

@@ -1,5 +1,5 @@
import React, {Fragment} from 'react';
import {createResource} from 'react-cache';
import {createResource} from 'simple-cache-provider';
import {cache} from '../cache';
import Spinner from './Spinner';
import {fetchCoreContributorListJSON} from '../api';

View File

@@ -2,13 +2,6 @@
animation: rotate 1.3s linear infinite;
}
.SpinnerContainer-large {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@keyframes rotate {
0% { transform: rotate(0deg); }
100% { transform: rotate(270deg); }

View File

@@ -26,26 +26,23 @@ export default function Spinner({size = 'small'}) {
const strokeWidth = STROKE_WIDTHS[size];
const pathRadius = `${baseSize / 2 - strokeWidth}px`;
const className = PATH_CLASS_NAMES[size];
const containerClassName = `SpinnerContainer SpinnerContainer-${size}`;
return (
<div className={containerClassName}>
<svg
className={className}
width={baseSize}
height={baseSize}
viewBox={`0 0 ${baseSize} ${baseSize}`}>
<circle
className="SpinnerPath"
fill="none"
stroke="currentColor"
strokeWidth={strokeWidth}
strokeLinecap="round"
cx={pathSize}
cy={pathSize}
r={pathRadius}
/>
</svg>
</div>
<svg
className={className}
width={baseSize}
height={baseSize}
viewBox={`0 0 ${baseSize} ${baseSize}`}>
<circle
className="SpinnerPath"
fill="none"
stroke="currentColor"
strokeWidth={strokeWidth}
strokeLinecap="round"
cx={pathSize}
cy={pathSize}
r={pathRadius}
/>
</svg>
);
}

View File

@@ -1,5 +1,5 @@
import React, {unstable_Suspense as Suspense} from 'react';
import {createResource} from 'react-cache';
import React, {Fragment, Placeholder} from 'react';
import {createResource} from 'simple-cache-provider';
import Spinner from './Spinner';
import {cache} from '../cache';
import {fetchUserProfileJSON, fetchUserRepositoriesListJSON} from '../api';
@@ -14,9 +14,9 @@ export default function UserPage({id}) {
alignItems: 'start',
}}>
<UserDetails id={id} />
<Suspense maxDuration={1000} fallback={<Spinner size="medium" />}>
<Placeholder delayMs={1000} fallback={<Spinner size="medium" />}>
<Repositories id={id} />
</Suspense>
</Placeholder>
</div>
);
}
@@ -112,13 +112,13 @@ const ImageResource = createResource(
})
);
function Img({src, alt, ...rest}) {
return <img src={ImageResource.read(cache, src)} alt={alt} {...rest} />;
function Img({src, ...rest}) {
return <img src={ImageResource.read(cache, src)} {...rest} />;
}
function UserPicture({source}) {
return (
<Suspense maxDuration={1500} fallback={<img src={source} alt="poster" />}>
<Placeholder delayMs={1500} fallback={<img src={source} alt="poster" />}>
<Img
src={source}
alt="profile picture"
@@ -128,14 +128,14 @@ function UserPicture({source}) {
borderRadius: '0.5rem',
}}
/>
</Suspense>
</Placeholder>
);
}
const UserRepositoriesResource = createResource(fetchUserRepositoriesListJSON);
function Repositories({id}) {
const repos = UserRepositoriesResource.read(cache, id);
const reviews = UserRepositoriesResource.read(cache, id);
return (
<ul
style={{
@@ -144,7 +144,7 @@ function Repositories({id}) {
padding: 0,
margin: 0,
}}>
{repos.map(repo => <Repository key={repo.name} {...repo} />)}
{reviews.map(review => <Repository key={review.id} {...review} />)}
</ul>
);
}

View File

@@ -1,6 +1,5 @@
import React, {Fragment, PureComponent} from 'react';
import {unstable_createRoot, render} from 'react-dom';
import {unstable_trace as trace} from 'scheduler/tracing';
import {cache} from './cache';
import {
setFakeRequestTime,
@@ -65,13 +64,11 @@ class Debugger extends PureComponent {
}
handleReset = () => {
trace('Clear cache', () => {
cache.invalidate();
this.setState(state => ({
requests: {},
}));
handleReset();
});
cache.invalidate();
this.setState(state => ({
requests: {},
}));
handleReset();
};
handleProgress = (url, progress, isPaused) => {

View File

@@ -4386,7 +4386,7 @@ longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
loose-envify@^1.0.0, loose-envify@^1.3.1:
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
@@ -5553,7 +5553,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"
prop-types@^15.5.10:
prop-types@^15.5.10, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
dependencies:
@@ -5716,6 +5716,13 @@ react-dev-utils@^5.0.1:
strip-ansi "3.0.1"
text-table "0.2.0"
react-dom@../../../build/node_modules/react-dom:
version "16.4.1"
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
react-draggable@^3.0.5:
version "3.0.5"
resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-3.0.5.tgz#c031e0ed4313531f9409d6cd84c8ebcec0ddfe2d"
@@ -5772,6 +5779,13 @@ react-scripts@^1.1.4:
optionalDependencies:
fsevents "^1.1.3"
react@../../../build/node_modules/react:
version "16.4.1"
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
read-pkg-up@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
@@ -6314,6 +6328,9 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
simple-cache-provider@../../../build/node_modules/simple-cache-provider:
version "0.7.0"
slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"

View File

@@ -18,7 +18,7 @@ There are also known bugs and inefficiencies in master so **don't use this fixtu
# 1: Build react from source
cd /path/to/react
yarn
yarn build dom-client,core,react-cache,scheduler --type=NODE
yarn build dom,core,interaction,simple-cache-provider --type=NODE
# 2: Install fixture dependencies
cd fixtures/unstable-async/time-slicing/

View File

@@ -4,13 +4,14 @@
"private": true,
"dependencies": {
"glamor": "^2.20.40",
"react": "../../../build/node_modules/react",
"react-dom": "../../../build/node_modules/react-dom",
"react-markdown": "^3.2.0",
"react-scripts": "^1.1.4",
"simple-cache-provider": "../../../build/node_modules/simple-cache-provider",
"victory": "^0.25.6"
},
"scripts": {
"prestart": "cp -r ../../../build/node_modules/* ./node_modules/",
"prebuild": "cp -r ../../../build/node_modules/* ./node_modules/",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",

View File

@@ -1,6 +1,5 @@
import React, {PureComponent} from 'react';
import {flushSync, render} from 'react-dom';
import {unstable_scheduleCallback} from 'scheduler';
import React, {PureComponent, unstable_AsyncMode} from 'react';
import {flushSync, render, unstable_deferredUpdates} from 'react-dom';
import _ from 'lodash';
import Charts from './Charts';
import Clock from './Clock';
@@ -55,11 +54,9 @@ class App extends PureComponent {
return;
}
if (this.state.strategy !== 'async') {
flushSync(() => {
this.setState(state => ({
showDemo: !state.showDemo,
}));
});
this.setState(state => ({
showDemo: !state.showDemo,
}));
return;
}
if (this._ignoreClick) {
@@ -67,9 +64,12 @@ class App extends PureComponent {
}
this._ignoreClick = true;
unstable_scheduleCallback(() => {
this.setState({showDemo: true}, () => {
this._ignoreClick = false;
// TODO: needing setTimeout here seems like a React bug.
setTimeout(() => {
unstable_deferredUpdates(() => {
this.setState({showDemo: true}, () => {
this._ignoreClick = false;
});
});
});
};
@@ -107,8 +107,11 @@ class App extends PureComponent {
this.debouncedHandleChange(value);
break;
case 'async':
unstable_scheduleCallback(() => {
this.setState({value});
// TODO: needing setTimeout here seems like a React bug.
setTimeout(() => {
unstable_deferredUpdates(() => {
this.setState({value});
});
});
break;
default:
@@ -117,6 +120,8 @@ class App extends PureComponent {
};
render() {
const Wrapper =
this.state.strategy === 'async' ? unstable_AsyncMode : 'div';
const {showClock} = this.state;
const data = this.getStreamData(this.state.value);
return (
@@ -132,23 +137,20 @@ class App extends PureComponent {
defaultValue={this.state.input}
onChange={this.handleChange}
/>
<div className="demo" onClick={this.handleChartClick}>
{this.state.showDemo && (
<Charts data={data} onClick={this.handleChartClick} />
)}
<div style={{display: showClock ? 'block' : 'none'}}>
<Clock />
<Wrapper>
<div className="demo" onClick={this.handleChartClick}>
{this.state.showDemo && (
<Charts data={data} onClick={this.handleChartClick} />
)}
<div style={{display: showClock ? 'block' : 'none'}}>
<Clock />
</div>
</div>
</div>
</Wrapper>
</div>
);
}
}
const container = document.getElementById('root');
render(
<React.unstable_ConcurrentMode>
<App />
</React.unstable_ConcurrentMode>,
container
);
render(<App />, container);

View File

@@ -4136,7 +4136,7 @@ longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
loose-envify@^1.0.0, loose-envify@^1.3.1:
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
@@ -5239,6 +5239,13 @@ prop-types@^15.5.10, prop-types@^15.6.0:
loose-envify "^1.3.1"
object-assign "^4.1.1"
prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
dependencies:
loose-envify "^1.3.1"
object-assign "^4.1.1"
proxy-addr@~2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
@@ -5387,6 +5394,13 @@ react-dev-utils@^5.0.1:
strip-ansi "3.0.1"
text-table "0.2.0"
react-dom@../../../build/node_modules/react-dom:
version "16.4.1"
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
react-error-overlay@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4"
@@ -5446,6 +5460,13 @@ react-scripts@^1.1.4:
optionalDependencies:
fsevents "^1.1.3"
react@../../../build/node_modules/react:
version "16.4.1"
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
read-all-stream@^3.0.0:
version "3.1.0"
resolved "http://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa"
@@ -5964,6 +5985,9 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
simple-cache-provider@../../../build/node_modules/simple-cache-provider:
version "0.7.0"
slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"

View File

@@ -1,15 +1,16 @@
{
"private": true,
"version": "16.6.0-alpha.8af6728",
"version": "16.4.1",
"workspaces": [
"packages/*"
],
"devDependencies": {
"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": "^10.0.0",
"babel-eslint": "^8.0.0",
"babel-jest": "^23.0.1",
"babel-plugin-check-es2015-constants": "^6.5.0",
"babel-plugin-external-helpers": "^6.22.0",
@@ -36,6 +37,7 @@
"babel-preset-react": "^6.5.0",
"babel-traverse": "^6.9.0",
"babylon": "6.18.0",
"bundle-collapser": "^1.1.1",
"chalk": "^1.1.3",
"cli-table": "^0.3.1",
"coffee-script": "^1.8.0",
@@ -44,6 +46,9 @@
"create-react-class": "^15.6.3",
"cross-env": "^5.1.1",
"danger": "^3.0.4",
"del": "^2.0.2",
"derequire": "^2.0.3",
"escape-string-regexp": "^1.0.5",
"eslint": "^4.1.0",
"eslint-config-fbjs": "^1.1.1",
"eslint-plugin-babel": "^3.3.0",
@@ -52,21 +57,26 @@
"eslint-plugin-no-for-of-loops": "^1.0.0",
"eslint-plugin-react": "^6.7.1",
"eslint-plugin-react-internal": "link:./scripts/eslint-rules/",
"fbjs-scripts": "^0.8.3",
"fbjs-scripts": "^0.6.0",
"filesize": "^3.5.6",
"flow-bin": "^0.72.0",
"flow-coverage-report": "^0.4.0",
"git-branch": "^0.3.0",
"glob": "^6.0.4",
"glob-stream": "^6.1.0",
"google-closure-compiler": "20180506.0.0",
"gzip-js": "~0.3.2",
"gzip-size": "^3.0.0",
"jasmine-check": "^1.0.0-rc.0",
"jest": "^23.1.0",
"jest-diff": "^23.0.1",
"merge-stream": "^1.0.0",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"object-assign": "^4.1.1",
"platform": "^1.1.0",
"prettier": "1.13.7",
"prop-types": "^15.6.2",
"random-seed": "^0.3.0",
@@ -79,11 +89,13 @@
"rollup-plugin-prettier": "^0.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-strip-banner": "^0.2.0",
"run-sequence": "^1.1.4",
"semver": "^5.5.0",
"targz": "^1.0.1",
"through2": "^2.0.0",
"tmp": "~0.0.28",
"typescript": "~1.8.10"
"typescript": "~1.8.10",
"yargs": "^6.3.0"
},
"devEngines": {
"node": "8.x || 9.x || 10.x"
@@ -93,15 +105,14 @@
},
"scripts": {
"build": "npm run version-check && node ./scripts/rollup/build.js",
"flow-coverage": "flow-coverage-report --config ./.flowcoverage",
"linc": "node ./scripts/tasks/linc.js",
"lint": "node ./scripts/tasks/eslint.js",
"lint-build": "node ./scripts/rollup/validate/index.js",
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js",
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand",
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
"test-fire": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-fire.js",
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
"test-fire-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source-fire.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",

View File

@@ -8,7 +8,7 @@ This utility should be used for subscriptions to a single value that are typical
Other cases have **better long-term solutions**:
* Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead.
* I/O subscriptions (e.g. notifications) that update infrequently should use [`react-cache`](https://github.com/facebook/react/blob/master/packages/react-cache/README.md) instead.
* I/O subscriptions (e.g. notifications) that update infrequently should use [`simple-cache-provider`](https://github.com/facebook/react/blob/master/packages/simple-cache-provider/README.md) instead.
* Complex libraries like Relay/Apollo should manage subscriptions manually with the same techniques which this library uses under the hood (as referenced [here](https://gist.github.com/bvaughn/d569177d70b50b58bff69c3c4a5353f3)) in a way that is most optimized for their library usage.
## Limitations in async mode
@@ -19,7 +19,7 @@ However, [it achieves correctness by sometimes de-opting to synchronous mode](ht
The effect of de-opting to sync mode is that the main thread may periodically be blocked (in the case of CPU-bound work), and placeholders may appear earlier than desired (in the case of IO-bound work).
For **full compatibility** with asynchronous rendering, including both **time-slicing** and **React Suspense**, the suggested longer-term solution is to move to one of the patterns described in the previous section.
For **full compatibility** with asynchronous rendering, including both **time-slicing** and **React Suspense**, the suggested longer term solution is to move to one of the patterns described in the previous section.
## What types of subscriptions can this support?

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,7 +1,7 @@
{
"name": "create-subscription",
"description": "utility for subscribing to external data sources inside React components",
"version": "16.6.0-alpha.8af6728",
"version": "16.4.1",
"repository": "facebook/react",
"files": [
"LICENSE",
@@ -10,7 +10,7 @@
"cjs/"
],
"peerDependencies": {
"react": "^16.3.0 || 16.6.0-alpha.8af6728"
"react": "^16.3.0"
},
"devDependencies": {
"rxjs": "^5.5.6"

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,12 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
import {rethrowCaughtError} from 'shared/ReactErrorUtils';
import ReactErrorUtils from 'shared/ReactErrorUtils';
import invariant from 'shared/invariant';
import {
@@ -224,7 +224,7 @@ export function runEventsInBatch(
'an event queue. Support for this has not yet been implemented.',
);
// This would be a good time to rethrow if any of the event handlers threw.
rethrowCaughtError();
ReactErrorUtils.rethrowCaughtError();
}
export function runExtractedEventsInBatch(

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,11 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {invokeGuardedCallbackAndCatchFirstError} from 'shared/ReactErrorUtils';
import ReactErrorUtils from 'shared/ReactErrorUtils';
import invariant from 'shared/invariant';
import warningWithoutStack from 'shared/warningWithoutStack';
@@ -13,22 +13,22 @@ export let getFiberCurrentPropsFromNode = null;
export let getInstanceFromNode = null;
export let getNodeFromInstance = null;
export function setComponentTree(
getFiberCurrentPropsFromNodeImpl,
getInstanceFromNodeImpl,
getNodeFromInstanceImpl,
) {
getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
getInstanceFromNode = getInstanceFromNodeImpl;
getNodeFromInstance = getNodeFromInstanceImpl;
if (__DEV__) {
warningWithoutStack(
getNodeFromInstance && getInstanceFromNode,
'EventPluginUtils.setComponentTree(...): Injected ' +
'module is missing getNodeFromInstance or getInstanceFromNode.',
);
}
}
export const injection = {
injectComponentTree: function(Injected) {
({
getFiberCurrentPropsFromNode,
getInstanceFromNode,
getNodeFromInstance,
} = Injected);
if (__DEV__) {
warningWithoutStack(
getNodeFromInstance && getInstanceFromNode,
'EventPluginUtils.injection.injectComponentTree(...): Injected ' +
'module is missing getNodeFromInstance or getInstanceFromNode.',
);
}
},
};
let validateEventDispatches;
if (__DEV__) {
@@ -67,7 +67,12 @@ if (__DEV__) {
function executeDispatch(event, simulated, listener, inst) {
const type = event.type || 'unknown-event';
event.currentTarget = getNodeFromInstance(inst);
invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(
type,
listener,
undefined,
event,
);
event.currentTarget = null;
}

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
@@ -14,7 +14,16 @@ import {
// Use to restore controlled state after a change event has fired.
let restoreImpl = null;
let fiberHostComponent = null;
const ReactControlledComponentInjection = {
injectFiberControlledHostComponent: function(hostComponentImpl) {
// The fiber implementation doesn't use dynamic dispatch so we need to
// inject the implementation.
fiberHostComponent = hostComponentImpl;
},
};
let restoreTarget = null;
let restoreQueue = null;
@@ -27,17 +36,20 @@ function restoreStateOfTarget(target) {
return;
}
invariant(
typeof restoreImpl === 'function',
'setRestoreImplementation() needs to be called to handle a target for controlled ' +
fiberHostComponent &&
typeof fiberHostComponent.restoreControlledState === 'function',
'Fiber needs to be injected to handle a fiber target for controlled ' +
'events. This error is likely caused by a bug in React. Please file an issue.',
);
const props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
restoreImpl(internalInstance.stateNode, internalInstance.type, props);
fiberHostComponent.restoreControlledState(
internalInstance.stateNode,
internalInstance.type,
props,
);
}
export function setRestoreImplementation(impl) {
restoreImpl = impl;
}
export const injection = ReactControlledComponentInjection;
export function enqueueStateRestore(target) {
if (restoreTarget) {

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
@@ -17,13 +17,13 @@ import {
// scheduled work and instead do synchronous work.
// Defaults
let _batchedUpdatesImpl = function(fn, bookkeeping) {
let _batchedUpdates = function(fn, bookkeeping) {
return fn(bookkeeping);
};
let _interactiveUpdatesImpl = function(fn, a, b) {
let _interactiveUpdates = function(fn, a, b) {
return fn(a, b);
};
let _flushInteractiveUpdatesImpl = function() {};
let _flushInteractiveUpdates = function() {};
let isBatching = false;
export function batchedUpdates(fn, bookkeeping) {
@@ -34,7 +34,7 @@ export function batchedUpdates(fn, bookkeeping) {
}
isBatching = true;
try {
return _batchedUpdatesImpl(fn, bookkeeping);
return _batchedUpdates(fn, bookkeeping);
} finally {
// Here we wait until all updates have propagated, which is important
// when using controlled components within layers:
@@ -46,26 +46,24 @@ export function batchedUpdates(fn, bookkeeping) {
// If a controlled event was fired, we may need to restore the state of
// the DOM node back to the controlled value. This is necessary when React
// bails out of the update without touching the DOM.
_flushInteractiveUpdatesImpl();
_flushInteractiveUpdates();
restoreStateIfNeeded();
}
}
}
export function interactiveUpdates(fn, a, b) {
return _interactiveUpdatesImpl(fn, a, b);
return _interactiveUpdates(fn, a, b);
}
export function flushInteractiveUpdates() {
return _flushInteractiveUpdatesImpl();
return _flushInteractiveUpdates();
}
export function setBatchingImplementation(
batchedUpdatesImpl,
interactiveUpdatesImpl,
flushInteractiveUpdatesImpl,
) {
_batchedUpdatesImpl = batchedUpdatesImpl;
_interactiveUpdatesImpl = interactiveUpdatesImpl;
_flushInteractiveUpdatesImpl = flushInteractiveUpdatesImpl;
}
export const injection = {
injectRenderer(renderer) {
_batchedUpdates = renderer.batchedUpdates;
_interactiveUpdates = renderer.interactiveUpdates;
_flushInteractiveUpdates = renderer.flushInteractiveUpdates;
},
};

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
@@ -9,24 +9,15 @@
'use strict';
const {HostComponent} = require('shared/ReactWorkTags');
const {HostComponent} = require('shared/ReactTypeOfWork');
let EventPluginHub;
let EventPluginUtils;
let ResponderEventPlugin;
const touch = function(nodeHandle, i) {
return {target: nodeHandle, identifier: i};
};
function injectComponentTree(ComponentTree) {
EventPluginUtils.setComponentTree(
ComponentTree.getFiberCurrentPropsFromNode,
ComponentTree.getInstanceFromNode,
ComponentTree.getNodeFromInstance,
);
}
/**
* @param {NodeHandle} nodeHandle @see NodeHandle. Handle of target.
* @param {Array<Touch>} touches All active touches.
@@ -402,9 +393,13 @@ describe('ResponderEventPlugin', () => {
beforeEach(() => {
jest.resetModules();
const ReactDOM = require('react-dom');
const ReactDOMUnstableNativeDependencies = require('react-dom/unstable-native-dependencies');
EventPluginHub = require('events/EventPluginHub');
EventPluginUtils = require('events/EventPluginUtils');
EventPluginHub =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.EventPluginHub;
const injectComponentTree =
ReactDOMUnstableNativeDependencies.injectComponentTree;
ResponderEventPlugin =
ReactDOMUnstableNativeDependencies.ResponderEventPlugin;

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.

Some files were not shown because too many files have changed in this diff Show More