1365 Commits

Author SHA1 Message Date
Nicolas Gallagher 801937748b 0.11.2 0.11.2 2019-03-22 10:02:44 -07:00
Nicolas Gallagher 9cbe387d9f [fix] CSS insertion in Edge browser
Edge browser throws `HierarchyRequestError` while inserting CSS rules into CSS
Media Queries. Therefore, a different mechanism is required to control CSS
order. This patch tracks the starting index of each group of CSS rules in the
DOM style sheet.

Fix #1300
Close #1302
2019-03-22 09:58:18 -07:00
Nicolas Gallagher c1459d7b21 Remove '!important' check from setValueForStyles
'!important' styles are no longer used internally and are not supported in the
public API.
2019-03-19 10:32:59 -07:00
Mathieu Acthernoene 36dacb2052 [change] Update flow-bin to 0.95.1
Fix related type errors

Close #1269

Co-authored-by: Nicolas Gallagher <nicolasgallagher@gmail.com>
2019-03-18 13:00:05 -07:00
Nicolas Gallagher b732cec83e Fix copyright headers 2019-03-18 11:13:17 -07:00
Nicolas Gallagher ad78fc7a38 0.11.1 0.11.1 2019-03-15 14:08:24 -07:00
Nicolas Gallagher 33e54c755b [fix] StyleSheet SSR of classic CSS
Hack something together to get classic CSS going through the same pathway as
the rest of the styles. This gets classic CSS showing up in the SSR CSS output.

Fix #1286
2019-03-15 10:20:56 -07:00
Paul Armstrong 74a36a2a4e [fix] Jest preset module export
Export the preset as a module so that paths can be resolved relative to a Jest
config file.

Close #1290
2019-03-15 10:07:56 -07:00
Nicolas Gallagher 8d1f5afead Fix website Image examples
Remove use of 'resizeMode' static, which is no longer supported.
2019-03-14 14:20:25 -07:00
Nicolas Gallagher 763e2d4001 0.11.0 0.11.0 2019-03-12 17:45:10 -07:00
Nicolas Gallagher f507410ab4 [fix] Schema prop types
Ref 34427897f3
2019-03-12 17:43:22 -07:00
Nicolas Gallagher 97372d7e4c Update benchmark results for 0.11.0 2019-03-12 17:30:10 -07:00
Nicolas Gallagher 9872c97169 Remove whitespace from CSS rules
Minimizes bytes from CSS code that might be inlined in the head of the document
during SSR.
2019-03-12 13:53:48 -07:00
Nicolas Gallagher d50f6304dc [change] Add className prop deprecation warning
View and Text will not support the 'className' prop in a future release.

Fix #1146
2019-03-12 13:00:57 -07:00
Nicolas Gallagher 330895534d [change] CSS class prefix 'rn' -> 'r' 2019-03-12 13:00:57 -07:00
Nicolas Gallagher 0e302a50d2 [change] Refactor style resolver
Minor refactor of the style resolver to convert it to a factory function.
2019-03-12 13:00:57 -07:00
Nicolas Gallagher f048d848a1 [change] Replace outline with outline{Color,Style,Width} styles
Rather than mix shortform and longform properties, the 'outline' property is
removed in favour of the longform properties. Support for `outlineOffset` is
also included.

Fix #1255
Close #1256
2019-03-12 13:00:57 -07:00
Nicolas Gallagher c68b532696 [change] StyleSheet validation
Stop relying on React internals and propTypes validation.
2019-03-12 13:00:57 -07:00
Nicolas Gallagher d4417e93a3 [change] Use classic CSS in View, Text, etc., implementations
The CSS base styles for certain primitives are implemented using classic CSS to
reduce browser layout times and better support 'null' values in
StyleSheet-defined styles. Combined with the previous patch this reduces the
benchmark layout times by about 30%.

