@tamagui/static 3.0.13 → 3.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/static",
3
- "version": "3.0.13",
3
+ "version": "3.0.15",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",
@@ -45,22 +45,22 @@
45
45
  "clean:build": "tamagui-build clean:build"
46
46
  },
47
47
  "dependencies": {
48
- "@tamagui/animation-helpers": "3.0.13",
49
- "@tamagui/cli-color": "3.0.13",
50
- "@tamagui/compiler-core": "3.0.13",
51
- "@tamagui/config-default": "3.0.13",
52
- "@tamagui/core": "3.0.13",
53
- "@tamagui/dom": "3.0.13",
54
- "@tamagui/fake-react-native": "3.0.13",
55
- "@tamagui/generate-themes": "3.0.13",
56
- "@tamagui/helpers": "3.0.13",
57
- "@tamagui/helpers-node": "3.0.13",
58
- "@tamagui/react-native-web-internals": "3.0.13",
59
- "@tamagui/react-native-web-lite": "3.0.13",
60
- "@tamagui/shorthands": "3.0.13",
61
- "@tamagui/style-grammar": "3.0.13",
62
- "@tamagui/types": "3.0.13",
63
- "@tamagui/web": "3.0.13",
48
+ "@tamagui/animation-helpers": "3.0.15",
49
+ "@tamagui/cli-color": "3.0.15",
50
+ "@tamagui/compiler-core": "3.0.15",
51
+ "@tamagui/config-default": "3.0.15",
52
+ "@tamagui/core": "3.0.15",
53
+ "@tamagui/dom": "3.0.15",
54
+ "@tamagui/fake-react-native": "3.0.15",
55
+ "@tamagui/generate-themes": "3.0.15",
56
+ "@tamagui/helpers": "3.0.15",
57
+ "@tamagui/helpers-node": "3.0.15",
58
+ "@tamagui/react-native-web-internals": "3.0.15",
59
+ "@tamagui/react-native-web-lite": "3.0.15",
60
+ "@tamagui/shorthands": "3.0.15",
61
+ "@tamagui/style-grammar": "3.0.15",
62
+ "@tamagui/types": "3.0.15",
63
+ "@tamagui/web": "3.0.15",
64
64
  "browserslist": "^4.28.1",
65
65
  "check-dependency-version-consistency": "^4.1.0",
66
66
  "esbuild": "0.28.1",
@@ -73,7 +73,7 @@
73
73
  "react-native-web": "~0.21.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@tamagui/build": "3.0.13",
76
+ "@tamagui/build": "3.0.15",
77
77
  "@types/find-root": "^1.1.2",
78
78
  "@types/node": "^22.1.0",
79
79
  "@types/webpack": "^4.41.26",
@@ -94,5 +94,5 @@
94
94
  "url": "git+https://github.com/tamagui/tamagui.git",
95
95
  "directory": "code/compiler/static"
96
96
  },
97
- "releaseSourceCommit": "b8e55707cda1d4eb264d3a71b30b6d0ed3841919"
97
+ "releaseSourceCommit": "181782eb92d59e1a0c5b235070f58003af6a1280"
98
98
  }
@@ -3008,10 +3008,84 @@ export function createTamaguiCompilerHost(
3008
3008
  'Native style output is not a static serializable value'
3009
3009
  )
3010
3010
  }
3011
+ // FontLanguage swaps a family for its `<family>_<language>` font at
3012
+ // runtime, so values resolved from a family that has one stay live
3013
+ if (component.staticConfig.isText && staticObject(nativeStyleResolved)) {
3014
+ const conf = core.getConfig()
3015
+ const family = String(split.fontFamily || conf.defaultFontToken).replace(
3016
+ /^\$/,
3017
+ ''
3018
+ )
3019
+ if (
3020
+ Object.keys(nativeStyleResolved).some(
3021
+ (key) =>
3022
+ key.startsWith('font') || key === 'lineHeight' || key === 'letterSpacing'
3023
+ ) &&
3024
+ Object.keys(conf.fontsParsed).some((name) => name.startsWith(`${family}_`))
3025
+ ) {
3026
+ return bailout(
3027
+ input,
3028
+ 'local/dynamic-style-value',
3029
+ `Font ${family} has FontLanguage variants, so its values resolve at runtime`
3030
+ )
3031
+ }
3032
+ }
3011
3033
  const nativeStyleLocal = unusedIdentifier(
3012
3034
  input.source,
3013
3035
  `__TamaguiNativeStyle${input.element.span.start}`
3014
3036
  )
