Skip to content

Removed Platform.web#23830

Closed
EvanBacon wants to merge 1 commit intofacebook:masterfrom
EvanBacon:@evanbacon/expo-web/revert-internals
Closed

Removed Platform.web#23830
EvanBacon wants to merge 1 commit intofacebook:masterfrom
EvanBacon:@evanbacon/expo-web/revert-internals

Conversation

@EvanBacon
Copy link
Copy Markdown
Contributor

Summary

Initially if a react-native-web project were to use a library that required internals @expo/webpack-config would polyfill those internals. This Platform.web was used for cases where react-native modules needed other internal react-native modules, ex: Animated/src/AnimatedEvent -> Renderer/shims/ReactNative -> Renderer/oss/ReactNativeRenderer-dev -> Core/InitializeCore -> Devtools/setupDevtools -> WebSocket/WebSocket -> Utilities/Platform

The consensus is that if any react-native library references a react-native internal (ex: react-native/*), it should continue to throw errors. We've removed the use of internals from all of the Unimodules, react-navigation, and react-native-gesture-handler. This covers a wide enough area for a lot of projects to get web support.

Changelog

[GENERAL] [REMOVED] - Platform.web.js

Test Plan

Nothing should be effected given the @expo/webpack-config hasn't been released to the public yet.

Initially if a `react-native-web` project were to use a library that required internals `@expo/webpack-config` would polyfill those internals. This `Platform` was used for cases where react-native modules needed other internal `react-native` modules, ex: `Animated/src/AnimatedEvent -> Renderer/shims/ReactNative -> Renderer/oss/ReactNativeRenderer-dev -> Core/InitializeCore -> Devtools/setupDevtools -> WebSocket/WebSocket -> Utilities/Platform`

The consensus is that if any react-native library references a react-native internal (ex: `react-native/*`), it should continue to throw errors. We've removed the use of internals from all of the Unimodules, `react-navigation`, and `react-native-gesture-handler`. This covers a wide enough area for a lot of projects to get web support.

* Add emitters for libs referencing internals necolas/react-native-web#1275
* Remove monkey patch that bundles RN, libs that use internals will crash instead expo/expo-cli#409
* Remove all unsupported internals and polyfills from the Expo suite expo/expo#3676
* Remove internals from react-native-gesture-handler software-mansion/react-native-gesture-handler#406
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner labels Mar 9, 2019
Copy link
Copy Markdown
Contributor

@matthargett matthargett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Mar 11, 2019
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @EvanBacon in 05d5eeb.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added Merged This PR has been merged. and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants