Commit Graph

8982 Commits

Author SHA1 Message Date
Sophie Alpert
16a39b8f02 Remove "const" in uncompiled code (#10631)
Test Plan: All fixtures/packaging iframes display correctly on Chrome 38.0.2125.0 from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/290001/; previously several were blank with "Use of const in strict mode" errors logged to the console.
2017-09-06 20:32:15 -07:00
Sophie Alpert
d8ecc4c2b5 Update .mailmap 2017-09-06 16:58:21 -07:00
Flarnie Marchan
49c8d717a0 16.0.0-rc.1 (#10630) v16.0.0-rc.1 2017-09-06 15:43:22 -07:00
Flarnie Marchan
b5a1c2281d Add missing dependencies in art fixture, update yarn.lock (#10628)
* Add missing dependencies in `art` fixture, update `yarn.lock`

**what is the change?:**
See title

**why make this change?:**
We want the `art` fixture to be working so that we can test the latest
version of `react-art`.

**test plan:**
Built and inspected the fixture manually

**issue:**
Prepping for 16.0RC release - https://github.com/facebook/react/issues/10623

* ran prettier
2017-09-06 15:37:09 -07:00
Brian Vaughn
abce30f771 React native event type fixes (#10627)
* Added invariant check for native dispatching an unsupported event type
This prevents a case of a silent failure when native dispatches an event that JavaScript does not know how to handle.

* Added iOS direct event type 'onSnapshotReady'
This is used for snapshot testing.
2017-09-06 15:34:02 -07:00
Sophie Alpert
7ff922cf2a Pull in react-art/lib/{Circle,Rectangle,Wedge}.art (#10629)
* Import react-art/lib/{Circle,Rectangle,Wedge}.art

Copied from react-art@0.15.1 built files.

* Changes to built files to make ART shapes work

Test Plan: Opened the fixture. React logo shows up with its normal dot, now rendered by a `<Circle />`.
2017-09-06 15:10:14 -07:00
Flarnie Marchan
4a351eacdd Update to latest allowed versions of fbjs and prop-types (#10626)
**what is the change?:**
Updates to the latest allowed versions for two dependencies.

`yarn upgrade 'fbjs@^0.8.9'`
and
`yarn upgrade 'prop-types@^15.5.8'`

**why make this change?:**
Prepping for the 16.0 RC, we want to have a reproducible build that is
as close as possible to what new users will get when installing React.

**test plan:**
`yarn && yarn build && yarn test`

**issue:**
https://github.com/facebook/react/issues/10623
2017-09-06 14:29:23 -07:00
Flarnie Marchan
8e4654015a Update error codes and results.json (#10619)
* Update results.json

**what is the change?:**
Ran the build after updating Yarn lockfile and recorded latest build
size results.

**why make this change?:**
Let's get an idea of bundle size at this point, when we are preparing
the 16.0 RC.

**test plan:**
NA

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

* Update error codes

https://github.com/facebook/react/tree/master/scripts/release-manager#update-the-error-codes
2017-09-06 11:11:19 -07:00
Dan Abramov
faf186b235 Generate Markdown table from attribute fixture (#10595)
* Generate Markdown table

* Check in generated table

* Add fast mode

* Fix lint
2017-09-06 16:00:52 +01:00
Daniel Rotter
5f12867824 Add AgentConf 2018 (#10614)
* Add AgentConf 2018

We are having another edition of the AgentConf in 2018, which has again a strong focus on react, and we'll be skiing again 😎 Last year's PR for reference: https://github.com/facebook/react/pull/8196

* Update conferences.md
2017-09-06 08:56:36 -04:00
Andrew Clark
47d87028a7 Moar attribute tests (#10509)
* WIP

* WIP Add the rest of the tests for what we expect re: unknown attributes

**what is the change?:**
Adds tests for the following behavior -

- Numbers and booleans should be converted to strings, and not warn
- NaN, Symbols, functions, and objects should be converted to strings,
  and *should* warn

Going to add tests for the not-warning behavior in a follow-up.

These tests are not entirely passing - we either need to change what we
expect or change the behavior.

**why make this change?:**
Gets everyone on the same page about expected behavior, and codifies it
in a maintainable way

**test plan:**
`yarn test src/renderers/dom/shared/__tests__/ReactDOMAttribute-test.js`

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

* WIP Add check that we *don't* warn when handling some unknown attributes

**what is the change?:**
We are testing the behavior of unknown attributes, which has changed
since React 15.

We want to *not* warn for the following cases -
- null
- undefined
- missing
- strings
- numbers
- booleans

**why make this change?:**
We want to verify that warnings don't get fired at the wrong time.

**test plan:**
`yarn test src/renderers/dom/shared/__tests__/ReactDOMAttribute-test.js`

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

* ran prettier

* Symbols and functions passed to unknown attributes should remove and warn

* Abstract tests a bit to make them easier to read

* Remove Markdown from test names

I don't think we use this convention anywhere.

* Add an assertion for NaN warning message

* Update ReactDOMAttribute test based on attribute fixture

**what is the change?:**
- booleans don't get stringified
- some warnings have changed since we originally wrote this

**why make this change?:**
The attribute behavior is finalized and now we can test it :D

I also found it handy to have a row with a truly unknown attribute, so
added "imaginaryFriend".

**test plan:**
`yarn test src/renderers/dom/shared/__tests__/ReactDOMAttribute-test.js`
and comparing the tests to the attribute table

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

* remove imaginaryFriend to resolve conflict

* ran prettier
2017-09-05 11:25:23 -07:00
David Beitey
89edcf2388 Fix minor typo in Firefox name (#10605) 2017-09-05 10:28:54 -07:00
Nikita Lebedev
a8845587a3 Fix typo in script function name (#10611) 2017-09-05 10:28:34 -07:00
Dan Abramov
3f6e8d2803 Fix warning deduplication in attribute table (#10594)
* Fix warning deduplication by eval-ing React

* Move checkbox to the left

* Fix alphabetical sort

* Fix the pooling logic

* Avoid false positive warning due to controlled/uncontrolled switch

* Naming: 15 => Stable, 16 => Next

* Prettier

* Add "Save" button
2017-09-01 18:37:45 -07:00
Brandon Dail
80411ea9b4 Default to first non-disabled option for select elements (#10456)
* Default to first non-disabled option for select

Instead of defaulting to the first option for a select element, which could be a disabled option, we find the first non-disabled option available while we looping through the options. If no option matches, set the first non-disabled option as selected.

* Add ReactDOMSelect test for defaulting to non-disabled options

* Add test fixtures to cover disabled selected options

* Fix bad merge
2017-09-01 13:34:28 -07:00
Eric Nakagawa
f6ceacdd44 Adding Crowdin config file to master repo (#10579)
* Adding Crowdin config file to master repo

* Updated to include additional files while ignoring localized community files stored on github

* Additional files ignored

* Included additional files in root docs directory
2017-09-01 11:33:18 -07:00
Dan Abramov
9f772abdc6 Update sizes 2017-08-31 22:35:42 -07:00
Dan Abramov
fdf9d32a2e Ensure attribute table server-renders SVG inside SVG container (#10588) 2017-08-31 18:41:50 -07:00
Dan Abramov
55209c8cc9 Don't treat dashed SVG tags as custom elements (#10586) 2017-08-31 18:24:23 -07:00
Dan Abramov
de05d2eded Remove disableNewFiberFeatures flag (#10585) 2017-08-31 18:23:08 -07:00
Andrew Clark
edc9c2fc70 [attribute-behavior] Canonicalize values immediately after reading them (#10584)
In case they are mutated
2017-08-31 16:46:44 -07:00
Brian Vaughn
e34ac7c066 Embed ReactNative event types in JavaScript (#10567)
* ReactNative doesn't query UIManager for native event types
This is a pre-req to unblock Prepack optimiations for ReactNative apps
* Replaced mock ReactNativeEventTypes with mock Platform
* Added Platform.OS to RN host hooks Flow types
2017-08-31 15:27:54 -07:00
Brian Vaughn
8bd5b489b4 Defer reading native view config from UIManager until view is used (#10569)
* ReactNative supports lazy view registration
Don't react viewConfig from UIManager when a view is registered, but only when it is used for the first time. This will help unblock Prepack optimizations for RN views.

* Added new lazy-creation method for native views
Also exposed the native view config registry to allow invalid/unsupported host components to fall back to RCTView

* Removed ReactNativeViewConfigRegistry from RN __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
After discussion with Spencer Ahrens and Andy Street, it seems the early fallback behavior was mostly for the early days of Ads Manager when Android didn't yet support a lot of the view types. It should be okay now to use an invarient/redbox instead for unsupported views.

* Removed non-lazy createReactNativeComponentClass impl
There are only a handful of components with JavaScript-defined view configs. It's probably worth making them use the new lazy/async interface as well to be more consistent.
2017-08-31 13:42:27 -07:00
Nathan Hunzaker
c1dbc8e470 Changes to attribute whitelist logic (#10564)
* Remove HTMLPropertyConfig entries for non-boolean values

When we originally removed attributes from the whitelist, we assumed a
few attributes were string booleans, but they are not:

Autocomplete ("on", "off")
https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#autocomplete

Autocapitalize ("none", "sentence", "words", ...)
https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#autocapitalize

Autocorrect ("on", "off")
https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#autocorrect

Autosave (string)
https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#autosave

* Only HAS_BOOLEAN_VALUE attribute flag can assign booleans

* Use a non-boolean attribute in object assignment tests

* Add HAS_STRING_BOOLEAN_VALUE attribute flag

* Fix boolean tests, add boolean warning.

* Reserved props should allow booleans

* Remove outdated comments

* Style tweaks

* Don't treat dashed SVG tags as custom elements

* SVG elements like font-face are not custom attributes

- Adds exceptions to isCustomAttribute for dashed SVG elements
- Use consistent custom element check across all modules

* Move namespace check to isCustomAttribute. Add caveat for stack.

* Remove unused namespace variable assignment

* Fix the DEV-only whitelist

* Don't read property twice

* Ignore and warn about non-string `is` attribute

* Blacklist "aria" and "data" attributes

* Don't pass unknown on* attributes through

* Remove dead code

* Avoid accessing namespace when possible

* Drop .only in ReactDOMComponent-test

* Make isCustomComponent logic more solid

* Do attribute name check earlier

* Fix fbjs import

* Revert unintentional edit

* Re-allow "data" attribute

We intentionally allowed it.

* Use stricter check when attaching events

* Pass SVG boolean attributes with correct casing

* Fix the test

* Undo the SVG dashed-name fix

Per conversation with @sebmarkbage we decided that the fix is too complicated, and it's unfortunate it depends on the DOM element.
It's only relevant for super rare tags that aren't even working consistently across browsers so we'll leave it unfixed for now.

* Prettier

* Fix lint

* Fix flow

* Pass "aria" through but still warn

* Remove special cases for onfocusin, onfocusout

They're covered by event handler code now.

* Add a more specific warning for unknown events

* Pass badly cased React attributes through with warning
2017-08-30 18:28:55 -07:00
Andrew Clark
a6e34cc25f Track nested updates per root (#10574)
We track nested updates to simulate a stack overflow error and prevent
infinite loops. Every time we commit a tree, we increment a counter.
This works if you only have one tree, but if you update many separate
trees, it creates a false negative.

The fix is to reset the counter whenever we switch trees.
2017-08-30 18:17:48 -07:00
Andrew Clark
88a079d5c2 [attribute-behavior] Track differences between DOM and server renderer (#10575)
* Load ReactDOMServer into attribute table

* Highlight differences between DOM and server renderer

* Use SSR behavior when comparing behavior across renderers

* Use less severe color if SSR differences are only due to warnings

* Ensure result node's tagName matches what's expected

* Throw on unexpected HTMLUnknownElement
2017-08-30 18:17:31 -07:00
Jason Quense
1924c28a54 Update issue template with PropTypes package (#10578)
Adds `prop-types` to the template
2017-08-30 16:35:29 -04:00
Brian Vaughn
5ee72dcd82 Add --sync-www flag to build script (#10571) 2017-08-30 09:38:14 -07:00
Brian Vaughn
99171321c3 Lint command fails if there are any warnings (#10572)
You get a lint failure! You get a lint failure! Eeeeverybody gets a lint failure!
2017-08-30 08:03:17 -07:00
Brian Vaughn
cd52f7ed80 Fixed lint error in ReactErrorUtils-test (#10570) 2017-08-29 17:54:36 -07:00
Tyler Deitz
f5547ee372 Update reference-events.md (#10554) 2017-08-29 08:11:45 -07:00
Andrew Clark
dd9db8b9d2 Add ability to "complete" rows and store state in localStorage (#10562)
* Add ability to "complete" rows and store state in localStorage

* Sort groups based on size

Also: include tagName and containerTagName in info object.

* Tweak sort order
2017-08-28 19:44:26 -06:00
Dan Abramov
2add1ed1b9 Fix {false} test in attribute table 2017-08-28 16:31:08 -07:00
Dan Abramov
c813c82e45 More consistent hashing (#10561) 2017-08-28 16:39:19 -06:00
Dan Abramov
ed0ceb4f07 Disable hasOwnProperty test in attribute table (#10560) 2017-08-28 15:46:38 -06:00
Brian Vaughn
d8d7edde5d Upgrade flow-bin to 0.53.1 (#10510)
* Update flow-bin to 0.53.1

* Ran flow-upgrade utility
Manually corrected a few over-eager cases where it tried to replace our ReactElement sub-type.

* Replaced a couple of React.Element types with React

* Removed temporary ReactComponent/ReactComponent Flow types

* Prettier

* Replaced React with React based on Dan's PR feedback
2017-08-28 14:39:58 -07:00
Dan Abramov
ebb5a33ec2 Tweak attribute whitelist table (#10559)
* Move null and undefined to the end

* Highlight attributes with changes
2017-08-28 15:13:35 -06:00
Sebastian Markbåge
575cfadf3e Read SVG properties instead of attributes where applicable (#10549)
Also canonicalize object results (since these SVG properties are objects).

The canonicalized format is what we compare against.

(This will cause unknown objects to show up as unchanged.)
2017-08-28 14:11:32 -07:00
Mitermayer Reis
7f78749ee3 Updating param flow type definition (#10558) 2017-08-28 11:06:56 -07:00
zombieJ
c282a8ef4f Refactor ensureUpdateQueues to avoid returning a tuple (#10437)
* remove tuple

* clean up

* prettier code

* Use module-level varibles
2017-08-28 11:04:28 -07:00
Mitermayer Reis
a7c479b3e9 Fixing incorrect documentation tags (#10530) 2017-08-26 16:53:37 -07:00
Flarnie Marchan
c0a41196e6 [attribute-behavior] Add alphabetical and rev-alphabetical sorting (#10546)
* Add alphabetical and rev-alphabetical sorting

This is just an initial convenient way to jump to the top or bottom of
the list.

Next we will add a sorting which groups rows together if their behavior
pattern is the same.

* Add sorting to group the rows by behavior pattern

**what is the change?:**
Another sorting option - if the content of a row is the same, it takes
those rows and groups them together.

**why make this change?:**
This will help us find groups of attributes that behave similarly.

**test plan:**
manual testing

* rename variable to be more clear
2017-08-25 18:03:25 -07:00
Sebastian Markbåge
d7fcdd9c7a Use proper SVG tags for all SVG attributes and read using a special function (#10545) 2017-08-25 17:27:07 -07:00
Andrew Clark
b9c8e4e9df Remove UMD builds from fixture directory (#10547) 2017-08-25 17:17:31 -07:00
Andrew Clark
be9d982e8f [attribute-behavior] Use development builds of React and ReactDOM (#10544)
Enables warning detection.

Start-up is noticeably slower, but after that the perf is about the same.
2017-08-25 15:44:37 -07:00
Andrew Clark
2d5c4542df Update eslintignore and prettier config to ignore UMD builds of React 2017-08-25 11:35:43 -07:00
Andrew Clark
e421df8151 Add basic popover with additional information 2017-08-25 11:35:43 -07:00
Andrew Clark
87a32314ae Delete vestigial CRA files 2017-08-25 10:43:47 -07:00
Andrew Clark
5fd942a03c Move attribite-behavior to fixtures 2017-08-25 10:40:09 -07:00
Andrew Clark
b775e74e4e Use monospace font-family 2017-08-25 10:37:46 -07:00