3037
+ // non-style props the runtime resolves from the component's defaults,
3038
+ // such as a styled() numberOfLines or allowFontScaling, go on the host
3039
+ // ahead of the call site's own props and spreads, which still win.
3040
+ // suppressHighlighting only changes how pressed text looks
3041
+ const pressable = input.element.entries.some(
3042
+ (entry) => entry.kind === 'prop' && /^on[A-Z]/.test(entry.name)
3043
+ )
3044
+ const defaultViewProps = component.domTag
3045
+ ? []
3046
+ : Object.keys(staticDefaultProps).filter(
3047
+ (name) =>
3048
+ name !== 'style' &&
3049
+ split.viewProps &&
3050
+ name in split.viewProps &&
3051
+ (name !== 'suppressHighlighting' || pressable) &&
3052
+ !input.element.entries.some(
3053
+ (entry) => entry.kind === 'prop' && entry.name === name
3054
+ )
3055
+ )
3056
+ for (const name of defaultViewProps) {
3057
+ const value = (split.viewProps as Record<string, unknown>)[name]
3058
+ if (
3059
+ input.element.form !== 'jsx' ||
3060
+ !(
3061
+ value === null ||
3062
+ typeof value === 'string' ||
3063
+ typeof value === 'boolean' ||
3064
+ (typeof value === 'number' && Number.isFinite(value))
3065
+ )
3066
+ ) {
3067
+ return bailout(
3068
+ input,
3069
+ 'local/unsupported-target',
3070
+ `Default prop ${name} cannot be written onto the flattened host`
3071
+ )
3072
+ }
3073
+ }
3074
+ const defaultPropEdits = defaultViewProps.length
3075
+ ? [
3076
+ {
3077
+ start: input.element.component.span.end,
3078
+ end: input.element.component.span.end,
3079
+ content: defaultViewProps
3080
+ .map(
3081
+ (name) =>
3082
+ ` ${name}={${JSON.stringify((split.viewProps as Record<string, unknown>)[name])}}`
3083
+ )
3084
+ .join(''),
3085
+ origin: input.element.component.span,
3086
+ },
3087
+ ]
3088
+ : []
3015
3089
  // the native style engine pushes the runtime's exact keys, so its base keeps them
3016
3090
  const usesNativeFastPath =
3017
3091
  !!themedStyleKeys &&
@@ -3319,12 +3393,14 @@ export function createTamaguiCompilerHost(
3319
3393
  const useHostView =
3320
3394
  options.experimentalNativeFastPath &&
3321
3395
  nativeName === 'View' &&
3322
- isBareHostView(input.element, !!nativeFastPath)
3396
+ isBareHostView(input.element, !!nativeFastPath) &&
3397
+ !defaultViewProps.some((name) => VIEW_WRAPPER_PROPS.test(name))
3323
3398
  const useHostText =
3324
3399
  options.experimentalNativeFastPath &&
3325
3400
  nativeName === 'Text' &&
3326
3401
  !!nativeFastPath &&
3327
- isBareHostText(input.element)
3402
+ isBareHostText(input.element) &&
3403
+ !defaultViewProps.some((name) => TEXT_WRAPPER_PROPS.test(name))
3328
3404
  const nativeExport = useHostView ? 'unstable_NativeView' : nativeName
3329
3405
  // the local is named after the BINDING, not the component: a file can
3330
3406
  // hold both kinds at once, and a shared name would emit two different
@@ -3400,7 +3476,7 @@ export function createTamaguiCompilerHost(
3400
3476
  : []
3401
3477
  return {
3402
3478
  ok: true,
3403
- edits: [...inlineEdits, ...tagEdits, ...styleEdits],
3479
+ edits: [...inlineEdits, ...tagEdits, ...defaultPropEdits, ...styleEdits],
3404
3480
  css: [],
3405
3481
  imports: [
3406
3482
  ...nativeStyleImports,
@@ -3683,7 +3759,7 @@ export function createTamaguiCompilerHost(
3683
3759
  }
3684
3760
  return {
3685
3761
  ok: true,
3686
- edits: [...tagEdits, ...expressionEdits],
3762
+ edits: [...tagEdits, ...defaultPropEdits, ...expressionEdits],
3687
3763
  css: [],
3688
3764
  imports: [
3689
3765
  ...nativeStyleImports,
@@ -3744,6 +3820,7 @@ export function createTamaguiCompilerHost(
3744
3820
  ok: true,
3745
3821
  edits: [
3746
3822
  ...tagEdits,
3823
+ ...defaultPropEdits,
3747
3824
  {
3748
3825
  start: input.element.component.span.end,
3749
3826
  end: input.element.component.span.end,
@@ -3768,6 +3845,7 @@ export function createTamaguiCompilerHost(
3768
3845
  ok: true,
3769
3846
  edits: [
3770
3847
  ...tagEdits,
3848
+ ...defaultPropEdits,
3771
3849
  ...webPropEdits,
3772
3850
  {
3773
3851
  start: first!.span.start,
@@ -1 +1 @@
1
- {"version":3,"file":"compilerHost.d.ts","sourceRoot":"","sources":["../src/compilerHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAE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,CAAA;AAExF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAIhE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAClD;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,gBAAgB,EAAE,EACvC,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,GACnD,yBAAyB,CAS3B;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,cAAc,CAAA;IACtB,aAAa,EAAE,qBAAqB,CAAA;IACpC,UAAU,EAAE,gBAAgB,EAAE,CAAA;IAC9B,gBAAgB,EAAE,uBAAuB,EAAE,CAAA;IAC3C,qFAAqF;IACrF,QAAQ,CAAC,EAAE,yBAAyB,CAAA;IACpC,wEAAwE;IACxE,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,mEAAmE;IACnE,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAmoCD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,0BAA0B,GAClC,oBAAoB,CAg8FtB"}
@@ -3,7 +3,7 @@ import type { TamaguiRuntimeLiteral } from './options';
3
3
  * Bumped whenever the zero transform's emitted output changes shape. It rides
4
4
  * the lowering plan version so a compiler change also invalidates zero caches.
5
5
  */
6
- export declare const ZERO_COMPILER_VERSION = "zero-1/plan-6";
6
+ export declare const ZERO_COMPILER_VERSION = "zero-1/plan-7";
7
7
  /**
8
8
  * Every integration records this tuple in its cache and build identity. The CSS
9
9
  * path alone is insufficient because the artifact's content can change in place.