@zeus-js/output-wc 0.1.0-beta.7 → 0.1.0-beta.9

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * output-wc v0.1.0-beta.7
2
+ * output-wc v0.1.0-beta.9
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -9,7 +9,7 @@ Object.defineProperties(exports, {
9
9
  });
10
10
  const ZEUS_OUTPUT_WC_CAPABILITIES = {
11
11
  packageName: "@zeus-js/output-wc",
12
- version: "0.1.0-beta.7",
12
+ version: "0.1.0-beta.9",
13
13
  output: {
14
14
  webComponent: true,
15
15
  customElements: true,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * output-wc v0.1.0-beta.7
2
+ * output-wc v0.1.0-beta.9
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -9,7 +9,7 @@ Object.defineProperties(exports, {
9
9
  });
10
10
  const ZEUS_OUTPUT_WC_CAPABILITIES = {
11
11
  packageName: "@zeus-js/output-wc",
12
- version: "0.1.0-beta.7",
12
+ version: "0.1.0-beta.9",
13
13
  output: {
14
14
  webComponent: true,
15
15
  customElements: true,
@@ -1,6 +1,6 @@
1
1
  const ZEUS_OUTPUT_WC_CAPABILITIES = {
2
2
  packageName: "@zeus-js/output-wc",
3
- version: "0.1.0-beta.7",
3
+ version: "0.1.0-beta.9",
4
4
  output: {
5
5
  webComponent: true,
6
6
  customElements: true,
@@ -1,6 +1,6 @@
1
1
  const ZEUS_OUTPUT_WC_CAPABILITIES = {
2
2
  packageName: "@zeus-js/output-wc",
3
- version: "0.1.0-beta.7",
3
+ version: "0.1.0-beta.9",
4
4
  output: {
5
5
  webComponent: true,
6
6
  customElements: true,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * output-wc v0.1.0-beta.7
2
+ * output-wc v0.1.0-beta.9
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -206,52 +206,51 @@ function generateLazyEntry(options) {
206
206
  const { component, outPath, sourceImport } = options;
207
207
  const source = sourceImport !== null && sourceImport !== void 0 ? sourceImport : toRelativeImport(component.source, outPath);
208
208
  return [
209
- `import { mountElementDefinition } from "@zeus-js/runtime-dom";`,
209
+ `import { createCustomElementMountLifecycle, mountElementDefinition } from "@zeus-js/runtime-dom";`,
210
210
  `import { ${component.exportName} } from ${JSON.stringify(source)};`,
211
211
  "",
212
212
  `export function createComponent(hostRef) {`,
213
- ` let mounted;`,
214
213
  ` const mountState = {`,
215
214
  ` attributeProps: hostRef.attributeProps,`,
216
215
  ` internals: hostRef.internals,`,
217
216
  ` reflectingAttrs: hostRef.reflectingAttrs,`,
218
217
  ` };`,
218
+ ` const lifecycle = createCustomElementMountLifecycle(() =>`,
219
+ ` mountElementDefinition(`,
220
+ ` ${component.exportName},`,
221
+ ` hostRef.host,`,
222
+ ` hostRef.values,`,
223
+ ` mountState,`,
224
+ ` ),`,
225
+ ` );`,
219
226
  "",
220
227
  ` return {`,
221
228
  ` connected() {`,
222
- ` if (mounted) return;`,
223
- "",
224
- ` mounted = mountElementDefinition(`,
225
- ` ${component.exportName},`,
226
- ` hostRef.host,`,
227
- ` hostRef.values,`,
228
- ` mountState,`,
229
- ` );`,
229
+ ` lifecycle.connect();`,
230
230
  ` },`,
231
231
  "",
232
232
  ` disconnected() {`,
233
- ` mounted?.dispose();`,
234
- ` mounted = undefined;`,
233
+ ` lifecycle.disconnect();`,
235
234
  ` },`,
236
235
  "",
237
236
  ` propertyChanged(name, oldValue, newValue) {`,
238
- ` mounted?.propertyChanged(name, oldValue, newValue);`,
237
+ ` lifecycle.current()?.propertyChanged(name, oldValue, newValue);`,
239
238
  ` },`,
240
239
  "",
241
240
  ` formAssociated(form) {`,
242
- ` mounted?.formAssociated(form);`,
241
+ ` lifecycle.current()?.formAssociated(form);`,
243
242
  ` },`,
244
243
  "",
245
244
  ` formDisabled(disabled) {`,
246
- ` mounted?.formDisabled(disabled);`,
245
+ ` lifecycle.current()?.formDisabled(disabled);`,
247
246
  ` },`,
248
247
  "",
249
248
  ` formReset() {`,
250
- ` mounted?.formReset();`,
249
+ ` lifecycle.current()?.formReset();`,
251
250
  ` },`,
252
251
  "",
253
252
  ` formStateRestore(state, mode) {`,
254
- ` mounted?.formStateRestore(state, mode);`,
253
+ ` lifecycle.current()?.formStateRestore(state, mode);`,
255
254
  ` },`,
256
255
  ` };`,
257
256
  `}`,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * output-wc v0.1.0-beta.7
2
+ * output-wc v0.1.0-beta.9
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -206,52 +206,51 @@ function generateLazyEntry(options) {
206
206
  const { component, outPath, sourceImport } = options;
207
207
  const source = sourceImport !== null && sourceImport !== void 0 ? sourceImport : toRelativeImport(component.source, outPath);
208
208
  return [
209
- `import { mountElementDefinition } from "@zeus-js/runtime-dom";`,
209
+ `import { createCustomElementMountLifecycle, mountElementDefinition } from "@zeus-js/runtime-dom";`,
210
210
  `import { ${component.exportName} } from ${JSON.stringify(source)};`,
211
211
  "",
212
212
  `export function createComponent(hostRef) {`,
213
- ` let mounted;`,
214
213
  ` const mountState = {`,
215
214
  ` attributeProps: hostRef.attributeProps,`,
216
215
  ` internals: hostRef.internals,`,
217
216
  ` reflectingAttrs: hostRef.reflectingAttrs,`,
218
217
  ` };`,
218
+ ` const lifecycle = createCustomElementMountLifecycle(() =>`,
219
+ ` mountElementDefinition(`,
220
+ ` ${component.exportName},`,
221
+ ` hostRef.host,`,
222
+ ` hostRef.values,`,
223
+ ` mountState,`,
224
+ ` ),`,
225
+ ` );`,
219
226
  "",
220
227
  ` return {`,
221
228
  ` connected() {`,
222
- ` if (mounted) return;`,
223
- "",
224
- ` mounted = mountElementDefinition(`,
225
- ` ${component.exportName},`,
226
- ` hostRef.host,`,
227
- ` hostRef.values,`,
228
- ` mountState,`,
229
- ` );`,
229
+ ` lifecycle.connect();`,
230
230
  ` },`,
231
231
  "",
232
232
  ` disconnected() {`,
233
- ` mounted?.dispose();`,
234
- ` mounted = undefined;`,
233
+ ` lifecycle.disconnect();`,
235
234
  ` },`,
236
235
  "",
237
236
  ` propertyChanged(name, oldValue, newValue) {`,
238
- ` mounted?.propertyChanged(name, oldValue, newValue);`,
237
+ ` lifecycle.current()?.propertyChanged(name, oldValue, newValue);`,
239
238
  ` },`,
240
239
  "",
241
240
  ` formAssociated(form) {`,
242
- ` mounted?.formAssociated(form);`,
241
+ ` lifecycle.current()?.formAssociated(form);`,
243
242
  ` },`,
244
243
  "",
245
244
  ` formDisabled(disabled) {`,
246
- ` mounted?.formDisabled(disabled);`,
245
+ ` lifecycle.current()?.formDisabled(disabled);`,
247
246
  ` },`,
248
247
  "",
249
248
  ` formReset() {`,
250
- ` mounted?.formReset();`,
249
+ ` lifecycle.current()?.formReset();`,
251
250
  ` },`,
252
251
  "",
253
252
  ` formStateRestore(state, mode) {`,
254
- ` mounted?.formStateRestore(state, mode);`,
253
+ ` lifecycle.current()?.formStateRestore(state, mode);`,
255
254
  ` },`,
256
255
  ` };`,
257
256
  `}`,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * output-wc v0.1.0-beta.7
2
+ * output-wc v0.1.0-beta.9
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -179,52 +179,51 @@ function generateLazyEntry(options) {
179
179
  const { component, outPath, sourceImport } = options;
180
180
  const source = sourceImport !== null && sourceImport !== void 0 ? sourceImport : toRelativeImport(component.source, outPath);
181
181
  return [
182
- `import { mountElementDefinition } from "@zeus-js/runtime-dom";`,
182
+ `import { createCustomElementMountLifecycle, mountElementDefinition } from "@zeus-js/runtime-dom";`,
183
183
  `import { ${component.exportName} } from ${JSON.stringify(source)};`,
184
184
  "",
185
185
  `export function createComponent(hostRef) {`,
186
- ` let mounted;`,
187
186
  ` const mountState = {`,
188
187
  ` attributeProps: hostRef.attributeProps,`,
189
188
  ` internals: hostRef.internals,`,
190
189
  ` reflectingAttrs: hostRef.reflectingAttrs,`,
191
190
  ` };`,
191
+ ` const lifecycle = createCustomElementMountLifecycle(() =>`,
192
+ ` mountElementDefinition(`,
193
+ ` ${component.exportName},`,
194
+ ` hostRef.host,`,
195
+ ` hostRef.values,`,
196
+ ` mountState,`,
197
+ ` ),`,
198
+ ` );`,
192
199
  "",
193
200
  ` return {`,
194
201
  ` connected() {`,
195
- ` if (mounted) return;`,
196
- "",
197
- ` mounted = mountElementDefinition(`,
198
- ` ${component.exportName},`,
199
- ` hostRef.host,`,
200
- ` hostRef.values,`,
201
- ` mountState,`,
202
- ` );`,
202
+ ` lifecycle.connect();`,
203
203
  ` },`,
204
204
  "",
205
205
  ` disconnected() {`,
206
- ` mounted?.dispose();`,
207
- ` mounted = undefined;`,
206
+ ` lifecycle.disconnect();`,
208
207
  ` },`,
209
208
  "",
210
209
  ` propertyChanged(name, oldValue, newValue) {`,
211
- ` mounted?.propertyChanged(name, oldValue, newValue);`,
210
+ ` lifecycle.current()?.propertyChanged(name, oldValue, newValue);`,
212
211
  ` },`,
213
212
  "",
214
213
  ` formAssociated(form) {`,
215
- ` mounted?.formAssociated(form);`,
214
+ ` lifecycle.current()?.formAssociated(form);`,
216
215
  ` },`,
217
216
  "",
218
217
  ` formDisabled(disabled) {`,
219
- ` mounted?.formDisabled(disabled);`,
218
+ ` lifecycle.current()?.formDisabled(disabled);`,
220
219
  ` },`,
221
220
  "",
222
221
  ` formReset() {`,
223
- ` mounted?.formReset();`,
222
+ ` lifecycle.current()?.formReset();`,
224
223
  ` },`,
225
224
  "",
226
225
  ` formStateRestore(state, mode) {`,
227
- ` mounted?.formStateRestore(state, mode);`,
226
+ ` lifecycle.current()?.formStateRestore(state, mode);`,
228
227
  ` },`,
229
228
  ` };`,
230
229
  `}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zeus-js/output-wc",
3
3
  "type": "module",
4
- "version": "0.1.0-beta.7",
4
+ "version": "0.1.0-beta.9",
5
5
  "description": "Zeus Web Component output plugin",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -50,11 +50,11 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@zeus-js/bundler-plugin": "0.1.0-beta.7",
54
- "@zeus-js/component-dts": "0.1.0-beta.7",
55
- "@zeus-js/runtime-dom": "0.1.0-beta.7",
56
- "@zeus-js/component-analyzer": "0.1.0-beta.7",
57
- "@zeus-js/web-c-runtime": "0.1.0-beta.7"
53
+ "@zeus-js/bundler-plugin": "0.1.0-beta.9",
54
+ "@zeus-js/component-dts": "0.1.0-beta.9",
55
+ "@zeus-js/component-analyzer": "0.1.0-beta.9",
56
+ "@zeus-js/runtime-dom": "0.1.0-beta.9",
57
+ "@zeus-js/web-c-runtime": "0.1.0-beta.9"
58
58
  },
59
59
  "author": "Baicie",
60
60
  "buildOptions": {