react-native-css 3.1.0-rc.0 → 3.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/commonjs/babel/helpers.js +7 -0
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +12 -6
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +2 -2
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +2 -2
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +15 -1
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +1 -1
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +2 -1
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +11 -3
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +16 -3
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/warnings.js +135 -0
- package/dist/commonjs/metro/warnings.js.map +1 -0
- package/dist/commonjs/native/api.js +1 -1
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +15 -2
- package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/native/reactivity.js +30 -3
- package/dist/commonjs/native/reactivity.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +18 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/variables.js +1 -1
- package/dist/commonjs/native-internal/variables.js.map +1 -1
- package/dist/module/babel/helpers.js +6 -0
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +12 -6
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +2 -2
- package/dist/module/babel/react-native-web.js.map +1 -1
- package/dist/module/babel/react-native.js +2 -2
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/compiler.js +15 -1
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +2 -0
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +1 -1
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +2 -1
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +11 -3
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +16 -3
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/warnings.js +131 -0
- package/dist/module/metro/warnings.js.map +1 -0
- package/dist/module/native/api.js +2 -2
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +17 -4
- package/dist/module/native/react/useNativeCss.js.map +1 -1
- package/dist/module/native/reactivity.js +24 -1
- package/dist/module/native/reactivity.js.map +1 -1
- package/dist/module/native-internal/root.js +18 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/variables.js +2 -2
- package/dist/module/native-internal/variables.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -5
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +6 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +6 -8
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +2 -10
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/commonjs/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reactivity.d.ts +7 -0
- package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +12 -0
- package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +1 -5
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +6 -0
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +6 -8
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +2 -10
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts +4 -0
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/module/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reactivity.d.ts +7 -0
- package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts +12 -0
- package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/babel/helpers.ts +8 -1
- package/src/babel/import-plugin.ts +16 -12
- package/src/babel/react-native-web.ts +2 -3
- package/src/babel/react-native.ts +2 -3
- package/src/compiler/compiler.ts +19 -1
- package/src/compiler/compiler.types.ts +9 -0
- package/src/compiler/declarations.ts +1 -1
- package/src/compiler/selector-builder.ts +2 -1
- package/src/compiler/stylesheet.ts +17 -10
- package/src/metro/index.ts +5 -0
- package/src/metro/metro-transformer.ts +19 -4
- package/src/metro/warnings.ts +187 -0
- package/src/native/api.tsx +2 -3
- package/src/native/react/useNativeCss.ts +17 -2
- package/src/native/reactivity.ts +35 -1
- package/src/native-internal/root.ts +40 -13
- package/src/native-internal/variables.tsx +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/native/api.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,SAAS,EAA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
|
1
|
-
{"version":3,"file":"useNativeCss.d.ts","sourceRoot":"","sources":["../../../../../../src/native/react/useNativeCss.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"useNativeCss.d.ts","sourceRoot":"","sources":["../../../../../../src/native/react/useNativeCss.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAqB,CAAC;AAC/D,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,yBAAsB,CAAC;AACpE,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,oBAAoB,EAC1B,MAAM,kBAAe,CAAC;AAEvB,OAAO,EAAkB,YAAY,EAAE,MAAM,oBAAW,CAAC;AAGzD,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,uCAAuC;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IAEpB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IAEtD,kDAAkD;IAClD,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IAEvB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,UAAU,CAAC,EAAE,qBAAqB,CAAC;IAEnC,kBAAkB,EAAE,oBAAoB,CAAC;IACzC,mBAAmB,EAAE,qBAAqB,CAAC;IAE3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EACxB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,EACrD,OAAO,GAAE,MAAM,EAA+C,oKA0I/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,YA4ChE"}
|
|
@@ -3,6 +3,10 @@ import type { StyleDescriptor } from "react-native-css/compiler";
|
|
|
3
3
|
export type Effect = {
|
|
4
4
|
observers: Set<Observable<any, any>>;
|
|
5
5
|
run(): void;
|
|
6
|
+
/** Dependencies recorded by the last cleanupEffect() */
|
|
7
|
+
dependencies?: Observable<any, any>[];
|
|
8
|
+
/** Dependency values recorded by the last cleanupEffect() */
|
|
9
|
+
snapshots?: [Observable<any, any>, unknown][];
|
|
6
10
|
};
|
|
7
11
|
export type Observable<Value, Arg = Value> = {
|
|
8
12
|
observers: Set<Effect>;
|
|
@@ -18,6 +22,8 @@ export declare const observableBatch: {
|
|
|
18
22
|
};
|
|
19
23
|
export declare function observable<Value, Arg = Value>(init: Value | Read<Value, Arg>, equality?: (value1: Value, value2: Value) => boolean): Observable<Value, Arg>;
|
|
20
24
|
export declare function cleanupEffect(effect: Effect): void;
|
|
25
|
+
/** Whether any of the effect's dependencies changed since cleanupEffect() */
|
|
26
|
+
export declare function hasChangedDependencies(effect: Effect): boolean;
|
|
21
27
|
/** Family Helpers ************************************************************/
|
|
22
28
|
export declare function family<Key, Result = Key, Args extends any = void>(fn: (key: Key, args: Args) => Result): ((key: Key, args: Args) => Result) & {
|
|
23
29
|
delete(key: Key): boolean;
|
|
@@ -33,6 +39,7 @@ export declare const VAR_SYMBOL: unique symbol;
|
|
|
33
39
|
export type VariableContextValue = Record<string, StyleDescriptor> & {
|
|
34
40
|
[VAR_SYMBOL]: true;
|
|
35
41
|
};
|
|
42
|
+
export declare function toVariableRecord(variables: Record<string, StyleDescriptor>): Record<string, StyleDescriptor>;
|
|
36
43
|
/** Pseudo Classes ************************************************************/
|
|
37
44
|
export declare const hoverFamily: WeakFamilyFn<WeakKey, void, Observable<boolean, boolean>>;
|
|
38
45
|
export declare const activeFamily: WeakFamilyFn<WeakKey, void, Observable<boolean, boolean>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../../../../src/native/reactivity.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,GAAG,IAAI,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../../../../src/native/reactivity.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,GAAG,IAAI,IAAI,CAAC;IACZ,wDAAwD;IACxD,YAAY,CAAC,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACtC,6DAA6D;IAC7D,SAAS,CAAC,EAAE,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AM,UAAU,kFAAuC,CAAC;AAC/D,eAAO,MAAM,EAAE,4BAEd,CAAC;AACF,eAAO,MAAM,EAAE,4BAEd,CAAC;AAcF,gFAAgF;AAEhF,eAAO,MAAM,WAAW,oFAEvB,CAAC;AAGF,gFAAgF;AAEhF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC,MAAM,EACN;IACE,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CACnD,CACF,CAAC;AACF,eAAO,MAAM,gBAAgB,gDAA2C,CAAC;AAEzE,eAAO,MAAM,qBAAqB,2EAOhC,CAAC;AAEH,eAAO,MAAM,oBAAoB,yDAI/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,yDAIhC,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { StyleDescriptor, VariableValue } from "react-native-css/compiler";
|
|
2
2
|
import { type Observable } from "../native/reactivity.js";
|
|
3
|
+
declare const rootVariableFamily: () => ((key: string, args: void) => Observable<StyleDescriptor, VariableValue[]>) & {
|
|
4
|
+
delete(key: string): boolean;
|
|
5
|
+
clear(): void;
|
|
6
|
+
};
|
|
7
|
+
interface RootVariableRegistries {
|
|
8
|
+
root: ReturnType<typeof rootVariableFamily>;
|
|
9
|
+
universal: ReturnType<typeof rootVariableFamily>;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
var __react_native_css_root_variable_registries: RootVariableRegistries | undefined;
|
|
13
|
+
}
|
|
3
14
|
export declare const rootVariables: ((key: string, args: void) => Observable<StyleDescriptor, VariableValue[]>) & {
|
|
4
15
|
delete(key: string): boolean;
|
|
5
16
|
clear(): void;
|
|
@@ -8,4 +19,5 @@ export declare const universalVariables: ((key: string, args: void) => Observabl
|
|
|
8
19
|
delete(key: string): boolean;
|
|
9
20
|
clear(): void;
|
|
10
21
|
};
|
|
22
|
+
export {};
|
|
11
23
|
//# sourceMappingURL=root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../../src/native-internal/root.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGhF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,yBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../../src/native-internal/root.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGhF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,yBAAsB,CAAC;AAE3E,QAAA,MAAM,kBAAkB;;;CAsBvB,CAAC;AAEF,UAAU,sBAAsB;IAC9B,IAAI,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,SAAS,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,2CAA2C,EAC3C,sBAAsB,GACtB,SAAS,CAAC;CACf;AA2BD,eAAO,MAAM,aAAa;;;CACmC,CAAC;AAC9D,eAAO,MAAM,kBAAkB;;;CACmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../../../../src/native-internal/variables.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../../../../src/native-internal/variables.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,yBAAsB,CAAC;AAO9B,eAAO,MAAM,eAAe,+CAAiD,CAAC;AAE9E,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,eAAe,CAAC,CAAA;CAAE,CAAC,+BAc5E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-css",
|
|
3
|
-
"version": "3.1.0-rc.
|
|
3
|
+
"version": "3.1.0-rc.1",
|
|
4
4
|
"description": "Use CSS stylesheets in React Native",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
"example": "yarn workspace react-native-css-example",
|
|
184
184
|
"lint": "eslint",
|
|
185
185
|
"prepare": "bob build",
|
|
186
|
+
"prepack": "bob build",
|
|
186
187
|
"prepublishOnly": "bob build",
|
|
187
188
|
"release": "release-it --config ./.config/release-it.config.ts",
|
|
188
189
|
"start": "yarn example start",
|
|
@@ -348,4 +349,4 @@
|
|
|
348
349
|
"./.config/commitlint.config.mjs"
|
|
349
350
|
]
|
|
350
351
|
}
|
|
351
|
-
}
|
|
352
|
+
}
|
package/src/babel/helpers.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { dirname, resolve, sep } from "path";
|
|
2
|
+
|
|
1
3
|
import tBabelTypes, { type CallExpression } from "@babel/types";
|
|
2
4
|
|
|
3
5
|
export type BabelTypes = typeof tBabelTypes;
|
|
@@ -10,7 +12,7 @@ export interface PluginOpts {
|
|
|
10
12
|
|
|
11
13
|
export interface PluginState {
|
|
12
14
|
opts?: PluginOpts;
|
|
13
|
-
filename: string;
|
|
15
|
+
filename: string | undefined;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export function getInteropRequireDefaultSource(
|
|
@@ -38,3 +40,8 @@ export function getInteropRequireDefaultSource(
|
|
|
38
40
|
|
|
39
41
|
return requireArg.value;
|
|
40
42
|
}
|
|
43
|
+
|
|
44
|
+
// The handlers match "/"-separated package paths, and path.resolve separates with "\" on Windows
|
|
45
|
+
export function resolveImportSource(filename: string, source: string): string {
|
|
46
|
+
return resolve(dirname(filename), source).split(sep).join("/");
|
|
47
|
+
}
|
|
@@ -25,7 +25,7 @@ export default function ({
|
|
|
25
25
|
}: {
|
|
26
26
|
types: BabelTypes;
|
|
27
27
|
}): PluginObj<PluginState> {
|
|
28
|
-
const processed = new WeakSet();
|
|
28
|
+
const processed = new WeakSet<Statement>();
|
|
29
29
|
|
|
30
30
|
const packageRoot = resolve(
|
|
31
31
|
__dirname,
|
|
@@ -44,17 +44,19 @@ export default function ({
|
|
|
44
44
|
name: "Rewrite react-native to react-native-css",
|
|
45
45
|
visitor: {
|
|
46
46
|
ImportDeclaration(path, state): void {
|
|
47
|
+
const { filename } = state;
|
|
48
|
+
|
|
47
49
|
if (
|
|
48
|
-
|
|
50
|
+
filename === undefined ||
|
|
49
51
|
processed.has(path.node) ||
|
|
50
|
-
isFromThisModule(
|
|
52
|
+
isFromThisModule(filename)
|
|
51
53
|
) {
|
|
52
54
|
return;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
const statements =
|
|
56
|
-
handleReactNativeImport(path.node, t,
|
|
57
|
-
handleReactNativeWebImport(path.node, t,
|
|
58
|
+
handleReactNativeImport(path.node, t, filename) ??
|
|
59
|
+
handleReactNativeWebImport(path.node, t, filename);
|
|
58
60
|
|
|
59
61
|
if (!statements) {
|
|
60
62
|
return;
|
|
@@ -67,10 +69,12 @@ export default function ({
|
|
|
67
69
|
path.replaceWithMultiple(statements);
|
|
68
70
|
},
|
|
69
71
|
VariableDeclaration(path, state): void {
|
|
72
|
+
const { filename } = state;
|
|
73
|
+
|
|
70
74
|
if (
|
|
71
|
-
|
|
75
|
+
filename === undefined ||
|
|
72
76
|
processed.has(path.node) ||
|
|
73
|
-
isFromThisModule(
|
|
77
|
+
isFromThisModule(filename)
|
|
74
78
|
) {
|
|
75
79
|
return;
|
|
76
80
|
}
|
|
@@ -124,14 +128,14 @@ export default function ({
|
|
|
124
128
|
t,
|
|
125
129
|
id.name,
|
|
126
130
|
initArg.value,
|
|
127
|
-
|
|
131
|
+
filename,
|
|
128
132
|
) ??
|
|
129
133
|
handleReactNativeWebIdentifierRequire(
|
|
130
134
|
path,
|
|
131
135
|
t,
|
|
132
136
|
id.name,
|
|
133
137
|
initArg.value,
|
|
134
|
-
|
|
138
|
+
filename,
|
|
135
139
|
);
|
|
136
140
|
} else if (
|
|
137
141
|
t.isObjectPattern(id) &&
|
|
@@ -144,14 +148,14 @@ export default function ({
|
|
|
144
148
|
t,
|
|
145
149
|
id,
|
|
146
150
|
initArg.value,
|
|
147
|
-
|
|
151
|
+
filename,
|
|
148
152
|
) ??
|
|
149
153
|
handleReactNativeWebObjectPatternRequire(
|
|
150
154
|
path,
|
|
151
155
|
t,
|
|
152
156
|
id,
|
|
153
157
|
initArg.value,
|
|
154
|
-
|
|
158
|
+
filename,
|
|
155
159
|
);
|
|
156
160
|
} else if (
|
|
157
161
|
t.isIdentifier(id) &&
|
|
@@ -168,7 +172,7 @@ export default function ({
|
|
|
168
172
|
id.name,
|
|
169
173
|
init,
|
|
170
174
|
source,
|
|
171
|
-
|
|
175
|
+
filename,
|
|
172
176
|
);
|
|
173
177
|
}
|
|
174
178
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { dirname, resolve } from "path";
|
|
2
|
-
|
|
3
1
|
import { type NodePath } from "@babel/traverse";
|
|
4
2
|
import tBabelTypes, {
|
|
5
3
|
type CallExpression,
|
|
@@ -10,12 +8,13 @@ import tBabelTypes, {
|
|
|
10
8
|
} from "@babel/types";
|
|
11
9
|
|
|
12
10
|
import { allowedModules } from "./allowedModules";
|
|
11
|
+
import { resolveImportSource } from "./helpers";
|
|
13
12
|
|
|
14
13
|
type BabelTypes = typeof tBabelTypes;
|
|
15
14
|
|
|
16
15
|
function parseReactNativeWebSource(source: string, filename: string) {
|
|
17
16
|
if (source.startsWith(".")) {
|
|
18
|
-
source =
|
|
17
|
+
source = resolveImportSource(filename, source);
|
|
19
18
|
|
|
20
19
|
const internalPath = source.split("react-native-web/dist")[1];
|
|
21
20
|
if (!internalPath) {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { dirname, resolve } from "path";
|
|
2
|
-
|
|
3
1
|
import { type NodePath } from "@babel/traverse";
|
|
4
2
|
import tBabelTypes, {
|
|
5
3
|
type ImportDeclaration,
|
|
@@ -9,12 +7,13 @@ import tBabelTypes, {
|
|
|
9
7
|
} from "@babel/types";
|
|
10
8
|
|
|
11
9
|
import { allowedModules } from "./allowedModules";
|
|
10
|
+
import { resolveImportSource } from "./helpers";
|
|
12
11
|
|
|
13
12
|
type BabelTypes = typeof tBabelTypes;
|
|
14
13
|
|
|
15
14
|
function parseReactNativeSource(source: string, filename: string) {
|
|
16
15
|
if (source.startsWith(".")) {
|
|
17
|
-
source =
|
|
16
|
+
source = resolveImportSource(filename, source);
|
|
18
17
|
|
|
19
18
|
const internalPath = source.split("react-native/Libraries/Components/")[1];
|
|
20
19
|
if (!internalPath) {
|
package/src/compiler/compiler.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type PropertyRule,
|
|
11
11
|
type Rule,
|
|
12
12
|
type Visitor,
|
|
13
|
+
type Warning,
|
|
13
14
|
} from "lightningcss";
|
|
14
15
|
|
|
15
16
|
import {
|
|
@@ -42,6 +43,21 @@ import { supportsConditionValid } from "./supports";
|
|
|
42
43
|
|
|
43
44
|
const defaultLogger = debug("react-native-css:compiler");
|
|
44
45
|
|
|
46
|
+
// lightningcss reports this package's own at-rule as unknown
|
|
47
|
+
const OWN_AT_RULE_WARNING = "Unknown at rule: @nativeMapping";
|
|
48
|
+
|
|
49
|
+
// The warning is the only record of what lightningcss could not parse; only the first pass reads the author's CSS
|
|
50
|
+
function reportSyntaxWarnings(
|
|
51
|
+
builder: StylesheetBuilder,
|
|
52
|
+
warnings: Warning[],
|
|
53
|
+
): void {
|
|
54
|
+
for (const warning of warnings) {
|
|
55
|
+
if (warning.message !== OWN_AT_RULE_WARNING) {
|
|
56
|
+
builder.addSyntaxWarning(warning.message);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
45
61
|
/**
|
|
46
62
|
* Converts a CSS file to a collection of style declarations that can be used with the StyleSheet API
|
|
47
63
|
*
|
|
@@ -170,7 +186,7 @@ export function compile(code: Buffer | string, options: CompilerOptions = {}) {
|
|
|
170
186
|
};
|
|
171
187
|
}
|
|
172
188
|
|
|
173
|
-
const { code: firstPass } = lightningcss({
|
|
189
|
+
const { code: firstPass, warnings: firstPassWarnings } = lightningcss({
|
|
174
190
|
code: typeof code === "string" ? new TextEncoder().encode(code) : code,
|
|
175
191
|
include: Features.DoublePositionGradients | Features.ColorFunction,
|
|
176
192
|
exclude: Features.VendorPrefixes,
|
|
@@ -231,6 +247,8 @@ export function compile(code: Buffer | string, options: CompilerOptions = {}) {
|
|
|
231
247
|
projectRoot: options.projectRoot ?? process.cwd(),
|
|
232
248
|
});
|
|
233
249
|
|
|
250
|
+
reportSyntaxWarnings(builder, firstPassWarnings);
|
|
251
|
+
|
|
234
252
|
return {
|
|
235
253
|
stylesheet: () => builder.getNativeStyleSheet(),
|
|
236
254
|
warnings: () => builder.getWarnings(),
|
|
@@ -24,6 +24,15 @@ export interface InlineVariableOptions {
|
|
|
24
24
|
exclude?: `--${string}`[];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
// A channel is absent when the compile recorded nothing on it
|
|
28
|
+
export interface CompilerWarnings {
|
|
29
|
+
properties?: string[];
|
|
30
|
+
values?: Record<string, string[]>;
|
|
31
|
+
functions?: string[];
|
|
32
|
+
// CSS lightningcss could not parse, which the author fixes in their stylesheet
|
|
33
|
+
syntax?: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
/**
|
|
28
37
|
* A `react-native-css` StyleSheet
|
|
29
38
|
*/
|
|
@@ -63,9 +63,10 @@ export function getClassNameSelectors(
|
|
|
63
63
|
} else if (isUniversalSelector(selector)) {
|
|
64
64
|
return [{ type: "universalVariables" }];
|
|
65
65
|
} else {
|
|
66
|
+
// A nested rule reads its parent's selector list again, so the list is never reversed in place
|
|
66
67
|
return (
|
|
67
68
|
parseComponents(
|
|
68
|
-
selector.
|
|
69
|
+
selector.toReversed(),
|
|
69
70
|
options,
|
|
70
71
|
root,
|
|
71
72
|
root,
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
AnimationKeyframes,
|
|
10
10
|
AnimationRecord,
|
|
11
11
|
CompilerOptions,
|
|
12
|
+
CompilerWarnings,
|
|
12
13
|
ContainerQuery,
|
|
13
14
|
MediaCondition,
|
|
14
15
|
ReactNativeCssStyleSheet,
|
|
@@ -68,8 +69,9 @@ export class StylesheetBuilder {
|
|
|
68
69
|
ruleOrder: number;
|
|
69
70
|
warningProperty?: string;
|
|
70
71
|
warningProperties: string[];
|
|
71
|
-
warningValues: Record<string,
|
|
72
|
+
warningValues: Record<string, string[]>;
|
|
72
73
|
warningFunctions: string[];
|
|
74
|
+
syntaxWarnings: Set<string>;
|
|
73
75
|
} = {
|
|
74
76
|
ruleSets: {},
|
|
75
77
|
rem: 14,
|
|
@@ -77,6 +79,7 @@ export class StylesheetBuilder {
|
|
|
77
79
|
warningProperties: [],
|
|
78
80
|
warningValues: {},
|
|
79
81
|
warningFunctions: [],
|
|
82
|
+
syntaxWarnings: new Set(),
|
|
80
83
|
},
|
|
81
84
|
private selectors: SelectorList = [],
|
|
82
85
|
) {}
|
|
@@ -198,18 +201,17 @@ export class StylesheetBuilder {
|
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
addWarning(type: "property" | "value", property: string): void;
|
|
201
|
-
addWarning(type: "style", property: string, value:
|
|
204
|
+
addWarning(type: "style", property: string, value: string): void;
|
|
202
205
|
addWarning(
|
|
203
206
|
type: "property" | "style" | "value",
|
|
204
207
|
property: string,
|
|
205
|
-
value
|
|
208
|
+
value: string = property,
|
|
206
209
|
): void {
|
|
207
210
|
switch (type) {
|
|
208
211
|
case "property":
|
|
209
212
|
this.shared.warningProperties.push(property);
|
|
210
213
|
break;
|
|
211
214
|
case "value": {
|
|
212
|
-
value = property;
|
|
213
215
|
property = this.shared.warningProperty ?? "";
|
|
214
216
|
|
|
215
217
|
if (!property) {
|
|
@@ -227,12 +229,13 @@ export class StylesheetBuilder {
|
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
// A lightningcss message carries no position, so a repeated mistake is one entry
|
|
233
|
+
addSyntaxWarning(message: string): void {
|
|
234
|
+
this.shared.syntaxWarnings.add(message);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
getWarnings(): CompilerWarnings {
|
|
238
|
+
const result: CompilerWarnings = {};
|
|
236
239
|
|
|
237
240
|
if (this.shared.warningProperties.length) {
|
|
238
241
|
result.properties = this.shared.warningProperties;
|
|
@@ -246,6 +249,10 @@ export class StylesheetBuilder {
|
|
|
246
249
|
result.functions = this.shared.warningFunctions;
|
|
247
250
|
}
|
|
248
251
|
|
|
252
|
+
if (this.shared.syntaxWarnings.size) {
|
|
253
|
+
result.syntax = [...this.shared.syntaxWarnings];
|
|
254
|
+
}
|
|
255
|
+
|
|
249
256
|
return result;
|
|
250
257
|
}
|
|
251
258
|
|
package/src/metro/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { type CompilerOptions } from "../compiler";
|
|
|
7
7
|
import { getCacheVersion } from "./cache-version";
|
|
8
8
|
import { nativeResolver, webResolver } from "./resolver";
|
|
9
9
|
import { setupTypeScript } from "./typescript";
|
|
10
|
+
import type { WarningLevel } from "./warnings";
|
|
10
11
|
|
|
11
12
|
export interface WithReactNativeCSSOptions extends CompilerOptions {
|
|
12
13
|
/* Specify the path to the TypeScript environment file. Defaults types-env.d.ts */
|
|
@@ -16,8 +17,12 @@ export interface WithReactNativeCSSOptions extends CompilerOptions {
|
|
|
16
17
|
/** Add className to all React Native primitives. Defaults false */
|
|
17
18
|
globalClassNamePolyfill?: boolean;
|
|
18
19
|
hexColors?: boolean;
|
|
20
|
+
/** How native builds print the compiler's warnings. Defaults "summary" */
|
|
21
|
+
warnings?: WarningLevel;
|
|
19
22
|
}
|
|
20
23
|
|
|
24
|
+
export type { WarningLevel } from "./warnings";
|
|
25
|
+
|
|
21
26
|
const metroOverrideResolution = {
|
|
22
27
|
type: "sourceFile",
|
|
23
28
|
filePath: require.resolve("./override"),
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
|
|
7
7
|
import { compile, type CompilerOptions } from "../compiler";
|
|
8
8
|
import { getNativeInjectionCode } from "./injection-code";
|
|
9
|
+
import { reportCompilerWarnings, type WarningLevel } from "./warnings";
|
|
9
10
|
|
|
10
11
|
type TransformResponse = Awaited<
|
|
11
12
|
ReturnType<typeof import("metro-transform-worker").transform>
|
|
@@ -17,7 +18,9 @@ const worker =
|
|
|
17
18
|
|
|
18
19
|
export async function transform(
|
|
19
20
|
config: JsTransformerConfig & {
|
|
20
|
-
reactNativeCSS?:
|
|
21
|
+
reactNativeCSS?:
|
|
22
|
+
| (CompilerOptions & { warnings?: WarningLevel | undefined })
|
|
23
|
+
| undefined;
|
|
21
24
|
},
|
|
22
25
|
projectRoot: string,
|
|
23
26
|
filePath: string,
|
|
@@ -39,11 +42,23 @@ export async function transform(
|
|
|
39
42
|
|
|
40
43
|
const css = cssFile.output[0].data.css.code.toString();
|
|
41
44
|
|
|
42
|
-
const
|
|
43
|
-
|
|
45
|
+
const { warnings: warningLevel, ...compilerOptions } =
|
|
46
|
+
config.reactNativeCSS ?? {};
|
|
47
|
+
|
|
48
|
+
const compiled = compile(css, {
|
|
49
|
+
...compilerOptions,
|
|
44
50
|
filename: filePath,
|
|
45
51
|
projectRoot: projectRoot,
|
|
46
|
-
})
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const productionJS = compiled.stylesheet();
|
|
55
|
+
|
|
56
|
+
// Nothing downstream of the transformer sees the compile result, so this is the one place a build can report it
|
|
57
|
+
reportCompilerWarnings(compiled.warnings(), {
|
|
58
|
+
filename: filePath,
|
|
59
|
+
projectRoot,
|
|
60
|
+
level: warningLevel,
|
|
61
|
+
});
|
|
47
62
|
|
|
48
63
|
data = Buffer.from(getNativeInjectionCode([], [productionJS]));
|
|
49
64
|
|