@tamagui/static 1.121.10 → 1.121.12-1737177163952
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/dist/extractor/bundle.js +1 -1
- package/dist/extractor/bundle.native.js +1 -1
- package/dist/extractor/bundleConfig.js +2 -2
- package/dist/extractor/bundleConfig.native.js +2 -2
- package/dist/extractor/createExtractor.js +34 -23
- package/dist/extractor/createExtractor.js.map +1 -1
- package/dist/extractor/createExtractor.native.js +28 -23
- package/dist/extractor/createExtractor.native.js.map +2 -2
- package/dist/extractor/loadTamagui.js +3 -1
- package/dist/extractor/loadTamagui.js.map +1 -1
- package/dist/extractor/loadTamagui.native.js +3 -1
- package/dist/extractor/loadTamagui.native.js.map +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.native.js +6 -6
- package/dist/index.native.js.map +1 -1
- package/dist/registerRequire.js +16 -12
- package/dist/registerRequire.js.map +1 -1
- package/dist/registerRequire.native.js +20 -12
- package/dist/registerRequire.native.js.map +2 -2
- package/package.json +15 -15
- package/src/extractor/bundle.ts +1 -1
- package/src/extractor/bundleConfig.ts +2 -2
- package/src/extractor/createExtractor.ts +29 -17
- package/src/extractor/loadTamagui.ts +5 -1
- package/src/registerRequire.ts +25 -24
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/types/registerRequire.d.ts.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tamagui/static",
|
3
|
-
"version": "1.121.
|
3
|
+
"version": "1.121.12-1737177163952",
|
4
4
|
"source": "src/index.ts",
|
5
5
|
"types": "./types/index.d.ts",
|
6
6
|
"type": "commonjs",
|
@@ -44,23 +44,23 @@
|
|
44
44
|
"@babel/runtime": "^7.25.4",
|
45
45
|
"@babel/traverse": "^7.25.4",
|
46
46
|
"@babel/types": "^7.25.4",
|
47
|
-
"@tamagui/build": "1.121.
|
48
|
-
"@tamagui/cli-color": "1.121.
|
49
|
-
"@tamagui/config-default": "1.121.
|
50
|
-
"@tamagui/core": "1.121.
|
51
|
-
"@tamagui/fake-react-native": "1.121.
|
52
|
-
"@tamagui/generate-themes": "1.121.
|
53
|
-
"@tamagui/helpers": "1.121.
|
54
|
-
"@tamagui/helpers-node": "1.121.
|
55
|
-
"@tamagui/proxy-worm": "1.121.
|
56
|
-
"@tamagui/react-native-web-internals": "1.121.
|
57
|
-
"@tamagui/react-native-web-lite": "1.121.
|
58
|
-
"@tamagui/shorthands": "1.121.
|
59
|
-
"@tamagui/types": "1.121.
|
47
|
+
"@tamagui/build": "1.121.12-1737177163952",
|
48
|
+
"@tamagui/cli-color": "1.121.12-1737177163952",
|
49
|
+
"@tamagui/config-default": "1.121.12-1737177163952",
|
50
|
+
"@tamagui/core": "1.121.12-1737177163952",
|
51
|
+
"@tamagui/fake-react-native": "1.121.12-1737177163952",
|
52
|
+
"@tamagui/generate-themes": "1.121.12-1737177163952",
|
53
|
+
"@tamagui/helpers": "1.121.12-1737177163952",
|
54
|
+
"@tamagui/helpers-node": "1.121.12-1737177163952",
|
55
|
+
"@tamagui/proxy-worm": "1.121.12-1737177163952",
|
56
|
+
"@tamagui/react-native-web-internals": "1.121.12-1737177163952",
|
57
|
+
"@tamagui/react-native-web-lite": "1.121.12-1737177163952",
|
58
|
+
"@tamagui/shorthands": "1.121.12-1737177163952",
|
59
|
+
"@tamagui/types": "1.121.12-1737177163952",
|
60
60
|
"babel-literal-to-ast": "^2.1.0",
|
61
61
|
"browserslist": "^4.22.2",
|
62
62
|
"check-dependency-version-consistency": "^4.1.0",
|
63
|
-
"esbuild": "^0.24.
|
63
|
+
"esbuild": "^0.24.2",
|
64
64
|
"esbuild-register": "^3.6.0",
|
65
65
|
"fast-glob": "^3.2.11",
|
66
66
|
"find-cache-dir": "^3.3.2",
|
package/src/extractor/bundle.ts
CHANGED
@@ -148,7 +148,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
148
148
|
entryPoints: [configEntry],
|
149
149
|
external,
|
150
150
|
outfile: configOutPath,
|
151
|
-
target: '
|
151
|
+
target: 'node20',
|
152
152
|
...esbuildExtraOptions,
|
153
153
|
},
|
154
154
|
props.platform || 'web'
|
@@ -161,7 +161,7 @@ export async function bundleConfig(props: TamaguiOptions) {
|
|
161
161
|
resolvePlatformSpecificEntries: true,
|
162
162
|
external,
|
163
163
|
outfile: componentOutPaths[i],
|
164
|
-
target: '
|
164
|
+
target: 'node20',
|
165
165
|
...esbuildExtraOptions,
|
166
166
|
},
|
167
167
|
props.platform || 'web'
|
@@ -952,11 +952,17 @@ export function createExtractor(
|
|
952
952
|
.get('openingElement')
|
953
953
|
.get('attributes')
|
954
954
|
.flatMap((path) => {
|
955
|
+
// avoid work
|
956
|
+
if (shouldDeopt) {
|
957
|
+
return
|
958
|
+
}
|
959
|
+
|
955
960
|
try {
|
956
961
|
const res = evaluateAttribute(path)
|
957
962
|
if (!res) {
|
958
963
|
path.remove()
|
959
964
|
}
|
965
|
+
|
960
966
|
return res
|
961
967
|
} catch (err: any) {
|
962
968
|
if (shouldPrintDebug) {
|
@@ -1047,6 +1053,14 @@ export function createExtractor(
|
|
1047
1053
|
|
1048
1054
|
const name = attribute.name.name
|
1049
1055
|
|
1056
|
+
// in tamagui style is handled at the end of the style loop so its not as simple as just
|
1057
|
+
// adding this as a "style" property
|
1058
|
+
// its not used often when using tamagui so not optimizing it for now
|
1059
|
+
if (name === 'style') {
|
1060
|
+
shouldDeopt = true
|
1061
|
+
return null
|
1062
|
+
}
|
1063
|
+
|
1050
1064
|
if (excludeProps?.has(name)) {
|
1051
1065
|
if (shouldPrintDebug) {
|
1052
1066
|
logger.info([' excluding prop', name].join(' '))
|
@@ -1174,23 +1188,15 @@ export function createExtractor(
|
|
1174
1188
|
// never flatten if a prop isn't a valid static attribute
|
1175
1189
|
// only post prop-mapping
|
1176
1190
|
if (!variants[name] && !isValidStyleKey(name, staticConfig)) {
|
1177
|
-
let keys = [name]
|
1178
1191
|
let out: any = null
|
1179
1192
|
|
1180
1193
|
// for now passing empty props {}, a bit odd, need to at least document
|
1181
1194
|
// for now we don't expose custom components so just noting behavior
|
1182
|
-
|
1195
|
+
propMapper(name, styleValue, propMapperStyleState, false, (key, val) => {
|
1196
|
+
out ||= {}
|
1197
|
+
out[key] = val
|
1198
|
+
})
|
1183
1199
|
|
1184
|
-
if (out) {
|
1185
|
-
if (!Array.isArray(out)) {
|
1186
|
-
logger.warn(`Error expected array but got`, out)
|
1187
|
-
couldntParse = true
|
1188
|
-
shouldDeopt = true
|
1189
|
-
} else {
|
1190
|
-
out = Object.fromEntries(out)
|
1191
|
-
keys = Object.keys(out)
|
1192
|
-
}
|
1193
|
-
}
|
1194
1200
|
if (out) {
|
1195
1201
|
if (isTargetingHTML) {
|
1196
1202
|
// translate to DOM-compat
|
@@ -1201,12 +1207,10 @@ export function createExtractor(
|
|
1201
1207
|
// remove className - we dont use rnw styling
|
1202
1208
|
delete out.className
|
1203
1209
|
}
|
1204
|
-
|
1205
|
-
keys = Object.keys(out)
|
1206
1210
|
}
|
1207
1211
|
|
1208
1212
|
let didInline = false
|
1209
|
-
const attributes = keys.map((key) => {
|
1213
|
+
const attributes = Object.keys(out).map((key) => {
|
1210
1214
|
const val = out[key]
|
1211
1215
|
const isStyle = isValidStyleKey(key, staticConfig)
|
1212
1216
|
if (isStyle) {
|
@@ -1898,9 +1902,17 @@ export function createExtractor(
|
|
1898
1902
|
props: completeProps,
|
1899
1903
|
}
|
1900
1904
|
|
1901
|
-
let out =
|
1902
|
-
|
1905
|
+
let out: Record<string, any> = {}
|
1906
|
+
propMapper(
|
1907
|
+
name,
|
1908
|
+
variantValues.get(name),
|
1909
|
+
styleState,
|
1910
|
+
false,
|
1911
|
+
(key, val) => {
|
1912
|
+
out[key] = val
|
1913
|
+
}
|
1903
1914
|
)
|
1915
|
+
|
1904
1916
|
if (out && isTargetingHTML) {
|
1905
1917
|
const cn = out.className
|
1906
1918
|
// translate to DOM-compat
|
@@ -189,6 +189,10 @@ export function loadTamaguiSync({
|
|
189
189
|
const configPath = getTamaguiConfigPathFromOptionsConfig(propsIn.config)
|
190
190
|
const exp = require(configPath)
|
191
191
|
|
192
|
+
if (!exp || exp._isProxyWorm) {
|
193
|
+
throw new Error(`Got a empty / proxied config!`)
|
194
|
+
}
|
195
|
+
|
192
196
|
tamaguiConfig = (exp['default'] || exp['config'] || exp) as TamaguiInternalConfig
|
193
197
|
|
194
198
|
if (!tamaguiConfig || !tamaguiConfig.parsed) {
|
@@ -365,7 +369,7 @@ export async function esbuildWatchFiles(entry: string, onChanged: () => void) {
|
|
365
369
|
|
366
370
|
alias: {
|
367
371
|
'@react-native/normalize-color': '@tamagui/proxy-worm',
|
368
|
-
'react-native-web': '@tamagui/
|
372
|
+
'react-native-web': '@tamagui/react-native-web-lite',
|
369
373
|
'react-native': '@tamagui/proxy-worm',
|
370
374
|
},
|
371
375
|
|
package/src/registerRequire.ts
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
import { register } from 'esbuild-register/dist/node'
|
2
2
|
|
3
|
+
import { esbuildIgnoreFilesRegex } from './extractor/bundle'
|
3
4
|
import { requireTamaguiCore } from './helpers/requireTamaguiCore'
|
4
5
|
import type { TamaguiPlatform } from './types'
|
5
|
-
import { esbuildIgnoreFilesRegex } from './extractor/bundle'
|
6
6
|
|
7
7
|
const nameToPaths = {}
|
8
8
|
|
9
9
|
export const getNameToPaths = () => nameToPaths
|
10
10
|
|
11
11
|
const Module = require('node:module')
|
12
|
-
const packageJson = require('react-native-web/package.json')
|
13
12
|
const proxyWorm = require('@tamagui/proxy-worm')
|
14
|
-
const rnw = require('react-native-web')
|
15
13
|
|
16
14
|
let isRegistered = false
|
17
15
|
let og: any
|
@@ -62,37 +60,36 @@ export function registerRequire(
|
|
62
60
|
})
|
63
61
|
}
|
64
62
|
|
65
|
-
if (
|
66
|
-
|
63
|
+
if (
|
64
|
+
path in knownIgnorableModules ||
|
65
|
+
path.startsWith('react-native-reanimated') ||
|
66
|
+
esbuildIgnoreFilesRegex.test(path)
|
67
|
+
) {
|
68
|
+
return proxyWorm
|
67
69
|
}
|
68
70
|
|
69
|
-
if (
|
70
|
-
return
|
71
|
+
if (path in compiled) {
|
72
|
+
return compiled[path]
|
71
73
|
}
|
72
74
|
|
73
75
|
if (path === 'react-native-svg') {
|
74
76
|
return og.apply(this, ['@tamagui/react-native-svg'])
|
75
77
|
}
|
76
78
|
|
77
|
-
if (
|
78
|
-
path === '@gorhom/bottom-sheet' ||
|
79
|
-
path.startsWith('react-native-reanimated') ||
|
80
|
-
path === 'expo-linear-gradient' ||
|
81
|
-
path === '@expo/vector-icons' ||
|
82
|
-
path === 'tamagui/linear-gradient'
|
83
|
-
) {
|
84
|
-
return proxyWorm
|
85
|
-
}
|
86
79
|
if (path === 'react-native/package.json') {
|
87
|
-
return
|
88
|
-
}
|
89
|
-
|
90
|
-
if (path === '@tamagui/react-native-web-lite' || path.startsWith('react-native')) {
|
91
|
-
return rnw
|
80
|
+
return og.apply(this, ['react-native-web/package.json'])
|
92
81
|
}
|
93
82
|
|
94
|
-
if (
|
95
|
-
|
83
|
+
if (
|
84
|
+
path === '@tamagui/react-native-web-lite' ||
|
85
|
+
path === 'react-native' ||
|
86
|
+
path.startsWith('react-native/')
|
87
|
+
) {
|
88
|
+
try {
|
89
|
+
return og.apply('react-native')
|
90
|
+
} catch {
|
91
|
+
return og.apply(this, ['@tamagui/react-native-web-lite'])
|
92
|
+
}
|
96
93
|
}
|
97
94
|
|
98
95
|
if (!whitelisted[path]) {
|
@@ -156,7 +153,7 @@ export function registerRequire(
|
|
156
153
|
*/
|
157
154
|
|
158
155
|
console.error(
|
159
|
-
`Tamagui failed
|
156
|
+
`Tamagui failed to require() "${path}"
|
160
157
|
|
161
158
|
${err.message}
|
162
159
|
${err.stack}
|
@@ -184,8 +181,12 @@ const extraIgnores =
|
|
184
181
|
IGNORES === 'true' ? [] : process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS?.split(',')
|
185
182
|
|
186
183
|
const knownIgnorableModules = {
|
184
|
+
'@gorhom/bottom-sheet': true,
|
187
185
|
'expo-modules': true,
|
188
186
|
solito: true,
|
187
|
+
'expo-linear-gradient': true,
|
188
|
+
'@expo/vector-icons': true,
|
189
|
+
'tamagui/linear-gradient': true,
|
189
190
|
...Object.fromEntries(extraIgnores?.map((k) => [k, true]) || []),
|
190
191
|
}
|
191
192
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAiBjC,OAAO,KAAK,EAGV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAGf,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAcxD,OAAO,EAAE,iBAAiB,EAA6B,MAAM,6BAA6B,CAAA;AAkB1F,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAE1D,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAQ9C,wBAAgB,eAAe,CAC7B,EAAE,MAAgB,EAAE,QAAgB,EAAE,GAAE,gBAAsC;;;;;yBAyDnD,cAAc;6BAPhB,cAAc;;mBAwBtB,UAAU,SAAS,mBAAmB;;;;;;;eAIpC,UAAU,SAAS,mBAAmB;;;;;;;
|
1
|
+
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAiB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AAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,kBAAkB,
|
1
|
+
{"version":3,"file":"loadTamagui.d.ts","sourceRoot":"","sources":["../../src/extractor/loadTamagui.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAQxF,OAAO,EACL,KAAK,kBAAkB,EAMxB,MAAM,gBAAgB,CAAA;AAkBvB,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA0CpC;AAKD,eAAO,MAAM,oBAAoB,YAAmB,cAAc,mCA6BjE,CAAA;AAKD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,GA2B9C,cAAc,CACpB;AAGD,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,GAAG,OAAO,EACX,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,kBAAkB,CAmHrB;AAED,wBAAsB,UAAU,CAAC,EAC/B,IAAoB,EACpB,YAA8B,EAC9B,cAAc,EACd,IAAI,EACJ,KAAK,GACN,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgC5D;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,UAW5D;AA0BD,YAAY,EAAE,kBAAkB,EAAE,CAAA;AAElC,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,uBAyD3E"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"registerRequire.d.ts","sourceRoot":"","sources":["../src/registerRequire.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"registerRequire.d.ts","sourceRoot":"","sources":["../src/registerRequire.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,eAAO,MAAM,cAAc,UAAoB,CAAA;AAa/C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,QAEzD;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,EACzB,EAAE,gBAAgB,EAAE;;CAEnB;2BAsB6B,GAAG,QAAQ,MAAM;;EA6HhD"}
|