@creact-labs/creact 0.2.4 → 0.2.6

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/LICENSE CHANGED
@@ -197,7 +197,7 @@ APPENDIX: How to apply the Apache License to your work.
197
197
  same "printed page" as the copyright notice for easier
198
198
  identification within third-party archives.
199
199
 
200
- Copyright 2025 Daniel Coutinho Ribeiro
200
+ Copyright 2025 Daniel Coutinho Ribeiro <dcoutinho.96@gmail.com>
201
201
 
202
202
  Licensed under the Apache License, Version 2.0 (the "License");
203
203
  you may not use this file except in compliance with the License.
package/dist/cli.js CHANGED
@@ -48,7 +48,10 @@ async function runEntrypoint(entrypoint) {
48
48
  // FIXME: Cache-busting causes memory leak as old modules stay in V8 cache.
49
49
  // Acceptable for dev watch mode, but consider worker threads for long sessions.
50
50
  const cacheBustUrl = `${url}?t=${Date.now()}`;
51
- const module = await tsImport(cacheBustUrl, import.meta.url);
51
+ const module = await tsImport(cacheBustUrl, {
52
+ parentURL: import.meta.url,
53
+ tsconfig: resolve(dirname(entrypoint), 'tsconfig.json'),
54
+ });
52
55
  if (typeof module.default === 'function') {
53
56
  await module.default();
54
57
  }
@@ -111,8 +111,11 @@ export function useInstance(construct, props) {
111
111
  this.outputSignals.set(key, createSignal(value));
112
112
  }
113
113
  else {
114
- const [, write] = this.outputSignals.get(key);
115
- write(value);
114
+ const [read, write] = this.outputSignals.get(key);
115
+ // Only update if value actually changed
116
+ if (read() !== value) {
117
+ write(value);
118
+ }
116
119
  }
117
120
  }
118
121
  });
@@ -134,8 +137,11 @@ export function useInstance(construct, props) {
134
137
  node.outputSignals.set(key, createSignal(value));
135
138
  }
136
139
  else {
137
- const [, write] = node.outputSignals.get(key);
138
- write(value);
140
+ const [read, write] = node.outputSignals.get(key);
141
+ // Only update if value actually changed
142
+ if (read() !== value) {
143
+ write(value);
144
+ }
139
145
  }
140
146
  }
141
147
  }
@@ -195,8 +201,11 @@ export function fillInstanceOutputs(nodeId, outputs) {
195
201
  batch(() => {
196
202
  for (const [key, value] of Object.entries(outputs)) {
197
203
  if (node.outputSignals.has(key)) {
198
- const [, write] = node.outputSignals.get(key);
199
- write(value); // Write value (plain or accessor) to signal
204
+ const [read, write] = node.outputSignals.get(key);
205
+ // Only update if value actually changed
206
+ if (read() !== value) {
207
+ write(value);
208
+ }
200
209
  }
201
210
  else {
202
211
  node.outputSignals.set(key, createSignal(value));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creact-labs/creact",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "description": "Declarative universal reactive runtime",
6
6
  "main": "dist/index.js",