@jay-framework/fullstack-component 0.13.0 → 0.14.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.d.ts CHANGED
@@ -111,6 +111,12 @@ interface JayStackComponentDefinition<Refs extends object, SlowVS extends object
111
111
  slowlyRender: RenderSlowly<Services, PropsT, SlowVS, any>;
112
112
  fastRender: RenderFast<Services, PropsT, FastVS, any>;
113
113
  comp: ComponentConstructor<PropsT, Refs, InteractiveVS, Contexts, CompCore>;
114
+ /** Client-side defaults for when server fast ViewState is not available
115
+ * (e.g., new forEach items created on the client). Client-only. */
116
+ clientDefaults?: (props: PropsT) => {
117
+ viewState: FastVS;
118
+ carryForward?: any;
119
+ };
114
120
  }
115
121
  type AnyJayStackComponentDefinition = JayStackComponentDefinition<object, object, object, object, object[], object[], object, UrlParams, any>;
116
122
  /**
@@ -238,6 +244,10 @@ type Builder<State extends BuilderStates, Refs extends object, SlowVS extends ob
238
244
  ], PropsT, Params, JayComponentCore<PropsT, InteractiveVS>>;
239
245
  withInteractive(comp: ComponentConstructor<PropsT, Refs, InteractiveVS, Contexts, CompCore>): Builder<'Done', Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>;
240
246
  } : State extends 'InteractiveRender' ? JayStackComponentDefinition<Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore> & {
247
+ withClientDefaults(fn: (props: PropsT) => {
248
+ viewState: FastVS;
249
+ carryForward?: any;
250
+ }): Builder<'InteractiveRender', Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>;
241
251
  withInteractive(comp: ComponentConstructor<PropsT, Refs, InteractiveVS, Contexts, CompCore>): Builder<'Done', Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>;
242
252
  } : JayStackComponentDefinition<Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>;
243
253
  /**
package/dist/index.js CHANGED
@@ -47,6 +47,9 @@ function partialRender(rendered, carryForward) {
47
47
  return phaseOutput(rendered, carryForward);
48
48
  }
49
49
  function createJayService(name) {
50
+ if (name) {
51
+ return Symbol.for(`jay:service:${name}`);
52
+ }
50
53
  return Symbol(name);
51
54
  }
52
55
  class BuilderImplementation {
@@ -57,6 +60,7 @@ class BuilderImplementation {
57
60
  __publicField(this, "slowlyRender");
58
61
  __publicField(this, "fastRender");
59
62
  __publicField(this, "comp");
63
+ __publicField(this, "clientDefaults");
60
64
  }
61
65
  withProps() {
62
66
  return this;
@@ -81,6 +85,10 @@ class BuilderImplementation {
81
85
  this.fastRender = fastRender;
82
86
  return this;
83
87
  }
88
+ withClientDefaults(fn) {
89
+ this.clientDefaults = fn;
90
+ return this;
91
+ }
84
92
  withInteractive(comp) {
85
93
  this.comp = comp;
86
94
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/fullstack-component",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -26,12 +26,12 @@
26
26
  "test:watch": "vitest"
27
27
  },
28
28
  "dependencies": {
29
- "@jay-framework/component": "^0.13.0",
30
- "@jay-framework/runtime": "^0.13.0"
29
+ "@jay-framework/component": "^0.14.0",
30
+ "@jay-framework/runtime": "^0.14.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@jay-framework/dev-environment": "^0.13.0",
34
- "@jay-framework/jay-cli": "^0.13.0",
33
+ "@jay-framework/dev-environment": "^0.14.0",
34
+ "@jay-framework/jay-cli": "^0.14.0",
35
35
  "@types/express": "^5.0.2",
36
36
  "@types/node": "^22.15.21",
37
37
  "nodemon": "^3.0.3",