@broxium/compiler 1.1.0 → 1.2.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/dist/index.js CHANGED
@@ -113,7 +113,9 @@ function runtimeServerStubPlugin(nodePaths = []) {
113
113
  loader: "js",
114
114
  resolveDir,
115
115
  contents: `
116
- import { createElement, Fragment, useId, Children } from 'react';
116
+ import { createElement, Fragment, Children } from 'react';
117
+ var __islandSeq = 0;
118
+ function __nextIslandId() { return 'bi-' + (++__islandSeq) + '-' + Math.random().toString(36).slice(2,7); }
117
119
 
118
120
  export function BrodoxImage({ src, alt, width, height, fill, className, style, priority, quality = 75, sizes }) {
119
121
  const maxW = width || 1920;
@@ -161,7 +163,7 @@ export function BrodoxRouter({ children }) {
161
163
  * parent bundle's __registry__ after page load.
162
164
  */
163
165
  export function Client({ children }) {
164
- var id = useId();
166
+ var id = __nextIslandId();
165
167
  var child = Children.only(children);
166
168
  var compType = child.type;
167
169
  var name = typeof compType !== 'string' && compType
package/dist/index.mjs CHANGED
@@ -84,7 +84,9 @@ function runtimeServerStubPlugin(nodePaths = []) {
84
84
  loader: "js",
85
85
  resolveDir,
86
86
  contents: `
87
- import { createElement, Fragment, useId, Children } from 'react';
87
+ import { createElement, Fragment, Children } from 'react';
88
+ var __islandSeq = 0;
89
+ function __nextIslandId() { return 'bi-' + (++__islandSeq) + '-' + Math.random().toString(36).slice(2,7); }
88
90
 
89
91
  export function BrodoxImage({ src, alt, width, height, fill, className, style, priority, quality = 75, sizes }) {
90
92
  const maxW = width || 1920;
@@ -132,7 +134,7 @@ export function BrodoxRouter({ children }) {
132
134
  * parent bundle's __registry__ after page load.
133
135
  */
134
136
  export function Client({ children }) {
135
- var id = useId();
137
+ var id = __nextIslandId();
136
138
  var child = Children.only(children);
137
139
  var compType = child.type;
138
140
  var name = typeof compType !== 'string' && compType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@broxium/compiler",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Brodox component compiler — TSX to ESM server + client bundles",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -42,7 +42,9 @@ export function runtimeServerStubPlugin(nodePaths: string[] = []): Plugin {
42
42
  loader: 'js',
43
43
  resolveDir,
44
44
  contents: `
45
- import { createElement, Fragment, useId, Children } from 'react';
45
+ import { createElement, Fragment, Children } from 'react';
46
+ var __islandSeq = 0;
47
+ function __nextIslandId() { return 'bi-' + (++__islandSeq) + '-' + Math.random().toString(36).slice(2,7); }
46
48
 
47
49
  export function BrodoxImage({ src, alt, width, height, fill, className, style, priority, quality = 75, sizes }) {
48
50
  const maxW = width || 1920;
@@ -90,7 +92,7 @@ export function BrodoxRouter({ children }) {
90
92
  * parent bundle's __registry__ after page load.
91
93
  */
92
94
  export function Client({ children }) {
93
- var id = useId();
95
+ var id = __nextIslandId();
94
96
  var child = Children.only(children);
95
97
  var compType = child.type;
96
98
  var name = typeof compType !== 'string' && compType