Commit Graph

36 Commits

Author SHA1 Message Date
Nicolas Gallagher
174b8f505a Update prettier and reformat source code 2022-07-03 17:37:19 -07:00
Nicolas Gallagher
abad4b045d Fix package publishing script
074861623e changed the workspace
configuration with the result that 'react-native-web' appeared twice in
the array of workspaces, causing an attempt to republish the package
during the release task.
2022-07-03 12:04:13 -07:00
Nicolas Gallagher
50e267b0aa Publish only updates react-native-web packages
The script to release react-native-web is now limited to version-locking
related packages, not every package in the monorepo.
2022-07-02 12:02:15 -07:00
Nicolas Gallagher
f81095442f Reorganize monorepo structure
* Move all config files to './configs'
* Simplify './scripts' folder.
2022-07-02 12:01:01 -07:00
Nicolas Gallagher
fa10c75daf Update npm publish script with OTP support 2022-06-14 10:46:31 -07:00
Nicolas Gallagher
8034a57aae Minor fixes
Close #2264
Close #2275
2022-06-10 10:13:14 -07:00
Nicolas Gallagher
9b0c1193a2 [change] Remove jest preset
Also add node-based unit tests for SSR APIs.
2022-03-02 10:50:04 -08:00
Nicolas Gallagher
b27c9820db [change] StyleSheet rewrite
* Improves React Native compatibility by making StyleSheet.create the identify function.
* Improves React 18 support by inserting styles on eval.
* Supports use with multiple windows (i.e., iframes) and shadow roots.
* Supports nested LTR/RTL layouts.
* Supports 3rd party compilers and extraction to static CSS.
* Fixes static and dynamic short/longform deduplication.
* Reduces browser support: Safari 10.1+, Chromium Edge, no IE, no legacy Android browsers.
* Removes automatic vendor-prefixing of inline styles (for better perf).
* Removes focus-visible polyfill as modern browsers no longer show focus rings for mouse interactions.

Close #2208
Fix #2138
Fix #2196
Fix #2007
Fix #1517
2022-03-02 10:50:04 -08:00
Nicolas Gallagher
89cf78d529 [change] Fix the Dimensions.window value
Fixes issues in Safari from using window.innerWidth. Using
documentElement.clientWidth doesn't have issues and provides a more practical
value for the canvas width that excludes the width of scrollbars.

Fix #1369
Fix #1905
2021-04-20 10:44:46 -07:00
Nicolas Gallagher
a5d6cd51ef Update prettier and reformat code 2021-02-11 14:58:05 -08:00
Nicolas Gallagher
7e724b279d Remove enzyme 2020-06-26 14:51:42 -07:00
Nicolas Gallagher
a2cccaf528 [change] Add usePlatformMethods to implement instance methods
A hook equivalent for implementing "native methods" on refs to elements backed
by function components.
2020-06-02 10:55:43 -07:00
Nicolas Gallagher
3d53273fe7 Update internal paths to docs 2020-02-06 13:38:38 -08:00
Nicolas Gallagher
297cda7901 Rewrite interactive documentation
Consolidate all docs within the latest storybook

Ref #1172
2019-11-12 15:19:48 -08:00
Nicolas Gallagher
02a3640f95 Update test tools 2019-10-08 13:06:17 -07:00
Nicolas Gallagher
d554d83727 [change] Text uses createContext
Replaces the legacy 'contextTypes' API.
Removes 'enzyme' from related tests. Back to recording DOM snapshots.

Close #1248
Ref #1172
2019-10-04 11:37:25 -07:00
Nicolas Gallagher
25dd43e960 [change] Update vendor code
* FlatList
* SectionList
* VirtualizedList
* VirtualizedSectionList
2019-10-04 11:37:22 -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
77d4bd8a97 [change] Compile using Babel 7
Fix #1170
Close #1205
Close #1191
2019-01-22 18:48:28 -08:00
Nicolas Gallagher
d5f5dbccdb [fix] inline-style-prefixer API update
Fix #1217
2018-12-31 17:22:05 -08:00
Nicolas Gallagher
8f0c39c2fe [change] introduce Jest preset
A simple Jest preset that configures module mapping and produces
human-readable styles (i.e., not converted to numeric form).

