react-native-unistyles 3.0.0-alpha.10 → 3.0.0-alpha.12
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/core/HostStyle.h +1 -1
- package/cxx/core/Unistyle.h +7 -4
- package/cxx/core/UnistyleWrapper.h +19 -1
- package/cxx/core/UnistylesCommitHook.cpp +3 -4
- package/cxx/core/UnistylesCommitHook.h +3 -2
- package/cxx/core/UnistylesMountHook.cpp +3 -4
- package/cxx/core/UnistylesMountHook.h +3 -2
- package/cxx/core/UnistylesRegistry.cpp +24 -36
- package/cxx/core/UnistylesRegistry.h +4 -7
- package/cxx/core/UnistylesState.cpp +1 -1
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +9 -9
- package/cxx/hybridObjects/HybridStyleSheet.cpp +6 -0
- package/cxx/hybridObjects/HybridStyleSheet.h +3 -3
- package/cxx/parser/Parser.cpp +36 -40
- package/cxx/parser/Parser.h +1 -1
- package/cxx/shadowTree/ShadowLeafUpdate.h +1 -1
- package/cxx/shadowTree/ShadowTreeManager.cpp +3 -8
- package/lib/commonjs/specs/ShadowRegistry/index.js +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +1 -1
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/__tests__/dependencies.spec.js +15 -5
- package/plugin/__tests__/ref.spec.js +209 -30
- package/plugin/__tests__/stylesheet.spec.js +27 -9
- package/plugin/index.js +38 -3
- package/plugin/ref.js +41 -11
- package/plugin/style.js +45 -1
- package/src/specs/ShadowRegistry/index.ts +2 -2
@@ -16,6 +16,7 @@ pluginTester({
|
|
16
16
|
{
|
17
17
|
title: 'Should detect dependencies in variants',
|
18
18
|
code: `
|
19
|
+
import { View, Text } from 'react-native'
|
19
20
|
import { StyleSheet } from 'react-native-unistyles'
|
20
21
|
|
21
22
|
export const Example = () => {
|
@@ -44,12 +45,13 @@ pluginTester({
|
|
44
45
|
`,
|
45
46
|
output: `
|
46
47
|
import { UnistylesShadowRegistry } from 'react-native-unistyles'
|
48
|
+
import { View, Text } from 'react-native'
|
47
49
|
import { StyleSheet } from 'react-native-unistyles'
|
48
50
|
|
49
51
|
export const Example = () => {
|
50
52
|
return (
|
51
53
|
<View
|
52
|
-
style={styles.container}
|
54
|
+
style={[styles.container]}
|
53
55
|
ref={ref => {
|
54
56
|
UnistylesShadowRegistry.add(ref, styles.container, undefined, undefined)
|
55
57
|
return () => UnistylesShadowRegistry.remove(ref, styles.container)
|
@@ -82,6 +84,7 @@ pluginTester({
|
|
82
84
|
{
|
83
85
|
title: 'Should detect dependencies in breakpoints',
|
84
86
|
code: `
|
87
|
+
import { View, Text } from 'react-native'
|
85
88
|
import { StyleSheet } from 'react-native-unistyles'
|
86
89
|
|
87
90
|
export const Example = () => {
|
@@ -105,12 +108,13 @@ pluginTester({
|
|
105
108
|
`,
|
106
109
|
output: `
|
107
110
|
import { UnistylesShadowRegistry } from 'react-native-unistyles'
|
111
|
+
import { View, Text } from 'react-native'
|
108
112
|
import { StyleSheet } from 'react-native-unistyles'
|
109
113
|
|
110
114
|
export const Example = () => {
|
111
115
|
return (
|
112
116
|
<View
|
113
|
-
style={styles.container}
|
117
|
+
style={[styles.container]}
|
114
118
|
ref={ref => {
|
115
119
|
UnistylesShadowRegistry.add(ref, styles.container, undefined, undefined)
|
116
120
|
return () => UnistylesShadowRegistry.remove(ref, styles.container)
|
@@ -140,6 +144,7 @@ pluginTester({
|
|
140
144
|
{
|
141
145
|
title: 'Should detect dependencies in calculations',
|
142
146
|
code: `
|
147
|
+
import { View, Text } from 'react-native'
|
143
148
|
import { StyleSheet } from 'react-native-unistyles'
|
144
149
|
|
145
150
|
export const Example = () => {
|
@@ -160,12 +165,13 @@ pluginTester({
|
|
160
165
|
`,
|
161
166
|
output: `
|
162
167
|
import { UnistylesShadowRegistry } from 'react-native-unistyles'
|
168
|
+
import { View, Text } from 'react-native'
|
163
169
|
import { StyleSheet } from 'react-native-unistyles'
|
164
170
|
|
165
171
|
export const Example = () => {
|
166
172
|
return (
|
167
173
|
<View
|
168
|
-
style={styles.container}
|
174
|
+
style={[styles.container]}
|
169
175
|
ref={ref => {
|
170
176
|
UnistylesShadowRegistry.add(ref, styles.container, undefined, undefined)
|
171
177
|
return () => UnistylesShadowRegistry.remove(ref, styles.container)
|
@@ -192,6 +198,7 @@ pluginTester({
|
|
192
198
|
{
|
193
199
|
title: 'Should detect dependencies in _web',
|
194
200
|
code: `
|
201
|
+
import { View, Text } from 'react-native'
|
195
202
|
import { StyleSheet } from 'react-native-unistyles'
|
196
203
|
|
197
204
|
export const Example = () => {
|
@@ -273,12 +280,13 @@ pluginTester({
|
|
273
280
|
`,
|
274
281
|
output: `
|
275
282
|
import { UnistylesShadowRegistry } from 'react-native-unistyles'
|
283
|
+
import { View, Text } from 'react-native'
|
276
284
|
import { StyleSheet } from 'react-native-unistyles'
|
277
285
|
|
278
286
|
export const Example = () => {
|
279
287
|
return (
|
280
288
|
<View
|
281
|
-
style={styles.container}
|
289
|
+
style={[styles.container]}
|
282
290
|
ref={ref => {
|
283
291
|
UnistylesShadowRegistry.add(ref, styles.container, undefined, undefined)
|
284
292
|
return () => UnistylesShadowRegistry.remove(ref, styles.container)
|
@@ -371,6 +379,7 @@ pluginTester({
|
|
371
379
|
{
|
372
380
|
title: 'Should allow user to use arrow functions with body for dynamic functions',
|
373
381
|
code: `
|
382
|
+
import { View, Text } from 'react-native'
|
374
383
|
import { StyleSheet } from 'react-native-unistyles'
|
375
384
|
|
376
385
|
export const Example = () => {
|
@@ -398,12 +407,13 @@ pluginTester({
|
|
398
407
|
`,
|
399
408
|
output: `
|
400
409
|
import { UnistylesShadowRegistry } from 'react-native-unistyles'
|
410
|
+
import { View, Text } from 'react-native'
|
401
411
|
import { StyleSheet } from 'react-native-unistyles'
|
402
412
|
|
403
413
|
export const Example = () => {
|
404
414
|
return (
|
405
415
|
<View
|
406
|
-
style={styles.container}
|
416
|
+
style={[styles.container]}
|
407
417
|
ref={ref => {
|
408
418
|
UnistylesShadowRegistry.add(ref, styles.container, undefined, undefined)
|
409
419
|
return () => UnistylesShadowRegistry.remove(ref, styles.container)
|