diff --git a/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap b/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap
index 62166c18f4..3a81278d70 100644
--- a/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap
+++ b/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap
@@ -1,6 +1,115 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
+exports[`[commonjs] Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
+
+export { View } from 'react-native';
+export { StyleSheet, Text, unstable_createElement } from 'react-native';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+export { default as View } from 'react-native-web/dist/cjs/exports/View';
+export { default as StyleSheet } from 'react-native-web/dist/cjs/exports/StyleSheet';
+export { default as Text } from 'react-native-web/dist/cjs/exports/Text';
+export { default as unstable_createElement } from 'react-native-web/dist/cjs/exports/createElement';
+
+
+`;
+
+exports[`[commonjs] Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
+
+export { View } from 'react-native-web';
+export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+export { default as View } from 'react-native-web/dist/cjs/exports/View';
+export { default as StyleSheet } from 'react-native-web/dist/cjs/exports/StyleSheet';
+export { default as Text } from 'react-native-web/dist/cjs/exports/Text';
+export { default as unstable_createElement } from 'react-native-web/dist/cjs/exports/createElement';
+
+
+`;
+
+exports[`[commonjs] Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
+
+import ReactNative from 'react-native';
+import { StyleSheet, View } from 'react-native';
+import { Invalid, View as MyView } from 'react-native';
+import { useLocaleContext } from 'react-native';
+import * as ReactNativeModules from 'react-native';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+import ReactNative from 'react-native-web/dist/cjs/index';
+import StyleSheet from 'react-native-web/dist/cjs/exports/StyleSheet';
+import View from 'react-native-web/dist/cjs/exports/View';
+import { Invalid } from 'react-native-web/dist/cjs/index';
+import MyView from 'react-native-web/dist/cjs/exports/View';
+import useLocaleContext from 'react-native-web/dist/cjs/exports/useLocaleContext';
+import * as ReactNativeModules from 'react-native-web/dist/cjs/index';
+
+
+`;
+
+exports[`[commonjs] Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
+
+import { unstable_createElement } from 'react-native-web';
+import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
+import * as ReactNativeModules from 'react-native-web';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+import unstable_createElement from 'react-native-web/dist/cjs/exports/createElement';
+import StyleSheet from 'react-native-web/dist/cjs/exports/StyleSheet';
+import View from 'react-native-web/dist/cjs/exports/View';
+import Pressable from 'react-native-web/dist/cjs/exports/Pressable';
+import processColor from 'react-native-web/dist/cjs/exports/processColor';
+import * as ReactNativeModules from 'react-native-web/dist/cjs/index';
+
+
+`;
+
+exports[`[commonjs] Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
+
+const ReactNative = require('react-native');
+const { View } = require('react-native');
+const { StyleSheet, Pressable } = require('react-native');
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+const ReactNative = require('react-native-web/dist/cjs/index');
+const View = require('react-native-web/dist/cjs/exports/View').default;
+const StyleSheet =
+ require('react-native-web/dist/cjs/exports/StyleSheet').default;
+const Pressable =
+ require('react-native-web/dist/cjs/exports/Pressable').default;
+
+
+`;
+
+exports[`[commonjs] Rewrite react-native to react-native-web require "react-native-web": require "react-native-web" 1`] = `
+
+const ReactNative = require('react-native-web');
+const { unstable_createElement } = require('react-native-web');
+const { StyleSheet, View, Pressable, processColor } = require('react-native-web');
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+const ReactNative = require('react-native-web/dist/cjs/index');
+const unstable_createElement =
+ require('react-native-web/dist/cjs/exports/createElement').default;
+const StyleSheet =
+ require('react-native-web/dist/cjs/exports/StyleSheet').default;
+const View = require('react-native-web/dist/cjs/exports/View').default;
+const Pressable =
+ require('react-native-web/dist/cjs/exports/Pressable').default;
+const processColor =
+ require('react-native-web/dist/cjs/exports/processColor').default;
+
+
+`;
+
+exports[`[legacy] Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
export { View } from 'react-native';
export { StyleSheet, Text, unstable_createElement } from 'react-native';
@@ -15,7 +124,7 @@ export { default as unstable_createElement } from 'react-native-web/dist/exports
`;
-exports[`Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
+exports[`[legacy] Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
export { View } from 'react-native-web';
export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
@@ -30,10 +139,10 @@ export { default as unstable_createElement } from 'react-native-web/dist/exports
`;
-exports[`Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
+exports[`[legacy] Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
import ReactNative from 'react-native';
-import { View } from 'react-native';
+import { StyleSheet, View } from 'react-native';
import { Invalid, View as MyView } from 'react-native';
import { useLocaleContext } from 'react-native';
import * as ReactNativeModules from 'react-native';
@@ -41,6 +150,7 @@ import * as ReactNativeModules from 'react-native';
↓ ↓ ↓ ↓ ↓ ↓
import ReactNative from 'react-native-web/dist/index';
+import StyleSheet from 'react-native-web/dist/exports/StyleSheet';
import View from 'react-native-web/dist/exports/View';
import { Invalid } from 'react-native-web/dist/index';
import MyView from 'react-native-web/dist/exports/View';
@@ -50,25 +160,7 @@ import * as ReactNativeModules from 'react-native-web/dist/index';
`;
-exports[`Rewrite react-native to react-native-web import from "react-native": import from "react-native" 2`] = `
-
-import ReactNative from 'react-native';
-import { View } from 'react-native';
-import { Invalid, View as MyView } from 'react-native';
-import * as ReactNativeModules from 'react-native';
-
- ↓ ↓ ↓ ↓ ↓ ↓
-
-import ReactNative from 'react-native-web/dist/cjs/index';
-import View from 'react-native-web/dist/cjs/exports/View';
-import { Invalid } from 'react-native-web/dist/cjs/index';
-import MyView from 'react-native-web/dist/cjs/exports/View';
-import * as ReactNativeModules from 'react-native-web/dist/cjs/index';
-
-
-`;
-
-exports[`Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
+exports[`[legacy] Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
import { unstable_createElement } from 'react-native-web';
import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
@@ -86,7 +178,7 @@ import * as ReactNativeModules from 'react-native-web/dist/index';
`;
-exports[`Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
+exports[`[legacy] Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
const ReactNative = require('react-native');
const { View } = require('react-native');
@@ -102,7 +194,89 @@ const Pressable = require('react-native-web/dist/exports/Pressable').default;
`;
-exports[`Rewrite react-native to react-native-web require "react-native": require "react-native" 2`] = `
+exports[`[legacy] Rewrite react-native to react-native-web require "react-native-web": require "react-native-web" 1`] = `
+
+const ReactNative = require('react-native-web');
+const { unstable_createElement } = require('react-native-web');
+const { StyleSheet, View, Pressable, processColor } = require('react-native-web');
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+const ReactNative = require('react-native-web/dist/index');
+const unstable_createElement =
+ require('react-native-web/dist/exports/createElement').default;
+const StyleSheet = require('react-native-web/dist/exports/StyleSheet').default;
+const View = require('react-native-web/dist/exports/View').default;
+const Pressable = require('react-native-web/dist/exports/Pressable').default;
+const processColor =
+ require('react-native-web/dist/exports/processColor').default;
+
+
+`;
+
+exports[`Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
+
+export { View } from 'react-native';
+export { StyleSheet, Text, unstable_createElement } from 'react-native';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+export { View } from 'react-native';
+export { StyleSheet, Text, unstable_createElement } from 'react-native';
+
+
+`;
+
+exports[`Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
+
+export { View } from 'react-native-web';
+export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+export { View } from 'react-native-web';
+export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
+
+
+`;
+
+exports[`Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
+
+import ReactNative from 'react-native';
+import { StyleSheet, View } from 'react-native';
+import { Invalid, View as MyView } from 'react-native';
+import { useLocaleContext } from 'react-native';
+import * as ReactNativeModules from 'react-native';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+import ReactNative from 'react-native';
+import StyleSheet from 'react-native-web/dist/exports/StyleSheet/runtime';
+import { View } from 'react-native';
+import { Invalid, View as MyView } from 'react-native';
+import { useLocaleContext } from 'react-native';
+import * as ReactNativeModules from 'react-native';
+
+
+`;
+
+exports[`Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
+
+import { unstable_createElement } from 'react-native-web';
+import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
+import * as ReactNativeModules from 'react-native-web';
+
+ ↓ ↓ ↓ ↓ ↓ ↓
+
+import { unstable_createElement } from 'react-native-web';
+import StyleSheet from 'react-native-web/dist/exports/StyleSheet/runtime';
+import { View, Pressable, processColor } from 'react-native';
+import * as ReactNativeModules from 'react-native-web';
+
+
+`;
+
+exports[`Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
const ReactNative = require('react-native');
const { View } = require('react-native');
@@ -110,12 +284,9 @@ const { StyleSheet, Pressable } = require('react-native');
↓ ↓ ↓ ↓ ↓ ↓
-const ReactNative = require('react-native-web/dist/cjs/index');
-const View = require('react-native-web/dist/cjs/exports/View').default;
-const StyleSheet =
- require('react-native-web/dist/cjs/exports/StyleSheet').default;
-const Pressable =
- require('react-native-web/dist/cjs/exports/Pressable').default;
+const ReactNative = require('react-native');
+const { View } = require('react-native');
+const { StyleSheet, Pressable } = require('react-native');
`;
@@ -128,14 +299,14 @@ const { StyleSheet, View, Pressable, processColor } = require('react-native-web'
↓ ↓ ↓ ↓ ↓ ↓
-const ReactNative = require('react-native-web/dist/index');
-const unstable_createElement =
- require('react-native-web/dist/exports/createElement').default;
-const StyleSheet = require('react-native-web/dist/exports/StyleSheet').default;
-const View = require('react-native-web/dist/exports/View').default;
-const Pressable = require('react-native-web/dist/exports/Pressable').default;
-const processColor =
- require('react-native-web/dist/exports/processColor').default;
+const ReactNative = require('react-native-web');
+const { unstable_createElement } = require('react-native-web');
+const {
+ StyleSheet,
+ View,
+ Pressable,
+ processColor
+} = require('react-native-web');
`;
diff --git a/packages/babel-plugin-react-native-web/src/__tests__/index-test.js b/packages/babel-plugin-react-native-web/src/__tests__/index-test.js
index 9ef0377913..0f0368c67f 100644
--- a/packages/babel-plugin-react-native-web/src/__tests__/index-test.js
+++ b/packages/babel-plugin-react-native-web/src/__tests__/index-test.js
@@ -1,69 +1,86 @@
const plugin = require('..');
const pluginTester = require('babel-plugin-tester').default;
-const tests = [
- // import react-native
- {
- title: 'import from "react-native"',
- code: `import ReactNative from 'react-native';
-import { View } from 'react-native';
+function createTests(pluginOptions) {
+ return [
+ // import react-native
+ {
+ title: 'import from "react-native"',
+ code: `import ReactNative from 'react-native';
+import { StyleSheet, View } from 'react-native';
import { Invalid, View as MyView } from 'react-native';
import { useLocaleContext } from 'react-native';
import * as ReactNativeModules from 'react-native';`,
- snapshot: true
- },
- {
- title: 'import from "react-native"',
- code: `import ReactNative from 'react-native';
-import { View } from 'react-native';
-import { Invalid, View as MyView } from 'react-native';
-import * as ReactNativeModules from 'react-native';`,
- snapshot: true,
- pluginOptions: { commonjs: true }
- },
- {
- title: 'import from "react-native-web"',
- code: `import { unstable_createElement } from 'react-native-web';
+ snapshot: true,
+ pluginOptions
+ },
+ {
+ title: 'import from "react-native-web"',
+ code: `import { unstable_createElement } from 'react-native-web';
import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
import * as ReactNativeModules from 'react-native-web';`,
- snapshot: true
- },
- {
- title: 'export from "react-native"',
- code: `export { View } from 'react-native';
+ snapshot: true,
+ pluginOptions
+ },
+ {
+ title: 'export from "react-native"',
+ code: `export { View } from 'react-native';
export { StyleSheet, Text, unstable_createElement } from 'react-native';`,
- snapshot: true
- },
- {
- title: 'export from "react-native-web"',
- code: `export { View } from 'react-native-web';
+ snapshot: true,
+ pluginOptions
+ },
+ {
+ title: 'export from "react-native-web"',
+ code: `export { View } from 'react-native-web';
export { StyleSheet, Text, unstable_createElement } from 'react-native-web';`,
- snapshot: true
- },
- // require react-native
- {
- title: 'require "react-native"',
- code: `const ReactNative = require('react-native');
+ snapshot: true,
+ pluginOptions
+ },
+ // require react-native
+ {
+ title: 'require "react-native"',
+ code: `const ReactNative = require('react-native');
const { View } = require('react-native');
const { StyleSheet, Pressable } = require('react-native');`,
- snapshot: true
- },
- {
- title: 'require "react-native"',
- code: `const ReactNative = require('react-native');
-const { View } = require('react-native');
-const { StyleSheet, Pressable } = require('react-native');`,
- snapshot: true,
- pluginOptions: { commonjs: true }
- },
- {
- title: 'require "react-native-web"',
- code: `const ReactNative = require('react-native-web');
+ snapshot: true,
+ pluginOptions
+ },
+ {
+ title: 'require "react-native-web"',
+ code: `const ReactNative = require('react-native-web');
const { unstable_createElement } = require('react-native-web');
const { StyleSheet, View, Pressable, processColor } = require('react-native-web');`,
- snapshot: true
- }
-];
+ snapshot: true,
+ pluginOptions
+ }
+ ];
+}
+
+pluginTester({
+ babelOptions: {
+ generatorOpts: {
+ jsescOption: {
+ quotes: 'single'
+ }
+ }
+ },
+ plugin,
+ pluginName: '[legacy] Rewrite react-native to react-native-web',
+ tests: createTests({})
+});
+
+pluginTester({
+ babelOptions: {
+ generatorOpts: {
+ jsescOption: {
+ quotes: 'single'
+ }
+ }
+ },
+ plugin,
+ pluginName: '[commonjs] Rewrite react-native to react-native-web',
+ tests: createTests({ commonjs: true })
+});
pluginTester({
babelOptions: {
@@ -75,5 +92,5 @@ pluginTester({
},
plugin,
pluginName: 'Rewrite react-native to react-native-web',
- tests
+ tests: createTests({ legacy: false })
});
diff --git a/packages/babel-plugin-react-native-web/src/index.js b/packages/babel-plugin-react-native-web/src/index.js
index 17230a85ab..dcb6533212 100644
--- a/packages/babel-plugin-react-native-web/src/index.js
+++ b/packages/babel-plugin-react-native-web/src/index.js
@@ -42,36 +42,64 @@ module.exports = function ({ types: t }) {
ImportDeclaration(path, state) {
const { specifiers } = path.node;
if (isReactNativeModule(path.node)) {
- const imports = specifiers
- .map((specifier) => {
- if (t.isImportSpecifier(specifier)) {
- const importName = specifier.imported.name;
- const distLocation = getDistLocation(importName, state.opts);
+ if (state.opts.legacy !== false) {
+ const imports = specifiers
+ .map((specifier) => {
+ if (t.isImportSpecifier(specifier)) {
+ const importName = specifier.imported.name;
+ const distLocation = getDistLocation(importName, state.opts);
- if (distLocation) {
- return t.importDeclaration(
- [
- t.importDefaultSpecifier(
- t.identifier(specifier.local.name)
- )
- ],
- t.stringLiteral(distLocation)
- );
+ if (distLocation) {
+ return t.importDeclaration(
+ [
+ t.importDefaultSpecifier(
+ t.identifier(specifier.local.name)
+ )
+ ],
+ t.stringLiteral(distLocation)
+ );
+ }
}
- }
- return t.importDeclaration(
- [specifier],
- t.stringLiteral(getDistLocation('index', state.opts))
- );
- })
- .filter(Boolean);
+ return t.importDeclaration(
+ [specifier],
+ t.stringLiteral(getDistLocation('index', state.opts))
+ );
+ })
+ .filter(Boolean);
- path.replaceWithMultiple(imports);
+ path.replaceWithMultiple(imports);
+ } else {
+ const styleSheetSpecifierIndex = specifiers.findIndex(
+ (specifier) =>
+ specifier.imported && specifier.imported.name === 'StyleSheet'
+ );
+ if (styleSheetSpecifierIndex !== -1) {
+ const otherSpecifiers = [
+ ...specifiers.slice(0, styleSheetSpecifierIndex),
+ ...specifiers.slice(styleSheetSpecifierIndex + 1)
+ ];
+
+ const newImports = [
+ t.importDeclaration(
+ [t.importDefaultSpecifier(t.identifier('StyleSheet'))],
+ t.stringLiteral(
+ 'react-native-web/dist/exports/StyleSheet/runtime'
+ )
+ ),
+ t.importDeclaration(
+ otherSpecifiers,
+ t.stringLiteral('react-native')
+ )
+ ];
+
+ path.replaceWithMultiple(newImports);
+ }
+ }
}
},
ExportNamedDeclaration(path, state) {
const { specifiers } = path.node;
- if (isReactNativeModule(path.node)) {
+ if (isReactNativeModule(path.node) && state.opts.legacy !== false) {
const exports = specifiers
.map((specifier) => {
if (t.isExportSpecifier(specifier)) {
@@ -104,7 +132,7 @@ module.exports = function ({ types: t }) {
}
},
VariableDeclaration(path, state) {
- if (isReactNativeRequire(t, path.node)) {
+ if (isReactNativeRequire(t, path.node) && state.opts.legacy !== false) {
const { id } = path.node.declarations[0];
if (t.isObjectPattern(id)) {
const imports = id.properties
diff --git a/packages/react-native-web-examples/pages/image/index.js b/packages/react-native-web-examples/pages/image/index.js
index 086a21a674..623f46c77a 100644
--- a/packages/react-native-web-examples/pages/image/index.js
+++ b/packages/react-native-web-examples/pages/image/index.js
@@ -15,6 +15,18 @@ const dataBase64Svg =
'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjAwJyBoZWlnaHQ9JzIwMCcgZmlsbD0iIzAwMDAwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDEwMCAxMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwYXRoIGQ9Ik0yNS44NjcsNDguODUzQzMyLjgwNiw1MC4xNzYsNDYuNDYsNTIuNSw2MS4yMTUsNTIuNWgwLjAwNWM5LjcxLDAsMTguNDAxLTEuMDU3LDI1LjkzOC0yLjkxMyAgIGMwLjE1OS0wLjA0NiwwLjM1LTAuMTM1LDAuNTY1LTAuMT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LjAyMiwwLjAzNS0wLjAyOCwwLjA1NkMwLjgzMywyOC40MjMsMS42OTEsMjguMzksMi4wOCwyOC4zMDh6IE0xMC40OTMsMTkuOTA4ICAgYzEuOTU2LDAsMy41NDgsMS41OTEsMy41NDgsMy41NDdjMCwxLjk1Ny0xLjU5MiwzLjU0OC0zLjU0OCwzLjU0OGMtMS45NTcsMC0zLjU0OC0xLjU5Mi0zLjU0OC0zLjU0OCAgIEM2Ljk0NCwyMS40OTksOC41MzYsMTkuOTA4LDEwLjQ5MywxOS45MDh6Ij48L3BhdGg+PC9nPjwvc3ZnPg==';
const dataSvg =
'data:image/svg+xml;utf8,';
+const sourceWithHeaders = {
+ uri: placeholder,
+ headers: {
+ 'x-token': '0012345'
+ }
+};
+const sourceWithHeadersAndRedirect = {
+ uri: source,
+ headers: {
+ 'x-token': '0012345'
+ }
+};
function Divider() {
return