Fix #928
Fix #963
2018-06-04 11:40:07 -07:00
Nicolas Gallagher
4f9216853b Add more paths to jest ignore 2018-06-04 11:40:07 -07:00
Nicolas Gallagher
206a236df2 [add] AccessibilityInfo and DeviceInfo stubs 2018-05-29 11:04:27 -07:00
Nicolas Gallagher
61bf7e76b0 [fix] CommonJS exports can be imported without 'default'
Make sure all the CommonJS modules can be required as normal, rather
than needing to be suffixed with `.default` due to being compiled from
ES modules.
2018-05-29 11:04:24 -07:00
Nicolas Gallagher
004c7ce478 [change] export ES modules by default
ES modules are the default package export. Commonjs modules are exported
from 'dist/cjs'. Modern bundlers like webpack can consume ES modules.
The addition of the `sideEffects:false` to the `package.json` helps
webpack tree-shaking modules.
2018-05-18 17:27:36 -07:00
Nicolas Gallagher
1e59e53e66 Update jest 2018-05-08 09:49:02 -07:00
Nicolas Gallagher
a53372ceb3 [fix] babel-plugin only rewrites paths for known modules
Don't rewrite import paths for non-existent modules or types. They will
attempt to be imported from the package's main export. This change
currently requires a module map to be generated for the babel-plugin to
use. The map is automatically regenerated for any commit that alters the
entry file of react-native-web.

Fix #822
2018-02-19 13:05:42 -08:00
Nicolas Gallagher
e5adc5a37c Add 'coveragePathIgnorePatterns' to jest config 2018-02-17 18:03:36 -08:00
Nicolas Gallagher
96eecc0da3 Replace lerna with custom script
Each package version is now updated with each release.

Fix #783
2018-02-06 16:30:03 -08:00
Nicolas Gallagher
0721245b3e Patch release script
Disable husky on version commit. Current publish script doesn't account
for attempts to republish the same version.
2018-01-17 19:15:23 -08:00
Nicolas Gallagher
7f45c52ce7 Update to inline-style-prefixer@4.0.0 2018-01-08 18:31:36 -08:00
Nicolas Gallagher
209bd3aee1 [fix] babel-plugin support for 'react-native-web' module name
Now rewrites import/export/require statements from 'react-native-web'.
Install the plugin in the 'benchmarks' package.
2018-01-01 12:01:22 -08:00
Nicolas Gallagher
bff3f50ae0 Fix release script 2017-12-30 18:42:35 -08:00
Nicolas Gallagher
3026465ae3 Monorepo
Introduces a monorepo structure, relies on yarn workspaces to share
dependencies, and lerna for syncing versions across the monorepo.

* Create 2 workspaces:
    'packages' and 'website'
* Create 2 public packages:
    'babel-plugin-react-native-web' and 'react-native-web'
* Create 1 private package:
    'benchmarks'

A simple release script runs the tests, builds the package assets,
increments the package version numbers, git commits and tags, publishes
the package to npm, pushes the changes to github, and releases the
website update.

Close #657
2017-12-24 12:33:41 +00:00
Nicolas Gallagher
0a84ccb299 [fix] IE10 flexbox support
Add prefixes for flexbox (and other) support in IE10.

Ref #650
2017-09-21 14:18:11 -07:00
Nicolas Gallagher
092d5d12f7 [fix] unitless values for vendor prefixed properties
Problem:

Numeric values are suffixed with 'px', unless the property supports
unitless values. However, vendor prefixed properties were ignored
resulting in invalid CSS values for properties like
'-webkit-flex-shrink'.

Solution:

Apply the upstream solution from React, which includes vendor prefixed
properties in the "unitless number" map. Also build a custom vendor
prefixer to ensure adequate browser support (i.e., Safari 7 and older
Chrome).
2017-07-26 15:51:46 -07:00