@tsrx/react 0.4.4 → 0.5.0

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
@@ -3,7 +3,7 @@
3
3
  "description": "React compiler built on @tsrx/core",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.4.4",
6
+ "version": "0.5.0",
7
7
  "type": "module",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -25,6 +25,10 @@
25
25
  "./dynamic": {
26
26
  "types": "./types/dynamic.d.ts"
27
27
  },
28
+ "./try-body": {
29
+ "types": "./types/try-body.d.ts",
30
+ "default": "./src/try-body.js"
31
+ },
28
32
  "./ref": {
29
33
  "types": "./types/ref.d.ts",
30
34
  "default": "./src/ref.js"
@@ -35,10 +39,10 @@
35
39
  }
36
40
  },
37
41
  "dependencies": {
38
- "esrap": "^2.3.2",
42
+ "esrap": "^2.4.0",
39
43
  "zimmerframe": "^1.1.2",
40
- "@tsrx/core": "0.5.4",
41
- "@tsrx/react-runtime": "0.1.12"
44
+ "@tsrx/core": "0.6.0",
45
+ "@tsrx/react-runtime": "0.2.0"
42
46
  },
43
47
  "peerDependencies": {
44
48
  "react": ">=18"
package/src/index.js CHANGED
@@ -117,5 +117,7 @@ export function compile_to_volar_mappings(source, filename, options) {
117
117
  ...result,
118
118
  mappings: dedupeMappings(result.mappings),
119
119
  };
120
- return uses_platform_flags ? withPlatformTypes(deduped, options?.platform) : deduped;
120
+ return uses_platform_flags
121
+ ? withPlatformTypes(deduped, options?.platform, transformed.ast)
122
+ : deduped;
121
123
  }
package/src/transform.js CHANGED
@@ -21,12 +21,14 @@ const react_platform = {
21
21
  // type-only transform keeps the `Dynamic` component shape (types only).
22
22
  dynamicFactory: {},
23
23
  errorBoundary: '@tsrx/react/error-boundary',
24
+ tryBody: '@tsrx/react/try-body',
24
25
  mergeRefs: '@tsrx/react/ref',
25
26
  refProp: '@tsrx/react/ref',
26
27
  forOfIterableHelper: '@tsrx/react/runtime/iterable',
27
28
  },
28
29
  directRuntimeImports: {
29
30
  errorBoundary: '@tsrx/react-runtime/error-boundary',
31
+ tryBody: '@tsrx/react-runtime/try-body',
30
32
  mergeRefs: '@tsrx/react-runtime/ref',
31
33
  refProp: '@tsrx/react-runtime/ref',
32
34
  forOfIterableHelper: '@tsrx/react-runtime/iterable',
@@ -34,8 +36,13 @@ const react_platform = {
34
36
  jsx: {
35
37
  rewriteClassAttr: false,
36
38
  classAttrName: 'className',
39
+ hostSpreadClassProps: ['className'],
40
+ classValue: 'text',
37
41
  multiRefStrategy: 'merge-refs',
42
+ // React keeps a ref's cleanup per fiber, so elements can share one merged ref.
43
+ shareMergedRefs: true,
38
44
  hostSpreadRefBinding: 'in-place',
45
+ pendingFallback: 'try-body',
39
46
  },
40
47
  validation: {
41
48
  requireUseServerForAwait: false,
@@ -0,0 +1 @@
1
+ export * from '@tsrx/react-runtime/try-body';
@@ -0,0 +1 @@
1
+ export * from '@tsrx/react-runtime/try-body';