Skip to content

Commit fe8779d

Browse files
committed
[change] babel-plugin option for style runtime
1 parent 7cb5800 commit fe8779d

File tree

5 files changed

+374
-119
lines changed

5 files changed

+374
-119
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,115 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
3+
exports[`[commonjs] Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
4+
5+
export { View } from 'react-native';
6+
export { StyleSheet, Text, unstable_createElement } from 'react-native';
7+
8+
↓ ↓ ↓ ↓ ↓ ↓
9+
10+
export { default as View } from 'react-native-web/dist/cjs/exports/View';
11+
export { default as StyleSheet } from 'react-native-web/dist/cjs/exports/StyleSheet';
12+
export { default as Text } from 'react-native-web/dist/cjs/exports/Text';
13+
export { default as unstable_createElement } from 'react-native-web/dist/cjs/exports/createElement';
14+
15+
16+
`;
17+
18+
exports[`[commonjs] Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
19+
20+
export { View } from 'react-native-web';
21+
export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
22+
23+
↓ ↓ ↓ ↓ ↓ ↓
24+
25+
export { default as View } from 'react-native-web/dist/cjs/exports/View';
26+
export { default as StyleSheet } from 'react-native-web/dist/cjs/exports/StyleSheet';
27+
export { default as Text } from 'react-native-web/dist/cjs/exports/Text';
28+
export { default as unstable_createElement } from 'react-native-web/dist/cjs/exports/createElement';
29+
30+
31+
`;
32+
33+
exports[`[commonjs] Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
34+
35+
import ReactNative from 'react-native';
36+
import { StyleSheet, View } from 'react-native';
37+
import { Invalid, View as MyView } from 'react-native';
38+
import { useLocaleContext } from 'react-native';
39+
import * as ReactNativeModules from 'react-native';
40+
41+
↓ ↓ ↓ ↓ ↓ ↓
42+
43+
import ReactNative from 'react-native-web/dist/cjs/index';
44+
import StyleSheet from 'react-native-web/dist/cjs/exports/StyleSheet';
45+
import View from 'react-native-web/dist/cjs/exports/View';
46+
import { Invalid } from 'react-native-web/dist/cjs/index';
47+
import MyView from 'react-native-web/dist/cjs/exports/View';
48+
import useLocaleContext from 'react-native-web/dist/cjs/exports/useLocaleContext';
49+
import * as ReactNativeModules from 'react-native-web/dist/cjs/index';
50+
51+
52+
`;
53+
54+
exports[`[commonjs] Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
55+
56+
import { unstable_createElement } from 'react-native-web';
57+
import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
58+
import * as ReactNativeModules from 'react-native-web';
59+
60+
↓ ↓ ↓ ↓ ↓ ↓
61+
62+
import unstable_createElement from 'react-native-web/dist/cjs/exports/createElement';
63+
import StyleSheet from 'react-native-web/dist/cjs/exports/StyleSheet';
64+
import View from 'react-native-web/dist/cjs/exports/View';
65+
import Pressable from 'react-native-web/dist/cjs/exports/Pressable';
66+
import processColor from 'react-native-web/dist/cjs/exports/processColor';
67+
import * as ReactNativeModules from 'react-native-web/dist/cjs/index';
68+
69+
70+
`;
71+
72+
exports[`[commonjs] Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
73+
74+
const ReactNative = require('react-native');
75+
const { View } = require('react-native');
76+
const { StyleSheet, Pressable } = require('react-native');
77+
78+
↓ ↓ ↓ ↓ ↓ ↓
79+
80+
const ReactNative = require('react-native-web/dist/cjs/index');
81+
const View = require('react-native-web/dist/cjs/exports/View').default;
82+
const StyleSheet =
83+
require('react-native-web/dist/cjs/exports/StyleSheet').default;
84+
const Pressable =
85+
require('react-native-web/dist/cjs/exports/Pressable').default;
86+
87+
88+
`;
89+
90+
exports[`[commonjs] Rewrite react-native to react-native-web require "react-native-web": require "react-native-web" 1`] = `
91+
92+
const ReactNative = require('react-native-web');
93+
const { unstable_createElement } = require('react-native-web');
94+
const { StyleSheet, View, Pressable, processColor } = require('react-native-web');
95+
96+
↓ ↓ ↓ ↓ ↓ ↓
97+
98+
const ReactNative = require('react-native-web/dist/cjs/index');
99+
const unstable_createElement =
100+
require('react-native-web/dist/cjs/exports/createElement').default;
101+
const StyleSheet =
102+
require('react-native-web/dist/cjs/exports/StyleSheet').default;
103+
const View = require('react-native-web/dist/cjs/exports/View').default;
104+
const Pressable =
105+
require('react-native-web/dist/cjs/exports/Pressable').default;
106+
const processColor =
107+
require('react-native-web/dist/cjs/exports/processColor').default;
108+
109+
110+
`;
111+
112+
exports[`[legacy] Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
4113
5114
export { View } from 'react-native';
6115
export { StyleSheet, Text, unstable_createElement } from 'react-native';
@@ -15,7 +124,7 @@ export { default as unstable_createElement } from 'react-native-web/dist/exports
15124
16125
`;
17126

18-
exports[`Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
127+
exports[`[legacy] Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
19128
20129
export { View } from 'react-native-web';
21130
export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
@@ -30,17 +139,18 @@ export { default as unstable_createElement } from 'react-native-web/dist/exports
30139
31140
`;
32141

33-
exports[`Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
142+
exports[`[legacy] Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
34143
35144
import ReactNative from 'react-native';
36-
import { View } from 'react-native';
145+
import { StyleSheet, View } from 'react-native';
37146
import { Invalid, View as MyView } from 'react-native';
38147
import { useLocaleContext } from 'react-native';
39148
import * as ReactNativeModules from 'react-native';
40149
41150
↓ ↓ ↓ ↓ ↓ ↓
42151
43152
import ReactNative from 'react-native-web/dist/index';
153+
import StyleSheet from 'react-native-web/dist/exports/StyleSheet';
44154
import View from 'react-native-web/dist/exports/View';
45155
import { Invalid } from 'react-native-web/dist/index';
46156
import MyView from 'react-native-web/dist/exports/View';
@@ -50,25 +160,7 @@ import * as ReactNativeModules from 'react-native-web/dist/index';
50160
51161
`;
52162

53-
exports[`Rewrite react-native to react-native-web import from "react-native": import from "react-native" 2`] = `
54-
55-
import ReactNative from 'react-native';
56-
import { View } from 'react-native';
57-
import { Invalid, View as MyView } from 'react-native';
58-
import * as ReactNativeModules from 'react-native';
59-
60-
↓ ↓ ↓ ↓ ↓ ↓
61-
62-
import ReactNative from 'react-native-web/dist/cjs/index';
63-
import View from 'react-native-web/dist/cjs/exports/View';
64-
import { Invalid } from 'react-native-web/dist/cjs/index';
65-
import MyView from 'react-native-web/dist/cjs/exports/View';
66-
import * as ReactNativeModules from 'react-native-web/dist/cjs/index';
67-
68-
69-
`;
70-
71-
exports[`Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
163+
exports[`[legacy] Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
72164
73165
import { unstable_createElement } from 'react-native-web';
74166
import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
@@ -86,7 +178,7 @@ import * as ReactNativeModules from 'react-native-web/dist/index';
86178
87179
`;
88180

89-
exports[`Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
181+
exports[`[legacy] Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
90182
91183
const ReactNative = require('react-native');
92184
const { View } = require('react-native');
@@ -102,20 +194,97 @@ const Pressable = require('react-native-web/dist/exports/Pressable').default;
102194
103195
`;
104196

105-
exports[`Rewrite react-native to react-native-web require "react-native": require "react-native" 2`] = `
197+
exports[`[legacy] Rewrite react-native to react-native-web require "react-native-web": require "react-native-web" 1`] = `
198+
199+
const ReactNative = require('react-native-web');
200+
const { unstable_createElement } = require('react-native-web');
201+
const { StyleSheet, View, Pressable, processColor } = require('react-native-web');
202+
203+
↓ ↓ ↓ ↓ ↓ ↓
204+
205+
const ReactNative = require('react-native-web/dist/index');
206+
const unstable_createElement =
207+
require('react-native-web/dist/exports/createElement').default;
208+
const StyleSheet = require('react-native-web/dist/exports/StyleSheet').default;
209+
const View = require('react-native-web/dist/exports/View').default;
210+
const Pressable = require('react-native-web/dist/exports/Pressable').default;
211+
const processColor =
212+
require('react-native-web/dist/exports/processColor').default;
213+
214+
215+
`;
216+
217+
exports[`Rewrite react-native to react-native-web export from "react-native": export from "react-native" 1`] = `
218+
219+
export { View } from 'react-native';
220+
export { StyleSheet, Text, unstable_createElement } from 'react-native';
221+
222+
↓ ↓ ↓ ↓ ↓ ↓
223+
224+
export { View } from 'react-native';
225+
export { StyleSheet, Text, unstable_createElement } from 'react-native';
226+
227+
228+
`;
229+
230+
exports[`Rewrite react-native to react-native-web export from "react-native-web": export from "react-native-web" 1`] = `
231+
232+
export { View } from 'react-native-web';
233+
export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
234+
235+
↓ ↓ ↓ ↓ ↓ ↓
236+
237+
export { View } from 'react-native-web';
238+
export { StyleSheet, Text, unstable_createElement } from 'react-native-web';
239+
240+
241+
`;
242+
243+
exports[`Rewrite react-native to react-native-web import from "react-native": import from "react-native" 1`] = `
244+
245+
import ReactNative from 'react-native';
246+
import { StyleSheet, View } from 'react-native';
247+
import { Invalid, View as MyView } from 'react-native';
248+
import { useLocaleContext } from 'react-native';
249+
import * as ReactNativeModules from 'react-native';
250+
251+
↓ ↓ ↓ ↓ ↓ ↓
252+
253+
import ReactNative from 'react-native';
254+
import { View } from 'react-native';
255+
import { Invalid, View as MyView } from 'react-native';
256+
import { useLocaleContext } from 'react-native';
257+
import * as ReactNativeModules from 'react-native';
258+
259+
260+
`;
261+
262+
exports[`Rewrite react-native to react-native-web import from "react-native-web": import from "react-native-web" 1`] = `
263+
264+
import { unstable_createElement } from 'react-native-web';
265+
import { StyleSheet, View, Pressable, processColor } from 'react-native-web';
266+
import * as ReactNativeModules from 'react-native-web';
267+
268+
↓ ↓ ↓ ↓ ↓ ↓
269+
270+
import { unstable_createElement } from 'react-native-web';
271+
import { View, Pressable, processColor } from 'react-native-web';
272+
import * as ReactNativeModules from 'react-native-web';
273+
274+
275+
`;
276+
277+
exports[`Rewrite react-native to react-native-web require "react-native": require "react-native" 1`] = `
106278
107279
const ReactNative = require('react-native');
108280
const { View } = require('react-native');
109281
const { StyleSheet, Pressable } = require('react-native');
110282
111283
↓ ↓ ↓ ↓ ↓ ↓
112284
113-
const ReactNative = require('react-native-web/dist/cjs/index');
114-
const View = require('react-native-web/dist/cjs/exports/View').default;
115-
const StyleSheet =
116-
require('react-native-web/dist/cjs/exports/StyleSheet').default;
117-
const Pressable =
118-
require('react-native-web/dist/cjs/exports/Pressable').default;
285+
const ReactNative = require('react-native');
286+
const { View } = require('react-native');
287+
const { StyleSheet, Pressable } = require('react-native');
119288
120289
121290
`;
@@ -128,14 +297,14 @@ const { StyleSheet, View, Pressable, processColor } = require('react-native-web'
128297
129298
↓ ↓ ↓ ↓ ↓ ↓
130299
131-
const ReactNative = require('react-native-web/dist/index');
132-
const unstable_createElement =
133-
require('react-native-web/dist/exports/createElement').default;
134-
const StyleSheet = require('react-native-web/dist/exports/StyleSheet').default;
135-
const View = require('react-native-web/dist/exports/View').default;
136-
const Pressable = require('react-native-web/dist/exports/Pressable').default;
137-
const processColor =
138-
require('react-native-web/dist/exports/processColor').default;
300+
const ReactNative = require('react-native-web');
301+
const { unstable_createElement } = require('react-native-web');
302+
const {
303+
StyleSheet,
304+
View,
305+
Pressable,
306+
processColor
307+
} = require('react-native-web');
139308
140309
141310
`;

0 commit comments

Comments
 (0)