Ref #1136
Fix #1044
Fix #1223
Fix #13
2019-03-12 13:00:57 -07:00
Nicolas Gallagher 9f860b8dfc [change] StyleSheet: compile styles directly to CSS
Introduces a centralized compiler for "atomic" and "classic" CSS output. The
"classic" compiler is for internal use only and offers no CSS safety
guarantees. The "atomic compiler is used to implement the public-facing
StyleSheet API.

The atomic compiler now maps the React style declarations, rather than CSS
style declarations, to CSS rules. This avoids having to convert React styles to
CSS styles before being able to lookup classNames. And it reduces the number of
CSS rules needed by each DOM element.

Before:

    { paddingHorizontal: 0; }
        ↓
    .paddingLeft-0 { padding-left: 0; }
    .paddingRight-0 { padding-right: 0; }

After:

    { paddingHorizontal: 0; }
        ↓
    .paddingHorizontal-0 { padding-left: 0; padding-right: 0 }

Overview of previous StyleSheet resolver:

1. Localise styles
2. Transform to CSS styles
3. Expand short-form properties
4a. Lookup Atomic CSS for each declaration
4b. Compile Atomic CSS for each static declaration
  i. Vendor prefix
  ii. Insert CSS rules
4c. Create inline style for each dynamic-only declaration
  i. Vendor prefix

Overview of new StyleSheet design:

1. Localise styles
2a. Lookup Atomic CSS for each declaration
2b. Compile Atomic CSS for each static declarations
  i. Transform to CSS styles
  ii. Expand short-form properties
  iii. Vendor prefix
  iiii. Insert CSS rules
2c. Create inline style for each dynamic-only declaration
  i. Transform to CSS styles
  ii. Expand short-form properties
  iii. Vendor prefix

Ref #1136
2019-03-12 13:00:57 -07:00
Nicolas Gallagher 29be779f77 [change] CSS insertion by OrderedCSSStyleSheet
`OrderedCSSStyleSheet` can be used to control the order in which CSS rules are
inserted. This feature is necessary to support the combined use of Classic CSS
and Atomic CSS. It also makes it possible to control the order of Atomic CSS
rules, which is necessary to correctly resolve style conflicts (e.g., between
'margin' and 'marginHorizontal') without expanding short-form properties to
long-form properties.

Ref #1136
2019-03-12 13:00:57 -07:00
Evan Bacon 2a418bed0c [change] Organize unimplemented modules in directories
Creates a {path}/index.js for each module that has no web
implementation. This enables the babel preset to rewrite all paths and
prevent apps from bundling unused modules.

Fix #1281
Close #1282
2019-03-11 21:13:16 -07:00
Nicolas Gallagher 5e9449e893 Update benchmark libraries 2019-03-11 20:17:29 -07:00
Alec Winograd 67979b7282 [add] TextInput support for "onContentSizeChange"
Fix #793
Close #1226
2019-03-11 14:14:13 -07:00
Nicolas Gallagher 3d3ea9aeed [change] Remove ART export
Anticipate the removal of ART from React Native core:
https://github.com/facebook/react-native/issues/23313

Simplifies dependencies and builds for web apps.

Close #1251
2019-03-11 13:33:49 -07:00
Nicolas Gallagher 69bd0f631d [change] Remove default ES Module export
Remove the default export that was provided for compatibility with legacy
imports of React Native CommonJS modules. These patterns are no longer
supported:

```
import ReactNative from 'react-native';
const ReactNative = require('react-native');
```

Fix #1258
Close #1277
2019-03-11 13:12:24 -07:00
Evan Bacon 9ce2b5bf0c [fix] NativeEventEmitter implementation
Close #1275
2019-03-08 13:06:19 -08:00
Hiroki Sato cf7b020c5d [fix] set textShadow if only blur and color provided
Mirrors a recent fix to React Native.

Close #1182
2019-03-08 12:42:36 -08:00
Nicolas Gallagher 49edcb291e [change] remove 'resizeMode' static from 'Image'
Use strings instead of the 'Image.resizeMode' static. Corresponding change in React Native:

