@tsrx/preact 0.1.25 → 0.1.26

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": "Preact compiler built on @tsrx/core",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.1.25",
6
+ "version": "0.1.26",
7
7
  "type": "module",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -23,8 +23,7 @@
23
23
  "default": "./src/error-boundary.js"
24
24
  },
25
25
  "./dynamic": {
26
- "types": "./types/dynamic.d.ts",
27
- "default": "./src/dynamic.js"
26
+ "types": "./types/dynamic.d.ts"
28
27
  },
29
28
  "./ref": {
30
29
  "types": "./types/ref.d.ts",
@@ -38,7 +37,7 @@
38
37
  "dependencies": {
39
38
  "esrap": "^2.2.8",
40
39
  "zimmerframe": "^1.1.2",
41
- "@tsrx/core": "0.1.25"
40
+ "@tsrx/core": "0.1.26"
42
41
  },
43
42
  "peerDependencies": {
44
43
  "preact": ">=10"
package/src/index.js CHANGED
@@ -5,7 +5,6 @@
5
5
  import { createVolarMappingsResult, dedupeMappings, parseModule } from '@tsrx/core';
6
6
  import { DEFAULT_SUSPENSE_SOURCE, transform } from './transform.js';
7
7
 
8
- export { Dynamic } from './dynamic.js';
9
8
  export { DEFAULT_SUSPENSE_SOURCE };
10
9
  export { isRefProp } from './ref.js';
11
10
 
package/src/transform.js CHANGED
@@ -33,6 +33,10 @@ const preact_platform = {
33
33
  fragment: 'preact',
34
34
  suspense: DEFAULT_SUSPENSE_SOURCE,
35
35
  dynamic: '@tsrx/preact/dynamic',
36
+ // Production output aliases dynamic tags to a scoped component const
37
+ // inside an expression-child IIFE, re-evaluated on every render; the
38
+ // type-only transform keeps the `Dynamic` component shape (types only).
39
+ dynamicFactory: {},
36
40
  errorBoundary: '@tsrx/preact/error-boundary',
37
41
  mergeRefs: '@tsrx/preact/ref',
38
42
  refProp: '@tsrx/preact/ref',
package/src/dynamic.js DELETED
@@ -1,9 +0,0 @@
1
- import { h } from 'preact';
2
-
3
- /**
4
- * @param {{ is: import('preact').ComponentType<any> | string | null | undefined | false, [key: string]: any }} props
5
- * @returns {import('preact').VNode | null}
6
- */
7
- export function Dynamic({ is, ...props }) {
8
- return is ? h(is, props) : null;
9
- }