tungsten 0.4.11 → 0.4.12
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/.build-complete +1 -1
- package/dist/AnyComponent.js +1 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +15 -16
- package/dist/ContentNode.js +2 -2
- package/dist/DomRegion.js +1 -1
- package/dist/Framework.d.ts +2 -1
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +43 -34
- package/dist/FrameworkConfig.d.ts +16 -0
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.js +8 -8
- package/dist/Instance/Instance.js +11 -11
- package/dist/RenderedContentNode.js +2 -2
- package/dist/RenderingNode.js +2 -2
- package/dist/Script.js +1 -1
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +29 -29
- package/dist/Servers/ProdServer.js +14 -14
- package/dist/Servers/StaticSiteServer.js +3 -3
- package/dist/Servers/TungstenServer.js +5 -5
- package/dist/Servers/devErrorPageAutoRetry.js +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +5 -5
- package/dist/Servers/initStores.js +3 -3
- package/dist/Servers/loadEnvsDev.js +6 -6
- package/dist/Servers/routing.js +3 -3
- package/dist/Store/createStores.js +2 -2
- package/dist/Store/makeStore.js +2 -2
- package/dist/Store/registerStore.js +2 -2
- package/dist/TungstenApp.js +3 -3
- package/dist/TungstenStyleObject.js +1 -1
- package/dist/__deproxy.js +2 -2
- package/dist/_client/client.js +3 -3
- package/dist/alive.js +1 -1
- package/dist/api/getApiRoutes.js +3 -3
- package/dist/api/getApiRoutesHono.js +3 -3
- package/dist/api/getExport.js +4 -4
- package/dist/api/getExportDev.js +1 -1
- package/dist/appOutput.js +1 -1
- package/dist/auth/index.js +2 -2
- package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.js +4 -2
- package/dist/babelPlugins/BabelTransformBindDirect.js +2 -2
- package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
- package/dist/babelPlugins/BabelTransformCjsToEsm.js +1 -1
- package/dist/babelPlugins/BabelTransformComponentState.js +2 -2
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +27 -11
- package/dist/babelPlugins/BabelTransformCssImports.js +1 -1
- package/dist/babelPlugins/BabelTransformDeproxyState.js +1 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.js +6 -2
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +66 -49
- package/dist/babelPlugins/BabelTransformReactive.js +1 -1
- package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +1 -1
- package/dist/babelPlugins/BabelTransformSxyFrameworkImports.js +1 -1
- package/dist/babelPlugins/BabelTransformUniqueComponents.js +1 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.js +1 -1
- package/dist/babelPlugins/test.js +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +3 -3
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +1 -1
- package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
- package/dist/bin/args.js +1 -1
- package/dist/bin/commands/build.js +5 -5
- package/dist/bin/commands/buildHelp.js +1 -1
- package/dist/bin/commands/clean.js +4 -4
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +24 -17
- package/dist/bin/commands/compileSimplePackage.js +2 -2
- package/dist/bin/commands/dev.d.ts.map +1 -1
- package/dist/bin/commands/dev.js +16 -9
- package/dist/bin/commands/devmon.js +4 -4
- package/dist/bin/commands/help.js +2 -2
- package/dist/bin/commands/start.js +2 -2
- package/dist/bin/commands/static.js +3 -3
- package/dist/bin/index.js +13 -13
- package/dist/bin/moduleLoadAnalysis.js +2 -2
- package/dist/browserStorage.js +2 -2
- package/dist/build/babel.user.common.config.d.ts +7 -2
- package/dist/build/babel.user.common.config.d.ts.map +1 -1
- package/dist/build/babel.user.common.config.js +14 -15
- package/dist/build/bundle.d.ts +1 -1
- package/dist/build/bundle.d.ts.map +1 -1
- package/dist/build/bundle.js +15 -7
- package/dist/build/bundleBabelOptions.d.ts +6 -0
- package/dist/build/bundleBabelOptions.d.ts.map +1 -0
- package/dist/build/bundleBabelOptions.js +23 -0
- package/dist/build/combineComponentCss.js +2 -2
- package/dist/build/compileJavascript.d.ts +4 -0
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +148 -90
- package/dist/build/compileStyles.js +4 -4
- package/dist/build/compileUserApp.d.ts +1 -1
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/compileUserApp.js +15 -12
- package/dist/build/componentStylesCache.d.ts +10 -0
- package/dist/build/componentStylesCache.d.ts.map +1 -0
- package/dist/build/componentStylesCache.js +54 -0
- package/dist/build/copyAssets.js +1 -1
- package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
- package/dist/build/copyPublicFiles.js +1 -1
- package/dist/build/createClientFiles.js +3 -3
- package/dist/build/createInstanceConfigFile.js +2 -2
- package/dist/build/createPackageVirtualFileSystems.js +1 -1
- package/dist/build/devBundle.js +5 -5
- package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
- package/dist/build/devBundle.rollup.config.js +0 -1
- package/dist/build/frameworkDestLocation.d.ts +1 -0
- package/dist/build/frameworkDestLocation.d.ts.map +1 -1
- package/dist/build/frameworkDestLocation.js +8 -4
- package/dist/build/frameworkStylesheets.js +1 -1
- package/dist/build/getAllSxyClientModules.js +2 -2
- package/dist/build/getPackageDirForFile.js +1 -1
- package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
- package/dist/build/getSxyClientPackageAliases.js +4 -2
- package/dist/build/getTempDirForAppCompilation.js +1 -1
- package/dist/build/makeBabelRawConfig.d.ts +3 -0
- package/dist/build/makeBabelRawConfig.d.ts.map +1 -0
- package/dist/build/makeBabelRawConfig.js +12 -0
- package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +11 -8
- package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.js +10 -5
- package/dist/build/processPackage.js +3 -3
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +13 -11
- package/dist/build/rollupExtractComponentStylesheets.js +2 -2
- package/dist/build/sassImportParser.js +2 -2
- package/dist/build/tallyBabelPlugins.d.ts.map +1 -1
- package/dist/build/tallyBabelPlugins.js +2 -7
- package/dist/calculateImportedStaticFileLocations.js +2 -2
- package/dist/calledFrom.js +2 -2
- package/dist/compat/forwardRef.js +1 -1
- package/dist/compat/index.js +1 -1
- package/dist/componentProxyHandlers.js +3 -3
- package/dist/components/Link.js +2 -2
- package/dist/components/PopMessages.js +3 -3
- package/dist/components/RawHtml.js +2 -2
- package/dist/components/Stylesheet.js +3 -3
- package/dist/components/bindable/BindableCheckbox.js +1 -1
- package/dist/components/bindable/BindableInput.js +1 -1
- package/dist/components/bindable/BindableInputNonString.js +1 -1
- package/dist/components/bindable/BindableInputString.js +1 -1
- package/dist/components/bindable/BindableInputTyped.js +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.js +1 -1
- package/dist/components/bindable/BindableRadio.js +1 -1
- package/dist/components/bindable/BindableSelect.js +1 -1
- package/dist/components/bindable/BindableTextarea.js +1 -1
- package/dist/components/library/RichTextEditor/RichTextEditor.js +8 -8
- package/dist/components/library/RichTextEditor/contentTree.js +4 -4
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +2 -2
- package/dist/components/library/__StatefulMessage/StatefulMessage.js +2 -2
- package/dist/components/library/index.js +2 -2
- package/dist/createElement.js +1 -1
- package/dist/defaultConfig.d.ts +0 -1
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +2 -2
- package/dist/deleteDirs.js +1 -1
- package/dist/env/addToEnv.js +1 -1
- package/dist/env/funcs.js +4 -4
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +10 -6
- package/dist/env/privateEnv.js +2 -2
- package/dist/env/privateEnvOrThrow.js +1 -1
- package/dist/env/publicEnv.js +1 -1
- package/dist/env/publicEnvOrThrow.js +1 -1
- package/dist/filePathFromUrl.js +1 -1
- package/dist/findProjectDir.js +1 -1
- package/dist/findUserConfig.js +5 -5
- package/dist/fixExtension.d.ts.map +1 -1
- package/dist/fixExtension.js +5 -3
- package/dist/frameworkConfigSchema.d.ts +16 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +12 -0
- package/dist/getComponent.js +5 -5
- package/dist/getComponentDev.js +1 -1
- package/dist/getFrameworkDir.js +1 -1
- package/dist/getRoutes.js +5 -5
- package/dist/getRoutesDevs.js +1 -1
- package/dist/getUserConfig.js +7 -7
- package/dist/hasValidKey.js +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/hmr/applyHmrModule.js +5 -5
- package/dist/hmr/componentIdentity.js +2 -2
- package/dist/hooks/clearCurrentComponent.js +1 -1
- package/dist/hooks/getCurrentComponent.js +3 -3
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/setCurrentComponent.js +1 -1
- package/dist/hooks/useCallback.js +2 -2
- package/dist/hooks/useEffect.js +2 -2
- package/dist/hooks/useInstance.js +1 -1
- package/dist/hooks/useMemo.js +2 -2
- package/dist/hooks/useState.js +3 -3
- package/dist/hydrate/hydrate.js +31 -31
- package/dist/hydrate/reconcileHydratedAttributes.js +3 -3
- package/dist/index.js +2 -2
- package/dist/indexInner.d.ts +1 -1
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +45 -45
- package/dist/innerHtmlFromProps.js +1 -1
- package/dist/isBrowser.js +1 -1
- package/dist/isDev.js +1 -1
- package/dist/isProd.js +1 -1
- package/dist/isServer.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsxRuntime.d.ts.map +1 -1
- package/dist/jsxRuntime.js +12 -7
- package/dist/jsxRuntimeSignals.d.ts.map +1 -1
- package/dist/jsxRuntimeSignals.js +15 -8
- package/dist/makeFinalConfig.js +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
- package/dist/makeServerRpc.js +3 -3
- package/dist/markOptionSelected.js +1 -1
- package/dist/nbsp.js +1 -1
- package/dist/output.js +1 -1
- package/dist/pop.js +2 -2
- package/dist/postcssPlugins/TransformCssNames.js +6 -6
- package/dist/postcssPlugins/parseSelectors.js +1 -1
- package/dist/postcssPlugins/parseSelectorsRich.js +1 -1
- package/dist/postcssPlugins/scopeAnimationValue.js +2 -2
- package/dist/propsAreEqual.js +3 -3
- package/dist/rawHtml/filterContentNode.js +4 -4
- package/dist/rawHtml/parseHtml.js +4 -4
- package/dist/rawHtml/sanitizeHtml.js +3 -3
- package/dist/rawHtml/tokenizeHtml.js +2 -2
- package/dist/render/addImportMap.js +2 -2
- package/dist/render/classComponentNodeToRenderingTree.js +4 -4
- package/dist/render/componentNodeToRenderingTree.js +7 -7
- package/dist/render/contentNodeToHtml.js +11 -11
- package/dist/render/contentToHtml.js +4 -4
- package/dist/render/contentToHtmlDev.js +1 -1
- package/dist/render/contentTreeToRenderingTree.js +7 -7
- package/dist/render/functionComponentNodeToRenderingTree.js +4 -4
- package/dist/render/getFunctionBodyAsString.js +1 -1
- package/dist/render/instantiateClassComponent.js +2 -2
- package/dist/render/instantiateComponent.js +3 -3
- package/dist/render/instantiateFunctionComponent.js +2 -2
- package/dist/render/printComponentNameInSource.js +1 -1
- package/dist/render/processHead.js +5 -5
- package/dist/render/processHtmlNode.js +1 -1
- package/dist/render/processProps.js +2 -2
- package/dist/render/processRenderingNodeHtml.js +6 -6
- package/dist/render/renderingTreeToHtml.js +16 -16
- package/dist/render/rootToHtml.js +2 -2
- package/dist/render/rootToHtmlDev.js +1 -1
- package/dist/requests/fetch/delete.js +2 -2
- package/dist/requests/fetch/get.js +3 -3
- package/dist/requests/fetch/patch.js +2 -2
- package/dist/requests/fetch/post.js +2 -2
- package/dist/requests/fetch/put.js +2 -2
- package/dist/requests/index.js +5 -5
- package/dist/routing/MatchedRoute.js +2 -2
- package/dist/routing/getPathPriority.js +1 -1
- package/dist/routing/matchPath.js +3 -3
- package/dist/routing/patternToRegex.js +1 -1
- package/dist/server.js +3 -3
- package/dist/serverModuleLocation.d.ts +3 -0
- package/dist/serverModuleLocation.d.ts.map +1 -0
- package/dist/serverModuleLocation.js +12 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +9 -0
- package/dist/standardSchema.js +1 -1
- package/dist/staticGen/getAppRoutes.js +3 -3
- package/dist/staticGen/staticGen.js +7 -7
- package/dist/style/jssToCss.js +3 -3
- package/dist/style/styleContent.js +1 -1
- package/dist/style/styleContentSxy.js +8 -8
- package/dist/style/unusedStyles.js +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/syncServer/preload.js +1 -1
- package/dist/testing/host.js +1 -1
- package/dist/testing/hydrateTestApp.js +9 -9
- package/dist/testing/index.js +11 -11
- package/dist/testing/installTestStyleProcessors.js +1 -1
- package/dist/testing/loadEnv.js +3 -3
- package/dist/testing/loadEnvSetup.js +1 -1
- package/dist/testing/temp/componentPackageMock.js +2 -2
- package/dist/testing/temp/contentHtmlElements.js +2 -2
- package/dist/throwError.js +2 -2
- package/dist/timeProfiler.d.ts +1 -1
- package/dist/timeProfiler.d.ts.map +1 -1
- package/dist/timeProfiler.js +61 -25
- package/dist/update/integrateUpdateVdom.js +28 -28
- package/dist/validChildren.js +2 -2
- package/dist/warnOnFrameworkChange.js +2 -2
- package/dist/zones/react.js +3 -3
- package/package.json +18 -11
- package/types/modules.d.ts +2 -0
package/dist/timeProfiler.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { performance } from 'node:perf_hooks';
|
|
6
6
|
import { AsyncLocalStorage, createHook } from 'node:async_hooks';
|
|
7
7
|
import chalk from 'chalk-extensions';
|
|
8
|
-
import { cliOut } from
|
|
8
|
+
import { cliOut } from './cliOutput.js';
|
|
9
9
|
// Nesting has to be recorded, not inferred: sibling phases started together sit inside each other's
|
|
10
10
|
// time windows, so intervals alone cannot tell a nested call from a concurrent one. Async storage
|
|
11
11
|
// gives each task its own phase even when several run at once.
|
|
@@ -161,7 +161,9 @@ function reportTimeline() {
|
|
|
161
161
|
// trimmed to what is left of the line - a wrapped note breaks the column alignment of
|
|
162
162
|
// every row after it, which is worse than losing the end of one label
|
|
163
163
|
const notes = fullNotes.slice(0, Math.max(0, columns - rowWidth - 1));
|
|
164
|
-
cliOut(' ' + chalk.yellow`${label.padEnd(labelWidth)}`
|
|
164
|
+
cliOut(' ' + chalk.yellow`${label.padEnd(labelWidth)}`
|
|
165
|
+
// cpu is the figure that says what the phase cost, so it gets the colour
|
|
166
|
+
+ ' ' + chalk.mediumgrey`${ms(phase.end - phase.start).padStart(9)}` + ' ' + chalk.orange`${`cpu ${ms(ownCpu)}`.padStart(13)}` + ' ' + ' '.repeat(from) + bar
|
|
165
167
|
// only pad out to the full bar when something follows it
|
|
166
168
|
+ (notes === '' ? '' : ' '.repeat(barWidth - to) + chalk.mediumgrey`${notes}`));
|
|
167
169
|
}
|
|
@@ -189,32 +191,66 @@ export function reportStartupPhase(name) {
|
|
|
189
191
|
report(name, lastPhaseEnd, now);
|
|
190
192
|
lastPhaseEnd = now;
|
|
191
193
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
194
|
+
const rootTallies = new Map();
|
|
195
|
+
const tallyStack = [];
|
|
196
|
+
function tallyNode(name) {
|
|
197
|
+
const parent = tallyStack[tallyStack.length - 1];
|
|
198
|
+
const siblings = parent === undefined ? rootTallies : parent.children;
|
|
199
|
+
let node = siblings.get(name);
|
|
200
|
+
if (node === undefined) {
|
|
201
|
+
node = {
|
|
202
|
+
name,
|
|
203
|
+
parent,
|
|
204
|
+
children: new Map(),
|
|
205
|
+
calls: 0,
|
|
206
|
+
ms: 0
|
|
207
|
+
};
|
|
208
|
+
siblings.set(name, node);
|
|
209
|
+
}
|
|
210
|
+
return node;
|
|
211
|
+
}
|
|
212
|
+
// Synchronous work only. Concurrent operations overlap, so summing their wall clock counts the
|
|
213
|
+
// same time once per operation - 291 parallel transforms tallied as 689,576ms of an 11s run - and
|
|
214
|
+
// the stack that gives the nesting assumes nothing else runs in between. Time async work with a
|
|
215
|
+
// phase, whose cpu figure is attributed rather than summed.
|
|
216
|
+
export function tallied(name, work) {
|
|
217
|
+
const node = tallyNode(name);
|
|
218
|
+
tallyStack.push(node);
|
|
219
|
+
const start = performance.now();
|
|
220
|
+
try {
|
|
221
|
+
return work();
|
|
222
|
+
} finally {
|
|
223
|
+
node.calls++;
|
|
224
|
+
node.ms += performance.now() - start;
|
|
225
|
+
tallyStack.pop();
|
|
226
|
+
}
|
|
204
227
|
}
|
|
205
|
-
// Deliberately no async variant. Concurrent operations overlap, so summing their wall clock counts
|
|
206
|
-
// the same time once per operation - 291 parallel transforms tallied as 689,576ms of an 11s run.
|
|
207
|
-
// Time async work with a phase, whose cpu figure is attributed rather than summed.
|
|
208
228
|
function reportTallies() {
|
|
209
|
-
if (
|
|
229
|
+
if (rootTallies.size === 0) return;
|
|
210
230
|
cliOut('');
|
|
211
|
-
cliOut(chalk.mediumgrey`tallied work - synchronous
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
231
|
+
cliOut(chalk.mediumgrey`tallied work - synchronous, nested under what it ran inside; self is the line's own time`);
|
|
232
|
+
const rows = [];
|
|
233
|
+
const collect = (nodes, indent) => {
|
|
234
|
+
for (const node of [...nodes.values()].sort((a, b) => b.ms - a.ms)) {
|
|
235
|
+
rows.push({
|
|
236
|
+
indent,
|
|
237
|
+
node
|
|
238
|
+
});
|
|
239
|
+
collect(node.children, indent + 1);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
collect(rootTallies, 0);
|
|
243
|
+
const nameWidth = Math.max(...rows.map(({
|
|
244
|
+
indent,
|
|
245
|
+
node
|
|
246
|
+
}) => indent * 2 + node.name.length));
|
|
247
|
+
for (const {
|
|
248
|
+
indent,
|
|
249
|
+
node
|
|
250
|
+
} of rows) {
|
|
251
|
+
const childMs = [...node.children.values()].reduce((sum, child) => sum + child.ms, 0);
|
|
252
|
+
const self = node.children.size === 0 ? '' : `self ${ms(node.ms - childMs)}`;
|
|
253
|
+
cliOut(' ' + ' '.repeat(indent * 2) + chalk.yellow`${node.name.padEnd(nameWidth - indent * 2)}` + ' ' + chalk.orange`${ms(node.ms).padStart(10)}` + ' ' + chalk.mediumgrey`${self.padStart(14)}` + ' ' + chalk.mediumgrey`${`${node.calls.toLocaleString()} calls`.padStart(13)}` + ' ' + chalk.mediumgrey`${`${(node.ms / node.calls).toFixed(2)}ms each`}`);
|
|
218
254
|
}
|
|
219
255
|
}
|
|
220
256
|
// Other reports to print where the run total goes - the module load analysis registers itself here.
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { IsHTMLElement } from
|
|
2
|
-
import { DomRegion } from
|
|
3
|
-
import { DomPointer } from
|
|
4
|
-
import { ContentNodeComponentIsClassComponent, ContentNodeIsNonRendered, ContentNodeIsLiteral, ContentNodeIsHtml, ContentNodeIsComponent, ContentNodeIsArray, ContentNodeIsElement, ContentNodeElementHasValidKey } from
|
|
5
|
-
import { StringIsHtmlEvent, htmlEvents } from
|
|
6
|
-
import { out, warn } from
|
|
7
|
-
import { getStyledContentFromFunctionComponent } from
|
|
8
|
-
import { FunctionElement } from
|
|
9
|
-
import { jssToCss } from
|
|
10
|
-
import { htmlEventHandlerKey } from
|
|
11
|
-
import { todo } from
|
|
12
|
-
import { $contentNull } from
|
|
13
|
-
import { throwError } from
|
|
14
|
-
import { $number, $string, RenderedContentNodeIsArray, RenderedContentNodeIsLiteral, makeRenderedContentNodeNonRendered, makeRenderedContentNodeHtml, makeRenderedContentNodeLiteral, RenderedContentNodeIsNonRendered, WideRenderedContentNodeIsArray, WideRenderedContentNodeIsLiteral, WideRenderedContentNodeIsHtml, WideRenderedContentNodeIsComponent, RenderedContentNodeSingleIsHead, RenderedContentNodeSingleIsComponent, RenderedContentNodeSingleIsHtml, RenderedContentNodeIsElement, RenderedContentNodeSingleIsLiteral } from
|
|
15
|
-
import { hasValidKey } from
|
|
16
|
-
import { $key, $props, $routeData, $routeParams, $type } from
|
|
17
|
-
import { printComponentNamesInSource } from
|
|
18
|
-
import { bindableHtmlElementsNumber, bindableHtmlElementsString } from
|
|
19
|
-
import { checkedValueToBoolean } from
|
|
20
|
-
import { markOptionSelected } from
|
|
21
|
-
import { innerHtmlFromProps } from
|
|
22
|
-
import { validChildren } from
|
|
1
|
+
import { IsHTMLElement } from '../DomNodes.js';
|
|
2
|
+
import { DomRegion } from '../DomRegion.js';
|
|
3
|
+
import { DomPointer } from '../DomPointer.js';
|
|
4
|
+
import { ContentNodeComponentIsClassComponent, ContentNodeIsNonRendered, ContentNodeIsLiteral, ContentNodeIsHtml, ContentNodeIsComponent, ContentNodeIsArray, ContentNodeIsElement, ContentNodeElementHasValidKey } from '../ContentNode.js';
|
|
5
|
+
import { StringIsHtmlEvent, htmlEvents } from '../htmlEvents.js';
|
|
6
|
+
import { out, warn } from '../appOutput.js';
|
|
7
|
+
import { getStyledContentFromFunctionComponent } from '../getStyledContentFromFunctionComponent.js';
|
|
8
|
+
import { FunctionElement } from '../FunctionComponentStandIn.js';
|
|
9
|
+
import { jssToCss } from '../style/jssToCss.js';
|
|
10
|
+
import { htmlEventHandlerKey } from '../htmlEventHandlerKey.js';
|
|
11
|
+
import { todo } from '../todo.js';
|
|
12
|
+
import { $contentNull } from '../symbols.js';
|
|
13
|
+
import { throwError } from '../throwError.js';
|
|
14
|
+
import { $number, $string, RenderedContentNodeIsArray, RenderedContentNodeIsLiteral, makeRenderedContentNodeNonRendered, makeRenderedContentNodeHtml, makeRenderedContentNodeLiteral, RenderedContentNodeIsNonRendered, WideRenderedContentNodeIsArray, WideRenderedContentNodeIsLiteral, WideRenderedContentNodeIsHtml, WideRenderedContentNodeIsComponent, RenderedContentNodeSingleIsHead, RenderedContentNodeSingleIsComponent, RenderedContentNodeSingleIsHtml, RenderedContentNodeIsElement, RenderedContentNodeSingleIsLiteral } from '../RenderedContentNode.js';
|
|
15
|
+
import { hasValidKey } from '../hasValidKey.js';
|
|
16
|
+
import { $key, $props, $routeData, $routeParams, $type } from '../contentNodeSymbols.js';
|
|
17
|
+
import { printComponentNamesInSource } from '../render/printComponentNameInSource.js';
|
|
18
|
+
import { bindableHtmlElementsNumber, bindableHtmlElementsString } from '../components/bindable/bindableHtmlElements.js';
|
|
19
|
+
import { checkedValueToBoolean } from '../checkedValueToBoolean.js';
|
|
20
|
+
import { markOptionSelected } from '../markOptionSelected.js';
|
|
21
|
+
import { innerHtmlFromProps } from '../innerHtmlFromProps.js';
|
|
22
|
+
import { validChildren } from '../validChildren.js';
|
|
23
23
|
import { setCurrentComponent } from 'tungsten/hooks/setCurrentComponent.js';
|
|
24
24
|
import { clearCurrentComponent } from 'tungsten/hooks/clearCurrentComponent.js';
|
|
25
|
-
import { isDev } from
|
|
26
|
-
import { $original } from
|
|
27
|
-
import { booleanAttributeValue } from
|
|
28
|
-
import { propsAreEqual } from
|
|
29
|
-
import { markRendered, refreshTracing, renderedAt, trace, tracing } from
|
|
30
|
-
import { beginMountScope, discardPendingMounts, endMountScope, queueMount } from
|
|
25
|
+
import { isDev } from '../isDev.js';
|
|
26
|
+
import { $original } from '../componentProxyHandlers.js';
|
|
27
|
+
import { booleanAttributeValue } from '../booleanAttributeValue.js';
|
|
28
|
+
import { propsAreEqual } from '../propsAreEqual.js';
|
|
29
|
+
import { markRendered, refreshTracing, renderedAt, trace, tracing } from '../stateTracking.js';
|
|
30
|
+
import { beginMountScope, discardPendingMounts, endMountScope, queueMount } from './pendingMounts.js';
|
|
31
31
|
/**
|
|
32
32
|
* How many dom nodes each element's rendered content currently occupies, recorded on
|
|
33
33
|
* every real update. When an update is skipped for unchanged props the child's dom is
|
package/dist/validChildren.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentNodeIsRendered } from
|
|
2
|
-
import { RenderingNodeIsRendered } from
|
|
1
|
+
import { ContentNodeIsRendered } from './ContentNode.js';
|
|
2
|
+
import { RenderingNodeIsRendered } from './RenderingNode.js';
|
|
3
3
|
export function validChildren(children) {
|
|
4
4
|
return ContentNodeIsRendered(children);
|
|
5
5
|
//return children === 0 || children
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
2
|
import chokidar from 'chokidar';
|
|
3
|
-
import { getFrameworkDir } from
|
|
4
|
-
import { cliWarn } from
|
|
3
|
+
import { getFrameworkDir } from './getFrameworkDir.js';
|
|
4
|
+
import { cliWarn } from './cliOutput.js';
|
|
5
5
|
// Dev mode only, opt-in via warnOnFrameworkChange in tungsten.config.js. Node's ESM module
|
|
6
6
|
// cache can't be invalidated at runtime, so an already-running dev server can't pick up a
|
|
7
7
|
// change to the tungsten package itself (e.g. a linked/workspace copy being rebuilt) without a
|
package/dist/zones/react.js
CHANGED
|
@@ -2,9 +2,9 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import { TungstenSimpleComponent } from "../Components.js";
|
|
5
|
-
import { createElementRef } from
|
|
6
|
-
import { isServer } from
|
|
7
|
-
import { jsx as _jsx } from "tungsten/
|
|
5
|
+
import { createElementRef } from '../createRef.js';
|
|
6
|
+
import { isServer } from '../isServer.js';
|
|
7
|
+
import { jsx as _jsx } from "tungsten/jsx-runtime";
|
|
8
8
|
export class ReactZone extends TungstenSimpleComponent {
|
|
9
9
|
constructor(...args) {
|
|
10
10
|
super(...args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tungsten",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"./library": "./dist/components/library/index.js",
|
|
14
14
|
"./react-zone": "./dist/zones/react.js",
|
|
15
15
|
"./testing": "./dist/testing/index.js",
|
|
16
|
+
"./jsx-runtime": "./dist/jsx-runtime.js",
|
|
16
17
|
"./*": "./dist/*",
|
|
17
18
|
"./types/*": "./types/*"
|
|
18
19
|
},
|
|
@@ -31,19 +32,19 @@
|
|
|
31
32
|
"@babel/core": "^7.29.0",
|
|
32
33
|
"@babel/parser": "^7.29.2",
|
|
33
34
|
"@babel/plugin-syntax-import-assertions": "^7.29.7",
|
|
34
|
-
"@babel/
|
|
35
|
+
"@babel/preset-env": "^7.29.7",
|
|
35
36
|
"@babel/preset-react": "^7.28.5",
|
|
37
|
+
"@babel/preset-typescript": "^7.29.7",
|
|
36
38
|
"@babel/types": "^7.29.0",
|
|
37
39
|
"@hono/node-server": "^1.19.11",
|
|
38
|
-
"@rollup/plugin-babel": "^
|
|
39
|
-
"@rollup/plugin-commonjs": "^
|
|
40
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
41
|
+
"@rollup/plugin-commonjs": "^28.0.9",
|
|
40
42
|
"@rollup/plugin-json": "^6.1.0",
|
|
41
|
-
"@rollup/plugin-node-resolve": "^
|
|
43
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
42
44
|
"@rollup/plugin-terser": "^1.0.0",
|
|
43
45
|
"@types/babel__core": "^7.20.5",
|
|
44
46
|
"@types/express": "^5.0.6",
|
|
45
47
|
"babel-plugin-css-to-js": "^0.0.4",
|
|
46
|
-
"babel-plugin-sxy-module-resolver": "^4.1.9",
|
|
47
48
|
"babel-plugin-sxy-transform-cjs-to-esm": "^0.2.6",
|
|
48
49
|
"bcryptjs": "^3.0.3",
|
|
49
50
|
"chalk": "^5.6.2",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"precinct": "^12.2.0",
|
|
73
74
|
"react-router": "^6.30.3",
|
|
74
75
|
"require-resolve-hook": "^1.1.0",
|
|
75
|
-
"rollup": "^
|
|
76
|
+
"rollup": "^4.63.1",
|
|
76
77
|
"rollup-plugin-gzip": "^3.1.2",
|
|
77
78
|
"sass": "^1.102.0",
|
|
78
79
|
"serialize-javascript": "^6.0.2",
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": {
|
|
90
91
|
"@babel/generator": "^7.29.1",
|
|
92
|
+
"@stylistic/eslint-plugin": "^3.1.0",
|
|
91
93
|
"@types/babel-types": "^7.0.16",
|
|
92
94
|
"@types/babel__generator": "^7.27.0",
|
|
93
95
|
"@types/chai": "^4.3.20",
|
|
@@ -100,8 +102,8 @@
|
|
|
100
102
|
"@types/react": "19.1.9",
|
|
101
103
|
"@types/react-dom": "19.1.7",
|
|
102
104
|
"@types/serialize-javascript": "^5.0.4",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
104
|
-
"@typescript-eslint/parser": "^
|
|
105
|
+
"@typescript-eslint/eslint-plugin": "^8.69.0",
|
|
106
|
+
"@typescript-eslint/parser": "^8.69.0",
|
|
105
107
|
"babel-plugin-replace-import-extension": "^1.1.5",
|
|
106
108
|
"babel-plugin-sxy-transform-import-extensions": "^1.0.5",
|
|
107
109
|
"babel-plugin-transform-import-extension": "^1.0.3",
|
|
@@ -113,12 +115,17 @@
|
|
|
113
115
|
"happy-dom": "^20.11.1",
|
|
114
116
|
"rimraf": "^5.0.10",
|
|
115
117
|
"rollup-plugin-visualizer": "^5.14.0",
|
|
116
|
-
"sxy-test-runner": "^2.4.
|
|
118
|
+
"sxy-test-runner": "^2.4.9",
|
|
117
119
|
"typescript": "^6.0.3"
|
|
118
120
|
},
|
|
119
121
|
"peerDependencies": {
|
|
120
122
|
"react": "^18.2.0 || ^19.0.0",
|
|
121
|
-
"react-dom": "^18.2.0 || ^19.0.0"
|
|
123
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
124
|
+
},
|
|
125
|
+
"__oldDependencies": {
|
|
126
|
+
"babel-plugin-sxy-module-resolver": "^4.1.9"
|
|
127
|
+
},
|
|
128
|
+
"__oldPeerDependencies": {
|
|
122
129
|
"rollup": "^2.79.1"
|
|
123
130
|
},
|
|
124
131
|
"peerDependenciesMeta": {
|
package/types/modules.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
declare module '@babel/preset-react'
|
|
2
|
+
declare module '@babel/preset-env'
|
|
3
|
+
declare module '@babel/preset-typescript'
|
|
2
4
|
declare module 'babel-plugin-sxy-module-resolver'
|
|
3
5
|
declare module 'babel-plugin-css-to-js'
|
|
4
6
|
declare module '@babel/plugin-transform-class-properties'
|