https://github.com/facebook/react-native/commit/870775e
2019-03-08 12:40:59 -08:00
Nicolas Gallagher 6a84d74185 0.10.1 0.10.1 2019-03-07 11:32:33 -08:00
Nicolas Gallagher 282cb34054 Fix npm publish errors 2019-03-07 11:31:50 -08:00
Wyatt Greenway 421cb095f7 [fix] PickerItem cyclic dependency
Close #1270
2019-03-07 11:06:48 -08:00
Nicolas Gallagher 0c08ba3a7d [fix] Text support for accessibilityRole="none"
Fix #1262
2019-03-07 11:02:57 -08:00
Nicolas Gallagher e4c3a21c42 [fix] TextInput autoComplete="off"
Browsers treat autoComplete "off" as "on". The fix is to provide the browser
with an unrecognized value so that it doesn't attempt to auto-fill the input.

Fix #1249
2019-03-07 10:58:27 -08:00
Nicolas Gallagher 34427897f3 [add] Support for Schema prop types
View and Text forward Schema prop types to host DOM node.
https://schema.org/docs/gs.html

Fix #1247
2019-03-07 10:50:34 -08:00
Dan Alloway 63868b492d Fix project scripts in Windows environments
Close #1252
2019-03-01 14:49:55 -08:00
Nicolas Gallagher 8ce5750d34 0.10.0 0.10.0 2019-01-30 14:13:58 -08:00
Nicolas Gallagher eb77062608 Remove unnecessary snapshot tests
Remove snapshots that were unnecessarily recording generated CSS output.
2019-01-22 18:48:29 -08:00
Nicolas Gallagher b6fc6f228e Add new Text render benchmark 2019-01-22 18:48:29 -08:00
Nicolas Gallagher 6c725357ff Add a note about referrer tracking 2019-01-22 18:48:29 -08:00
atp dce5b7321d [add] Text support for wordBreak style
Close #1200
2019-01-22 18:48:29 -08:00
Nicolas Gallagher 52ca784680 Use default array sort function 2019-01-22 18:48:29 -08:00
Nicolas Gallagher 244b0e4425 Don't print AppRegistry message in unit tests 2019-01-22 18:48:29 -08:00
Nicolas Gallagher 21c3931b69 [fix] use getBoundingClientRect to measure layout
Fix #1037
Fix #1151
2019-01-22 18:48:29 -08:00
Nicolas Gallagher e696e637bd [add] support backdropFilter style
Close #1070
2019-01-22 18:48:29 -08:00
Nicolas Gallagher b62a7bf44d Update webpack for examples 2019-01-22 18:48:29 -08:00
Nicolas Gallagher 69d1da4560 Update eslint 2019-01-22 18:48:29 -08:00
Nicolas Gallagher 8925bf76af [change] implement TextInput without e.which
e.which is considered deprecated and should be replaced with e.key.

Fix #1190
Close #1193
2019-01-22 18:48:28 -08:00
Nicolas Gallagher 77d4bd8a97 [change] Compile using Babel 7
Fix #1170
Close #1205
Close #1191
2019-01-22 18:48:28 -08:00
Nicolas Gallagher 4040151ee6 [add] support for accessibilityRole and accessibilityStates
React Native 0.57 introduced 'accessibilityRole' and
'accessibilityStates' as cross-platform accessibility APIs to replace
'accessibilityComponentType' and 'accessibilityTraits' for Android and
iOS.

React Native for Web has supported the 'accessibilityRole' for a while.
This patch maps some of the values defined in React Native to web
equivalents, and continues to allow a larger selection of roles for web
apps. It also adds support for 'accessibilityStates', mapping values to
ARIA states with boolean values and expanding support beyond 'disabled'
and 'selected'.

Fix #1112
Close #1113
2019-01-22 18:48:25 -08:00