tungsten 0.4.13 → 0.5.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/.build-complete +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/Components.d.ts +41 -0
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +60 -72
- package/dist/ContentNode.d.ts +8 -2
- package/dist/ContentNode.d.ts.map +1 -1
- package/dist/ContentNode.js +4 -1
- package/dist/Framework.js +4 -4
- package/dist/FrameworkConfig.d.ts +0 -2
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.d.ts +1 -1
- package/dist/FunctionComponentStandIn.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.js +1 -0
- package/dist/Instance/Instance.js +2 -2
- package/dist/RenderingNode.d.ts +2 -2
- package/dist/RenderingNode.d.ts.map +1 -1
- package/dist/Script.d.ts +1 -1
- package/dist/Script.d.ts.map +1 -1
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +10 -0
- package/dist/Servers/loadEnvsDev.js +10 -10
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +8 -9
- package/dist/Store/makeStore.d.ts +4 -4
- package/dist/Store/makeStore.d.ts.map +1 -1
- package/dist/Store/makeStore.js +23 -57
- package/dist/_client/cjsHelpers.d.ts.map +1 -1
- package/dist/_client/cjsHelpers.js +4 -2
- package/dist/_client/client.js +0 -14
- package/dist/_client/hmr.d.ts +2 -0
- package/dist/_client/hmr.d.ts.map +1 -0
- package/dist/_client/hmr.js +65 -0
- package/dist/_client/liveReload.d.ts +2 -0
- package/dist/_client/liveReload.d.ts.map +1 -0
- package/dist/_client/liveReload.js +6 -0
- package/dist/_client/liveReloadSource.d.ts +3 -0
- package/dist/_client/liveReloadSource.d.ts.map +1 -0
- package/dist/_client/liveReloadSource.js +25 -0
- package/dist/babelPlugins/BabelTransformDocInit.d.ts +9 -0
- package/dist/babelPlugins/BabelTransformDocInit.d.ts.map +1 -0
- package/dist/babelPlugins/BabelTransformDocInit.js +201 -0
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +1 -10
- package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +1 -1
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +82 -75
- package/dist/browserStorage.d.ts +56 -18
- package/dist/browserStorage.d.ts.map +1 -1
- package/dist/browserStorage.js +172 -102
- package/dist/build/bundle.d.ts +1 -1
- package/dist/build/bundle.d.ts.map +1 -1
- package/dist/build/bundle.js +45 -31
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +0 -1
- package/dist/build/createClientFiles.d.ts.map +1 -1
- package/dist/build/createClientFiles.js +4 -8
- package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
- package/dist/build/getSxyClientPackageAliases.js +3 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +5 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.js +5 -1
- package/dist/cliOutput.d.ts +5 -0
- package/dist/cliOutput.d.ts.map +1 -1
- package/dist/cliOutput.js +22 -0
- package/dist/componentProxyHandlers.d.ts +20 -13
- package/dist/componentProxyHandlers.d.ts.map +1 -1
- package/dist/componentProxyHandlers.js +130 -86
- package/dist/components/Link.d.ts +1 -1
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/NativeHtml.d.ts +10 -0
- package/dist/components/NativeHtml.d.ts.map +1 -0
- package/dist/components/NativeHtml.js +12 -0
- package/dist/components/PopMessages.d.ts +1 -1
- package/dist/components/PopMessages.d.ts.map +1 -1
- package/dist/components/Protected.d.ts +10 -0
- package/dist/components/Protected.d.ts.map +1 -0
- package/dist/components/Protected.js +12 -0
- package/dist/components/Stylesheet.d.ts +1 -1
- package/dist/components/Stylesheet.d.ts.map +1 -1
- package/dist/components/bindable/BindableCheckbox.d.ts +1 -1
- package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
- package/dist/components/bindable/BindableInput.d.ts +1 -1
- package/dist/components/bindable/BindableInput.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputNonString.d.ts +1 -1
- package/dist/components/bindable/BindableInputNonString.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputString.d.ts +1 -1
- package/dist/components/bindable/BindableInputString.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTyped.d.ts +1 -1
- package/dist/components/bindable/BindableInputTyped.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
- package/dist/components/bindable/BindableRadio.d.ts +1 -1
- package/dist/components/bindable/BindableRadio.d.ts.map +1 -1
- package/dist/components/bindable/BindableSelect.d.ts +1 -1
- package/dist/components/bindable/BindableSelect.d.ts.map +1 -1
- package/dist/components/bindable/BindableTextarea.d.ts +1 -1
- package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -1
- package/dist/components/library/RichTextEditor/contentTree.js +2 -1
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts +1 -1
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts.map +1 -1
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +0 -1
- package/dist/devBanner.d.ts +4 -0
- package/dist/devBanner.d.ts.map +1 -0
- package/dist/devBanner.js +50 -0
- package/dist/docInit.d.ts +16 -0
- package/dist/docInit.d.ts.map +1 -0
- package/dist/docInit.js +54 -0
- package/dist/env/getEnvSchemas.d.ts +1 -1
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +21 -22
- package/dist/env/registerEnvSchemas.d.ts +13 -0
- package/dist/env/registerEnvSchemas.d.ts.map +1 -0
- package/dist/env/registerEnvSchemas.js +23 -0
- package/dist/frameworkConfigSchema.d.ts +0 -2
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +0 -1
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +14 -3
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts +1 -0
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -1
- package/dist/hydrate/renderHydrationMismatchBanner.js +11 -63
- package/dist/indexInner.d.ts +6 -2
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +6 -1
- package/dist/jsxRuntime.d.ts +1 -1
- package/dist/jsxRuntime.d.ts.map +1 -1
- package/dist/jsxRuntime.js +9 -7
- package/dist/jsxRuntimeSignals.d.ts +8 -4
- package/dist/jsxRuntimeSignals.d.ts.map +1 -1
- package/dist/jsxRuntimeSignals.js +8 -6
- package/dist/mutatingFunctions.d.ts +2 -1
- package/dist/mutatingFunctions.d.ts.map +1 -1
- package/dist/mutatingFunctions.js +7 -1
- package/dist/nbsp.d.ts +2 -2
- package/dist/nbsp.d.ts.map +1 -1
- package/dist/rawHtml/filterContentNode.d.ts.map +1 -1
- package/dist/rawHtml/filterContentNode.js +3 -1
- package/dist/render/HeadData.d.ts +1 -0
- package/dist/render/HeadData.d.ts.map +1 -1
- package/dist/render/contentNodeToHtml.d.ts.map +1 -1
- package/dist/render/contentNodeToHtml.js +2 -1
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +3 -1
- package/dist/render/contentTreeToRenderingTree.d.ts.map +1 -1
- package/dist/render/contentTreeToRenderingTree.js +5 -1
- package/dist/render/processHead.d.ts.map +1 -1
- package/dist/render/processHead.js +15 -34
- package/dist/render/readDocInitScript.d.ts +3 -0
- package/dist/render/readDocInitScript.d.ts.map +1 -0
- package/dist/render/readDocInitScript.js +15 -0
- package/dist/render/rootToHtmlDev.d.ts.map +1 -1
- package/dist/routing/Group.d.ts +1 -1
- package/dist/routing/Group.d.ts.map +1 -1
- package/dist/routing/MatchedRoute.d.ts +1 -1
- package/dist/routing/MatchedRoute.d.ts.map +1 -1
- package/dist/settings.d.ts +3 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +4 -0
- package/dist/signals/tracking.d.ts +33 -0
- package/dist/signals/tracking.d.ts.map +1 -0
- package/dist/signals/tracking.js +87 -0
- package/dist/style/styleContentSxy.d.ts.map +1 -1
- package/dist/style/styleContentSxy.js +6 -1
- package/dist/testing/installTestDocInit.d.ts +2 -0
- package/dist/testing/installTestDocInit.d.ts.map +1 -0
- package/dist/testing/installTestDocInit.js +6 -0
- package/dist/throwError.d.ts.map +1 -1
- package/dist/throwError.js +4 -1
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +39 -3
- package/dist/warnOnFrameworkChange.js +1 -1
- package/package.json +7 -6
- package/readme.md +2 -135
- package/types/assets.d.ts +21 -0
- package/types/index.d.ts +24 -29
- package/types/jsx/html.d.ts +0 -1
- package/types/jsx/html.global.d.ts +0 -1
- package/types/jsx/html.values.d.ts +0 -1
- package/types/jsx/jsx.d.ts +8 -8
- package/vendor/manifest.json +2 -2
|
@@ -1,69 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
1
|
+
import { renderDevBanner } from '../devBanner.js';
|
|
2
|
+
// The report as an attribute on <html>: a machine-readable hook (tests, tooling, app styling)
|
|
3
|
+
// that no Tungsten bookkeeping ever touches - updateAttributes diffs against its own record of
|
|
4
|
+
// what it last set, never the DOM's live attribute list, so this is never visited or removed.
|
|
3
5
|
export const hydrationMismatchAttribute = 'data-tungsten-hydration-mismatches';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// A real element - even one appended after hydration finishes and never
|
|
9
|
-
// touched again by this code - is not actually safe here. Every container
|
|
10
|
-
// Tungsten re-renders gets a fresh `new DomRegion(containerDomNode)` built
|
|
11
|
-
// from whatever is *actually* in its childNodes at that moment, and every
|
|
12
|
-
// position Tungsten writes to next is a raw index into that same list
|
|
13
|
-
// (DomPointer.get/next/prev, and several inline `childNodes[domPointer.index]`
|
|
14
|
-
// reads in integrateUpdateVdom.ts/hydrate.tsx). An extra, untracked child
|
|
15
|
-
// shifts every index after it, so the next update touching that container
|
|
16
|
-
// - body, in a typical app - would compare and write to the wrong nodes.
|
|
17
|
-
// There is no flag on an element that makes the walker skip it; it would
|
|
18
|
-
// have to be built into DomPointer/DomRegion and every direct childNodes
|
|
19
|
-
// access alongside them, which is a core-framework change, not a banner.
|
|
20
|
-
//
|
|
21
|
-
// Attributes are a different story: reconcileHydratedAttributes only runs
|
|
22
|
-
// once, during hydration, before this ever runs, and every later update
|
|
23
|
-
// (updateAttributes) diffs against domNode.__tungsten_oldAttributes - its
|
|
24
|
-
// own private record of what it last set - never the DOM's live attribute
|
|
25
|
-
// list. A plain setAttribute() here is in neither its old props nor its new
|
|
26
|
-
// props, so it is never visited, and never removed.
|
|
27
|
-
//
|
|
28
|
-
// So: set an attribute on <html> (outside Tungsten's own bookkeeping, so
|
|
29
|
-
// permanently untouched by it) and let a `content: attr(...)` pseudo-element
|
|
30
|
-
// display it. A pseudo-element is not a real node - never in .childNodes,
|
|
31
|
-
// never visited by DomPointer or DomRegion - so this carries zero index risk
|
|
32
|
-
// for the app's own reconciliation, at the cost of one small, deliberately
|
|
33
|
-
// hacky wrinkle: a single <style> tag inserted into <head> once.
|
|
34
|
-
//
|
|
35
|
-
// head is not structurally exempt from diffing in general - it currently
|
|
36
|
-
// just never gets diffed node-by-node during hydration (hydrateNodeSingle's
|
|
37
|
-
// 'head' case skips it outright, a known hack, not a guarantee), and nothing
|
|
38
|
-
// in a typical app changes head's vdom children after mount, so the general
|
|
39
|
-
// update path never exercises it either. That could change. What head does
|
|
40
|
-
// already have is a marker for exactly this situation - data--t-persist,
|
|
41
|
-
// used by processHead.ts for framework-injected head content (the entry
|
|
42
|
-
// script, the component CSS link) that isn't part of the app's own vdom and
|
|
43
|
-
// must survive hydration - so this style tag carries it too, rather than
|
|
44
|
-
// riding on the blanket skip alone.
|
|
6
|
+
// The visible, selectable report. Exported so an application can restyle it.
|
|
7
|
+
export const hydrationMismatchBannerId = 'tungsten-hydration-mismatches';
|
|
8
|
+
// Reports hydration mismatches in the page, not only the console - see devBanner.ts for where
|
|
9
|
+
// and why the banner lives in <head>.
|
|
45
10
|
export function renderHydrationMismatchBanner(mismatches, doc = document) {
|
|
46
11
|
if (mismatches.length === 0) return;
|
|
47
|
-
if (doc.getElementById(styleId) === null) {
|
|
48
|
-
const style = doc.createElement('style');
|
|
49
|
-
style.id = styleId;
|
|
50
|
-
style.setAttribute('data--t-persist', 'true');
|
|
51
|
-
style.textContent = `
|
|
52
|
-
html[${hydrationMismatchAttribute}]::before {
|
|
53
|
-
content: attr(${hydrationMismatchAttribute});
|
|
54
|
-
display: block;
|
|
55
|
-
background: #7a1f1f;
|
|
56
|
-
color: #fff;
|
|
57
|
-
font: 13px/1.5 monospace;
|
|
58
|
-
padding: 8px 12px;
|
|
59
|
-
max-height: 33vh;
|
|
60
|
-
overflow: auto;
|
|
61
|
-
white-space: pre-wrap;
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
doc.head.appendChild(style);
|
|
65
|
-
}
|
|
66
12
|
const heading = `Tungsten: ${mismatches.length} hydration mismatch${mismatches.length === 1 ? '' : 'es'} (dev only)`;
|
|
67
13
|
const lines = mismatches.map(mismatch => `<${mismatch.tagName}> ${mismatch.name}: ` + `rendered ${JSON.stringify(mismatch.expected)}, server sent ${JSON.stringify(mismatch.actual)}`);
|
|
68
|
-
|
|
14
|
+
const report = [heading, ...lines].join('\n');
|
|
15
|
+
doc.documentElement.setAttribute(hydrationMismatchAttribute, report);
|
|
16
|
+
renderDevBanner(hydrationMismatchBannerId, report, doc);
|
|
69
17
|
}
|
package/dist/indexInner.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './TungstenAppOld.js';
|
|
2
2
|
export { TungstenSimpleComponent, TungstenSimpleComponent as SimpleComponent, // static component
|
|
3
3
|
TungstenStatefulComponent, TungstenStatefulComponent as StatefulComponent, // stateful component
|
|
4
|
-
TungstenBaseSimpleStoreComponent, TungstenBaseSimpleStoreComponent as BaseSimpleStoreComponent, TungstenBaseStatefulStoreComponent, TungstenBaseStatefulStoreComponent as BaseStatefulStoreComponent, } from './Components.jsx';
|
|
4
|
+
TungstenSignalsComponent as __TungstenSignalsComponent, TungstenSignalsComponent as __SignalsComponent, TungstenBaseSimpleStoreComponent, TungstenBaseSimpleStoreComponent as BaseSimpleStoreComponent, TungstenBaseStatefulStoreComponent, TungstenBaseStatefulStoreComponent as BaseStatefulStoreComponent, } from './Components.jsx';
|
|
5
5
|
export * from './alive.js';
|
|
6
6
|
export * from './appOutput.js';
|
|
7
7
|
export * from './AssignedStyle.js';
|
|
@@ -16,8 +16,10 @@ export * from './components/bindable/BindableTextarea.jsx';
|
|
|
16
16
|
export * from './components/GoToComponent.jsx';
|
|
17
17
|
export * from './components/Lazy.js';
|
|
18
18
|
export * from './components/Link.jsx';
|
|
19
|
+
export * from './components/NativeHtml.jsx';
|
|
19
20
|
export * from './components/PopMessages.jsx';
|
|
20
|
-
export * from './components/
|
|
21
|
+
export * from './components/Protected.jsx';
|
|
22
|
+
export { RawHtml, type RawHtmlProps, RawHtml as ParseHtml, type RawHtmlProps as ParseHtmlProps } from './components/RawHtml.jsx';
|
|
21
23
|
export * from './components/RouteRedirectComponent.jsx';
|
|
22
24
|
export { parseHtml, type ParseHtmlOptions } from './rawHtml/parseHtml.js';
|
|
23
25
|
export { safeHtmlAllowList } from './rawHtml/safeHtmlAllowList.js';
|
|
@@ -31,6 +33,7 @@ export { pop, dismissPop } from './pop.js';
|
|
|
31
33
|
export * from './browserStorage.js';
|
|
32
34
|
export { createElement } from './createElement.js';
|
|
33
35
|
export * from './createRef.js';
|
|
36
|
+
export { docInit } from './docInit.js';
|
|
34
37
|
export { foreach } from './foreach.js';
|
|
35
38
|
export * from './helpers/index.js';
|
|
36
39
|
export * from './hooks/index.js';
|
|
@@ -45,6 +48,7 @@ export { isProd } from './isProd.js';
|
|
|
45
48
|
export { logAndReturn } from './logAndReturn.js';
|
|
46
49
|
export * from './requests/index.js';
|
|
47
50
|
export { registerGlobalData, type GlobalData, type GlobalDataFunction } from './routing/registerGlobalData.js';
|
|
51
|
+
export { registerPrivateEnvSchema, registerPublicEnvSchema, type PrivateEnvSchema, type PublicEnvSchema, } from './env/registerEnvSchemas.js';
|
|
48
52
|
export * from './routing/MatchedRoute.js';
|
|
49
53
|
export * from './routing/RedirectCode.js';
|
|
50
54
|
export * from './routing/Route.jsx';
|
package/dist/indexInner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexInner.d.ts","sourceRoot":"","sources":["../src/indexInner.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACH,uBAAuB,EAAE,uBAAuB,IAAI,eAAe,EAAE,mBAAmB;AACxF,yBAAyB,EAAE,yBAAyB,IAAI,iBAAiB,EAAE,qBAAqB;
|
|
1
|
+
{"version":3,"file":"indexInner.d.ts","sourceRoot":"","sources":["../src/indexInner.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACH,uBAAuB,EAAE,uBAAuB,IAAI,eAAe,EAAE,mBAAmB;AACxF,yBAAyB,EAAE,yBAAyB,IAAI,iBAAiB,EAAE,qBAAqB;AAChG,wBAAwB,IAAI,0BAA0B,EAAE,wBAAwB,IAAI,kBAAkB,EAEtG,gCAAgC,EAAE,gCAAgC,IAAI,wBAAwB,EAC9F,kCAAkC,EAAE,kCAAkC,IAAI,0BAA0B,GACvG,MAAM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MAAM,sBAAsB,CAAA;AACtF,YAAY,EACR,0BAA0B,EAAE,0BAA0B,IAAI,SAAS,EACnE,gCAAgC,EAAE,gCAAgC,IAAI,eAAe,EACrF,cAAc,EACjB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,mBAAmB,mBAAmB,CAAA"}
|
package/dist/indexInner.js
CHANGED
|
@@ -4,6 +4,7 @@ export { TungstenSimpleComponent, TungstenSimpleComponent as SimpleComponent,
|
|
|
4
4
|
// static component
|
|
5
5
|
TungstenStatefulComponent, TungstenStatefulComponent as StatefulComponent,
|
|
6
6
|
// stateful component
|
|
7
|
+
TungstenSignalsComponent as __TungstenSignalsComponent, TungstenSignalsComponent as __SignalsComponent,
|
|
7
8
|
//TungstenBaseStoreComponent as TungstenBaseStoreComponent, TungstenBaseStoreComponent as BaseStoreComponent,
|
|
8
9
|
TungstenBaseSimpleStoreComponent, TungstenBaseSimpleStoreComponent as BaseSimpleStoreComponent, TungstenBaseStatefulStoreComponent, TungstenBaseStatefulStoreComponent as BaseStatefulStoreComponent } from "./Components.js";
|
|
9
10
|
// other
|
|
@@ -21,8 +22,10 @@ export * from "./components/bindable/BindableTextarea.js";
|
|
|
21
22
|
export * from "./components/GoToComponent.js";
|
|
22
23
|
export * from './components/Lazy.js';
|
|
23
24
|
export * from "./components/Link.js";
|
|
25
|
+
export * from "./components/NativeHtml.js";
|
|
24
26
|
export * from "./components/PopMessages.js";
|
|
25
|
-
export * from "./components/
|
|
27
|
+
export * from "./components/Protected.js";
|
|
28
|
+
export { RawHtml, RawHtml as ParseHtml } from "./components/RawHtml.js";
|
|
26
29
|
export * from "./components/RouteRedirectComponent.js";
|
|
27
30
|
export { parseHtml } from './rawHtml/parseHtml.js';
|
|
28
31
|
export { safeHtmlAllowList } from './rawHtml/safeHtmlAllowList.js';
|
|
@@ -35,6 +38,7 @@ export { pop, dismissPop } from './pop.js';
|
|
|
35
38
|
export * from './browserStorage.js';
|
|
36
39
|
export { createElement } from './createElement.js';
|
|
37
40
|
export * from './createRef.js';
|
|
41
|
+
export { docInit } from './docInit.js'; // what BabelTransformDocInit rewrites DocInit() calls into; installs the DocInit global
|
|
38
42
|
//export * from './env/funcs.js'
|
|
39
43
|
//export * from './env/index.js'
|
|
40
44
|
export { foreach } from './foreach.js';
|
|
@@ -55,6 +59,7 @@ export { logAndReturn } from './logAndReturn.js';
|
|
|
55
59
|
export * from './requests/index.js';
|
|
56
60
|
//export * from './zones/react.jsx'
|
|
57
61
|
export { registerGlobalData } from './routing/registerGlobalData.js';
|
|
62
|
+
export { registerPrivateEnvSchema, registerPublicEnvSchema } from './env/registerEnvSchemas.js';
|
|
58
63
|
export * from './routing/MatchedRoute.js';
|
|
59
64
|
export * from './routing/RedirectCode.js';
|
|
60
65
|
export * from "./routing/Route.js";
|
package/dist/jsxRuntime.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { KeyAttr } from './KeyAttr.js';
|
|
|
3
3
|
import { type TungstenComponentGenericProps } from './Components.jsx';
|
|
4
4
|
import { ContentNode } from './ContentNode.js';
|
|
5
5
|
export * from './contentNodeSymbols.js';
|
|
6
|
-
export declare const Fragment:
|
|
6
|
+
export declare const Fragment: symbol;
|
|
7
7
|
export type JsxNodeType = string | AnyComponentType | typeof Fragment;
|
|
8
8
|
export declare function jsx(type: JsxNodeType | string | number | boolean | null | undefined, props: TungstenComponentGenericProps, key: KeyAttr): ContentNode;
|
|
9
9
|
export declare const jsxs: (...args: Parameters<typeof jsx>) => ContentNode;
|
package/dist/jsxRuntime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsxRuntime.d.ts","sourceRoot":"","sources":["../src/jsxRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,KAAK,6BAA6B,EAAoD,MAAM,kBAAkB,CAAA;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAM9C,cAAc,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"jsxRuntime.d.ts","sourceRoot":"","sources":["../src/jsxRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,KAAK,6BAA6B,EAAoD,MAAM,kBAAkB,CAAA;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAM9C,cAAc,yBAAyB,CAAA;AAIvC,eAAO,MAAM,QAAQ,QAAY,CAAA;AAGjC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,OAAO,QAAQ,CAAA;AAkBrE,wBAAgB,GAAG,CACf,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAChE,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,OAAO,GACb,WAAW,CAoFb;AAID,eAAO,MAAM,IAAI,GAAY,GAAG,MAAM,UAAU,CAAC,OAAO,GAAG,CAAC,gBAG3D,CAAA"}
|
package/dist/jsxRuntime.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TungstenBaseComponent } from "./Components.js";
|
|
2
2
|
import { TungstenError } from './TungstenError.js';
|
|
3
|
-
import { $key, $props, $type } from './contentNodeSymbols.js';
|
|
3
|
+
import { $fragment, $key, $props, $type } from './contentNodeSymbols.js';
|
|
4
4
|
import { packageNameCapitalized } from './settings.js';
|
|
5
5
|
import { throwError } from './throwError.js';
|
|
6
6
|
export * from './contentNodeSymbols.js';
|
|
7
7
|
//import { inspect } from 'util'
|
|
8
|
-
|
|
8
|
+
// what the babel automatic runtime imports for `<>…</>`; the node it makes is unwrapped by the renderers
|
|
9
|
+
export const Fragment = $fragment;
|
|
9
10
|
// (?outdated?) this doesn't seem to handle string/number/undefined correctly
|
|
10
11
|
function classNameArrayToString(array) {
|
|
11
12
|
let result = '';
|
|
@@ -47,10 +48,11 @@ export function jsx(type, props, key) {
|
|
|
47
48
|
}
|
|
48
49
|
//const { children, ...filteredProps } = props
|
|
49
50
|
if (type === Fragment) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
return {
|
|
52
|
+
[$type]: $fragment,
|
|
53
|
+
[$props]: props,
|
|
54
|
+
[$key]: key
|
|
55
|
+
};
|
|
54
56
|
}
|
|
55
57
|
if (typeof type === 'function') {
|
|
56
58
|
// element
|
|
@@ -88,7 +90,7 @@ export function jsx(type, props, key) {
|
|
|
88
90
|
if (typeof type === 'number') {
|
|
89
91
|
return String(type);
|
|
90
92
|
}
|
|
91
|
-
throw new TungstenError(`${packageNameCapitalized} JSX Runtime error: did not recognize element` + `, expected a string, function, class (type function), or fragment.` + ` Received type ${typeof type}: ${type}`);
|
|
93
|
+
throw new TungstenError(`${packageNameCapitalized} JSX Runtime error: did not recognize element` + `, expected a string, function, class (type function), or fragment.` + ` Received type ${typeof type}: ${String(type)}`);
|
|
92
94
|
}
|
|
93
95
|
// jsxs is used when children is an array instead of a single object
|
|
94
96
|
// just use the same function for both
|
|
@@ -2,17 +2,21 @@ import type { AnyComponentType } from './AnyComponentType.js';
|
|
|
2
2
|
import type { TungstenComponentGenericProps } from './Components.jsx';
|
|
3
3
|
import type { KeyAttr } from './KeyAttr.js';
|
|
4
4
|
export * from './contentNodeSymbols.js';
|
|
5
|
-
export declare const Fragment:
|
|
5
|
+
export declare const Fragment: symbol;
|
|
6
6
|
export type JsxNodeType = string | AnyComponentType | typeof Fragment;
|
|
7
7
|
export declare const TypeSymbol: unique symbol;
|
|
8
|
-
export declare function jsx(type: JsxNodeType | string | number | boolean | null | undefined, props: TungstenComponentGenericProps, key: KeyAttr): string |
|
|
9
|
-
type:
|
|
8
|
+
export declare function jsx(type: JsxNodeType | string | number | boolean | null | undefined, props: TungstenComponentGenericProps, key: KeyAttr): string | {
|
|
9
|
+
type: symbol;
|
|
10
|
+
props: TungstenComponentGenericProps;
|
|
11
|
+
key: KeyAttr;
|
|
12
|
+
} | {
|
|
13
|
+
type: AnyComponentType;
|
|
10
14
|
props: TungstenComponentGenericProps;
|
|
11
15
|
key: KeyAttr;
|
|
12
16
|
} | {
|
|
13
17
|
type: string;
|
|
14
18
|
props: TungstenComponentGenericProps;
|
|
15
19
|
key: KeyAttr;
|
|
16
|
-
} | null
|
|
20
|
+
} | null;
|
|
17
21
|
export declare const jsxs: typeof jsx;
|
|
18
22
|
//# sourceMappingURL=jsxRuntimeSignals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsxRuntimeSignals.d.ts","sourceRoot":"","sources":["../src/jsxRuntimeSignals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"jsxRuntimeSignals.d.ts","sourceRoot":"","sources":["../src/jsxRuntimeSignals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C,cAAc,yBAAyB,CAAA;AAEvC,eAAO,MAAM,QAAQ,QAAY,CAAA;AAEjC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,OAAO,QAAQ,CAAA;AAGrE,eAAO,MAAM,UAAU,eAAiB,CAAA;AAcxC,wBAAgB,GAAG,CACf,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAChE,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,OAAO;;;;;;;;;;;;SAkEf;AAID,eAAO,MAAM,IAAI,YAAM,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TungstenError } from './TungstenError.js';
|
|
2
2
|
import { packageNameCapitalized } from './settings.js';
|
|
3
3
|
import { throwError } from './throwError.js';
|
|
4
|
+
import { $fragment } from './contentNodeSymbols.js';
|
|
4
5
|
export * from './contentNodeSymbols.js';
|
|
5
|
-
export const Fragment =
|
|
6
|
+
export const Fragment = $fragment;
|
|
6
7
|
//// TODO use this symbol for type
|
|
7
8
|
export const TypeSymbol = Symbol('type');
|
|
8
9
|
// (?outdated?) this doesn't seem to handle string/number/undefined correctly
|
|
@@ -35,10 +36,11 @@ export function jsx(type, props, key) {
|
|
|
35
36
|
}
|
|
36
37
|
//const { children, ...filteredProps } = props
|
|
37
38
|
if (type === Fragment) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return {
|
|
40
|
+
type,
|
|
41
|
+
props,
|
|
42
|
+
key
|
|
43
|
+
};
|
|
42
44
|
}
|
|
43
45
|
if (typeof type === 'function') {
|
|
44
46
|
return {
|
|
@@ -65,7 +67,7 @@ export function jsx(type, props, key) {
|
|
|
65
67
|
if (typeof type === 'number') {
|
|
66
68
|
return String(type);
|
|
67
69
|
}
|
|
68
|
-
throw new TungstenError(`${packageNameCapitalized} JSX Runtime error: did not recognize element` + `, expected a string, function, class (type function), or fragment.` + ` Received type ${typeof type}: ${type}`);
|
|
70
|
+
throw new TungstenError(`${packageNameCapitalized} JSX Runtime error: did not recognize element` + `, expected a string, function, class (type function), or fragment.` + ` Received type ${typeof type}: ${String(type)}`);
|
|
69
71
|
}
|
|
70
72
|
// jsx func for static elements
|
|
71
73
|
// not sure exactly what this is, just use the same func for now
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare const arrayMutatingFunctions: readonly ["push", "pop", "shift", "unshift", "sort", "splice", "reverse"];
|
|
1
|
+
export declare const arrayMutatingFunctions: readonly ["push", "pop", "shift", "unshift", "sort", "splice", "reverse", "fill", "copyWithin"];
|
|
2
2
|
type ArrayMutatingFunctions = typeof arrayMutatingFunctions[number];
|
|
3
|
+
export declare const arrayMutatingFunctionInsertsFrom: Partial<Record<ArrayMutatingFunctions, number>>;
|
|
3
4
|
export declare const mapMutatingFunctions: readonly ["set", "delete", "clear"];
|
|
4
5
|
type MapMutatingFunctions = typeof mapMutatingFunctions[number];
|
|
5
6
|
export declare const setMutatingFunctions: readonly ["add", "delete", "clear"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutatingFunctions.d.ts","sourceRoot":"","sources":["../src/mutatingFunctions.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"mutatingFunctions.d.ts","sourceRoot":"","sources":["../src/mutatingFunctions.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,iGAEzB,CAAA;AACV,KAAK,sBAAsB,GAAG,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAA;AAGnE,eAAO,MAAM,gCAAgC,EAAE,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAE5F,CAAA;AAED,eAAO,MAAM,oBAAoB,qCAAsC,CAAA;AACvE,KAAK,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AAE/D,eAAO,MAAM,oBAAoB,qCAAsC,CAAA;AACvE,KAAK,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AAE/D,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,sBAAsB,CAGrF;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,oBAAoB,CAGjF;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,oBAAoB,CAGjF"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export const arrayMutatingFunctions = ['push', 'pop', 'shift', 'unshift', 'sort', 'splice', 'reverse'];
|
|
1
|
+
export const arrayMutatingFunctions = ['push', 'pop', 'shift', 'unshift', 'sort', 'splice', 'reverse', 'fill', 'copyWithin'];
|
|
2
|
+
// index of the first argument that becomes an element, for the mutators that insert values
|
|
3
|
+
export const arrayMutatingFunctionInsertsFrom = {
|
|
4
|
+
unshift: 0,
|
|
5
|
+
splice: 2,
|
|
6
|
+
fill: 0
|
|
7
|
+
};
|
|
2
8
|
export const mapMutatingFunctions = ['set', 'delete', 'clear'];
|
|
3
9
|
export const setMutatingFunctions = ['add', 'delete', 'clear'];
|
|
4
10
|
export function KeyIsArrayMutatingFunction(key) {
|
package/dist/nbsp.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const nbsp: import("./ContentNode.js").
|
|
2
|
-
export declare const space: import("./ContentNode.js").
|
|
1
|
+
export declare const nbsp: import("./ContentNode.js").ContentNodeElement;
|
|
2
|
+
export declare const space: import("./ContentNode.js").ContentNodeElement;
|
|
3
3
|
//# sourceMappingURL=nbsp.d.ts.map
|
package/dist/nbsp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nbsp.d.ts","sourceRoot":"","sources":["../src/nbsp.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"nbsp.d.ts","sourceRoot":"","sources":["../src/nbsp.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,+CAAc,CAAA;AAC/B,eAAO,MAAM,KAAK,+CAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterContentNode.d.ts","sourceRoot":"","sources":["../../src/rawHtml/filterContentNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAA;AAI/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"filterContentNode.d.ts","sourceRoot":"","sources":["../../src/rawHtml/filterContentNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAA;AAI/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AA2FvD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,WAAW,CAE1F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentNodeIsComponent } from '../ContentNode.js';
|
|
1
|
+
import { ContentNodeIsComponent, ContentNodeIsFragment } from '../ContentNode.js';
|
|
2
2
|
import { $props, $type } from '../contentNodeSymbols.js';
|
|
3
3
|
import { StringIsHtmlEvent } from '../htmlEvents.js';
|
|
4
4
|
import { blockedUrl, makeAllowCheck, removalFor, urlAttributes } from './parseHtml.js';
|
|
@@ -60,6 +60,8 @@ function filter(node, allow) {
|
|
|
60
60
|
// rather than reachable: nothing that round-trips through storage (JSON)
|
|
61
61
|
// can carry a class or function reference.
|
|
62
62
|
if (ContentNodeIsComponent(node)) return node;
|
|
63
|
+
// parseHtml never produces a fragment either; one from JSX is just its children
|
|
64
|
+
if (ContentNodeIsFragment(node)) return filter(node[$props].children ?? null, allow);
|
|
63
65
|
const tag = node[$type];
|
|
64
66
|
const removal = removalFor(tag, true, allow);
|
|
65
67
|
if (removal === 'drop') return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeadData.d.ts","sourceRoot":"","sources":["../../src/render/HeadData.ts"],"names":[],"mappings":"AACA,OAAO,E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,EAAE,sBAAsB,CAAC;IAC1C,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,OAAO,GAAG,QAAQ,CAAA;IACvB,GAAG,EAAE,OAAO,CAAA;IAEZ,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentNodeToHtml.d.ts","sourceRoot":"","sources":["../../src/render/contentNodeToHtml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"contentNodeToHtml.d.ts","sourceRoot":"","sources":["../../src/render/contentNodeToHtml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAgD3D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentNodeIsComponent } from '../ContentNode.js';
|
|
1
|
+
import { ContentNodeIsComponent, ContentNodeIsFragment } from '../ContentNode.js';
|
|
2
2
|
import { booleanAttributeValue } from '../booleanAttributeValue.js';
|
|
3
3
|
import { $props, $type } from '../contentNodeSymbols.js';
|
|
4
4
|
import { htmlEntities } from '../htmlEntities.js';
|
|
@@ -28,6 +28,7 @@ export function contentNodeToHtml(node) {
|
|
|
28
28
|
if (node === undefined || node === null || node === false || node === true) return '';
|
|
29
29
|
if (Array.isArray(node)) return node.map(contentNodeToHtml).join('');
|
|
30
30
|
if (typeof node === 'string' || typeof node === 'number') return htmlEntities(node.toString());
|
|
31
|
+
if (ContentNodeIsFragment(node)) return contentNodeToHtml(node[$props].children);
|
|
31
32
|
if (ContentNodeIsComponent(node)) {
|
|
32
33
|
throwError('contentNodeToHtml', `component nodes are not supported - encountered one of type ` + `${String(typeof node[$type] === 'string' ? node[$type] : node[$type].name)}.`);
|
|
33
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentToHtml.d.ts","sourceRoot":"","sources":["../../src/render/contentToHtml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAY,YAAY,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAIvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"contentToHtml.d.ts","sourceRoot":"","sources":["../../src/render/contentToHtml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAY,YAAY,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAIvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAI9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,wBAAsB,aAAa,CAC/B,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EACpE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EACxC,MAAM,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,YAAY,EACnE,iBAAiB,GAAE,sBAAkC,EAAE,GAAG,UAAQ,GACnE,OAAO,CAAC,MAAM,CAAC,CAwDjB"}
|
|
@@ -2,6 +2,7 @@ import { renderingNodeToHtml } from './renderingTreeToHtml.js';
|
|
|
2
2
|
import { TungstenError } from '../TungstenError.js';
|
|
3
3
|
import { RenderingNodeIsElement } from '../RenderingNode.js';
|
|
4
4
|
import { contentTreeToRenderingTree } from './contentTreeToRenderingTree.js';
|
|
5
|
+
import { readDocInitScript } from './readDocInitScript.js';
|
|
5
6
|
import { cliWarn } from 'tungsten/cliOutput.js';
|
|
6
7
|
export async function contentToHtml(compilationInfo, clientImportAliases, content, instance, config, siteBasePathOverride, tungstenPublicEnv = undefined, dev = false) {
|
|
7
8
|
// const rootNode = { // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
@@ -25,7 +26,8 @@ export async function contentToHtml(compilationInfo, clientImportAliases, conten
|
|
|
25
26
|
tungstenPublicEnv,
|
|
26
27
|
siteBasePath: siteBasePathOverride,
|
|
27
28
|
hmr: config.hmr,
|
|
28
|
-
csr: config.csr
|
|
29
|
+
csr: config.csr,
|
|
30
|
+
docInitScript: readDocInitScript(compilationInfo.buildLocation)
|
|
29
31
|
};
|
|
30
32
|
//console.log('rendering tree', inspect(tree, { depth: 99 } ))
|
|
31
33
|
let html = await renderingNodeToHtml(tree, false, headData, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentTreeToRenderingTree.d.ts","sourceRoot":"","sources":["../../src/render/contentTreeToRenderingTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EACH,KAAK,WAAW,EAEnB,MAAM,mBAAmB,CAAA;AAS1B,wBAAsB,0BAA0B,CAC5C,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAC9F,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"contentTreeToRenderingTree.d.ts","sourceRoot":"","sources":["../../src/render/contentTreeToRenderingTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EACH,KAAK,WAAW,EAEnB,MAAM,mBAAmB,CAAA;AAS1B,wBAAsB,0BAA0B,CAC5C,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAC9F,OAAO,CAAC,aAAa,CAAC,CAgFzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentNodeIsLiteral, ContentNodeElementIsComponent, ContentNodeElementIsHtml } from '../ContentNode.js';
|
|
1
|
+
import { ContentNodeIsLiteral, ContentNodeElementIsComponent, ContentNodeElementIsHtml, ContentNodeIsFragment } from '../ContentNode.js';
|
|
2
2
|
import { validChildren } from '../validChildren.js';
|
|
3
3
|
import { debug } from './debug.js';
|
|
4
4
|
import { throwError } from '../throwError.js';
|
|
@@ -25,6 +25,10 @@ export async function contentTreeToRenderingTree(node, parentComponent, instance
|
|
|
25
25
|
if (ContentNodeIsLiteral(node)) {
|
|
26
26
|
return node.toString();
|
|
27
27
|
}
|
|
28
|
+
// a fragment renders as its children; the rendering tree never holds one
|
|
29
|
+
if (ContentNodeIsFragment(node)) {
|
|
30
|
+
return contentTreeToRenderingTree(node[$props].children, parentComponent, instance, noEscape);
|
|
31
|
+
}
|
|
28
32
|
debug('typeof type', typeof node[$type]);
|
|
29
33
|
if (ContentNodeElementIsHtml(node)) {
|
|
30
34
|
processHtmlNode(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processHead.d.ts","sourceRoot":"","sources":["../../src/render/processHead.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAK7C,OAAO,EAAE,oBAAoB,EAAqB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"processHead.d.ts","sourceRoot":"","sources":["../../src/render/processHead.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAK7C,OAAO,EAAE,oBAAoB,EAAqB,MAAM,qBAAqB,CAAA;AAQ7E,wBAAgB,WAAW,CACvB,QAAQ,EAAE,oBAAoB,EAC9B,QAAQ,EAAE,QAAQ,QAwJrB"}
|
|
@@ -3,7 +3,6 @@ import { clientFolder, componentCssFolder, componentCssFile } from '../settings.
|
|
|
3
3
|
import { addImportMap } from './addImportMap.js';
|
|
4
4
|
import { $props, $type } from '../contentNodeSymbols.js';
|
|
5
5
|
import { windowGlobalEnvStatement } from 'tungsten/env/windowGlobalEnvStatement.js';
|
|
6
|
-
import { frameworkDestLocation } from '../build/frameworkDestLocation.js';
|
|
7
6
|
import { devErrorPageClearRetryScript } from '../Servers/devErrorPageAutoRetry.js';
|
|
8
7
|
// process the tree returned by the root component
|
|
9
8
|
// doing things like ensuring there is are html and head elements,
|
|
@@ -51,6 +50,16 @@ export function processHead(headNode, headData) {
|
|
|
51
50
|
};
|
|
52
51
|
if (dev) scriptNode[$props].type = 'module';else scriptNode[$props].defer = true;
|
|
53
52
|
headNode[$props].children.unshift(scriptNode);
|
|
53
|
+
// DocInit functions: a sync inline script, so they run before <body> and before the entry
|
|
54
|
+
if (headData.docInitScript !== undefined) {
|
|
55
|
+
headNode[$props].children.unshift({
|
|
56
|
+
[$type]: 'script',
|
|
57
|
+
[$props]: {
|
|
58
|
+
'data--t-internal': undefined,
|
|
59
|
+
children: headData.docInitScript
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
54
63
|
// public env
|
|
55
64
|
if (dev) {
|
|
56
65
|
if (headData.tungstenPublicEnv !== undefined) {
|
|
@@ -87,44 +96,16 @@ export function processHead(headNode, headData) {
|
|
|
87
96
|
}
|
|
88
97
|
};
|
|
89
98
|
headNode[$props].children.unshift(clearErrorRetryScriptNode);
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
// framework's traced dependency graph makes the package-copying step that serves
|
|
94
|
-
// framework code to the browser throw (it requires every import specifier to be
|
|
95
|
-
// statically known so it can be rewritten/copied). Keeping this logic as untraced text
|
|
96
|
-
// sidesteps that. applyHmrModule.js itself has no dynamic imports, so it's safely
|
|
97
|
-
// reachable via a normal static import elsewhere (see hydrate.tsx) and gets copied
|
|
98
|
-
// there, then loaded here by computed URL. See tungsten/docs/hmr.md.
|
|
99
|
-
// Tier 1 (hmr: 'reload', or nothing left for Tier 2 to do): always full-reload. A
|
|
100
|
-
// simple, independent branch from Tier 2's logic - restored as an explicit config value
|
|
101
|
-
// so it's available as a one-line escape hatch if Tier 2 itself is misbehaving.
|
|
102
|
-
// The server sends its bootId as the first event on every connection (see
|
|
103
|
-
// handleLiveReloadStream). If sessionStorage already holds a different one, this
|
|
104
|
-
// connection is a reconnect to a process that restarted since the page loaded (e.g. via
|
|
105
|
-
// tungsten devmon on a framework rebuild) - EventSource retries silently on its own, so
|
|
106
|
-
// this is the only reliable signal that the page is now stale and needs reloading.
|
|
107
|
-
const bootIdReloadSnippet = `es.addEventListener('boot',function(ev){` + `var bootId=JSON.parse(ev.data).bootId;` + `var key='__tungsten_boot_id__';` + `var prev=sessionStorage.getItem(key);` + `sessionStorage.setItem(key,bootId);` + `if(prev!==null&&prev!==bootId){location.reload()}` + `});`;
|
|
108
|
-
const tier1OnlyScript = `(function(){` + `var es=new EventSource('${siteBasePath}/__tungsten_live_reload__');` + bootIdReloadSnippet + `es.addEventListener('css',function(){location.reload()});` + `es.addEventListener('js',function(){location.reload()});` + `})();`;
|
|
109
|
-
// Tier 2: attempt an in-place component/CSS hot-swap before falling back to a full
|
|
110
|
-
// reload. See tungsten/docs/hmr.md.
|
|
111
|
-
const tier2Script = `(function(){` + `var es=new EventSource('${siteBasePath}/__tungsten_live_reload__');` + `function fullReload(reason){console.info('[tungsten-hmr] full reload:',reason);location.reload()}` + `es.addEventListener('boot',function(ev){` + `var bootId=JSON.parse(ev.data).bootId;` + `var key='__tungsten_boot_id__';` + `var prev=sessionStorage.getItem(key);` + `sessionStorage.setItem(key,bootId);` + `if(prev!==null&&prev!==bootId){fullReload('dev server restarted')}` + `});` + `function loadHmr(){return import('${frameworkDestLocation}/hmr/applyHmrModule.js')}`
|
|
112
|
-
// CSS has no state to preserve, so re-applying it is always safe: refreshStylesheets()
|
|
113
|
-
// inserts the new link and only removes the old one once it's loaded, so there's no
|
|
114
|
-
// gap where nothing is applied (a plain href swap can produce a visible flash).
|
|
115
|
-
+ `es.addEventListener('css',function(){` + `console.info('[tungsten-hmr] css change, refreshing stylesheets');` + `loadHmr().then(function(hmr){return Promise.all(hmr.refreshStylesheets())})` + `.catch(function(e){console.error('[tungsten-hmr] stylesheet refresh failed',e)});` + `});` + `es.addEventListener('js',function(ev){` + `var payload;` + `try{payload=JSON.parse(ev.data)}catch(e){fullReload('bad payload');return}` + `var files=(payload&&payload.files)||[];` + `if(files.length===0){fullReload('no files in payload');return}` + `console.info('[tungsten-hmr] fetching',files);` + `loadHmr().then(function(hmr){`
|
|
116
|
-
// a component's own inline style block piggybacks on this same JS pipeline (it
|
|
117
|
-
// lives in the .tsx/.jsx source, not a separate .css file), so refresh stylesheets
|
|
118
|
-
// here too rather than only on a dedicated 'css' event - independently of the
|
|
119
|
-
// component swap below, so a stylesheet load error doesn't force a full reload.
|
|
120
|
-
+ `Promise.all(hmr.refreshStylesheets())` + `.catch(function(e){console.error('[tungsten-hmr] stylesheet refresh failed',e)});` + `return Promise.all(files.map(function(f){return import(f+'?t='+Date.now())}))` + `.then(function(modules){` + `return Promise.all(modules.map(function(m,i){return hmr.applyHmrModule(m,files[i])}))` + `})` + `})` + `.then(function(results){` + `console.info('[tungsten-hmr] results',results);` + `if(results.some(function(r){return r&&r.orphaned})){fullReload('a component export was renamed or removed');return}` + `if(!results.some(function(r){return r&&r.matched}))fullReload('no matching live component found')` + `})` + `.catch(function(e){console.error('[tungsten-hmr] swap failed',e);fullReload('error during swap')});` + `});` + `})();`;
|
|
121
|
-
// hmr === false: no live-reload script at all (auto-refresh fully disabled).
|
|
99
|
+
// Live reload / HMR: real modules in _client, copied untraced into .client by
|
|
100
|
+
// createClientFiles (see the note atop _client/hmr.ts). hmr === true runs Tier 2 (hmr.js),
|
|
101
|
+
// 'reload' the always-full-reload Tier 1 (liveReload.js), false injects nothing.
|
|
122
102
|
if (hmr !== false) {
|
|
123
103
|
const liveReloadScriptNode = {
|
|
124
104
|
[$type]: 'script',
|
|
125
105
|
[$props]: {
|
|
126
106
|
'data--t-internal': undefined,
|
|
127
|
-
|
|
107
|
+
type: 'module',
|
|
108
|
+
src: `${siteBasePath}/${clientFolder}/${hmr === true ? 'hmr.js' : 'liveReload.js'}`
|
|
128
109
|
}
|
|
129
110
|
};
|
|
130
111
|
headNode[$props].children.unshift(liveReloadScriptNode);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readDocInitScript.d.ts","sourceRoot":"","sources":["../../src/render/readDocInitScript.ts"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEjE;AAID,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM3E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { clientFolder, docInitFile } from '../settings.js';
|
|
4
|
+
export function docInitFileLocation(buildLocation) {
|
|
5
|
+
return join(buildLocation, clientFolder, docInitFile);
|
|
6
|
+
}
|
|
7
|
+
// The generated head script, ready to inline; undefined when nothing uses DocInit. Read per render:
|
|
8
|
+
// the dev compile rewrites the file on every change, and it is a few lines.
|
|
9
|
+
export function readDocInitScript(buildLocation) {
|
|
10
|
+
const location = docInitFileLocation(buildLocation);
|
|
11
|
+
if (!existsSync(location)) return undefined;
|
|
12
|
+
const content = readFileSync(location, 'utf8').trim();
|
|
13
|
+
if (content === '') return undefined;
|
|
14
|
+
return content.replaceAll('</script', '<\\/script');
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootToHtmlDev.d.ts","sourceRoot":"","sources":["../../src/render/rootToHtmlDev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rootToHtmlDev.d.ts","sourceRoot":"","sources":["../../src/render/rootToHtmlDev.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAI,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAI,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAI,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAGpE,wBAAsB,aAAa,CAC/B,eAAe,EAAE,eAAe,EAAG,mBAAmB,EAAE,aAAa,EACrE,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,uBAAuB,EACzF,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,YAAY,mBAMjF"}
|
package/dist/routing/Group.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export type GroupProps = {
|
|
|
7
7
|
data?: RouteDataFunction<any, any>;
|
|
8
8
|
};
|
|
9
9
|
export declare class Group extends TungstenSimpleComponent<GroupProps> {
|
|
10
|
-
content: () => string | number | boolean | import("../ContentNode.js").ContentNodeHtml | import("../ContentNode.js").ContentNodeClassComponent | import("../ContentNode.js").ContentNodeFunctionComponent | import("../ContentNode.js").ContentNodeArray | null;
|
|
10
|
+
content: () => string | number | boolean | import("../ContentNode.js").ContentNodeHtml | import("../ContentNode.js").ContentNodeClassComponent | import("../ContentNode.js").ContentNodeFunctionComponent | import("../ContentNode.js").ContentNodeFragment | import("../ContentNode.js").ContentNodeArray | null;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../src/routing/Group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,IAAI,CAAC,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAErC,CAAA;AAED,qBAAa,KAAM,SAAQ,uBAAuB,CAAC,UAAU,CAAC;IAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../src/routing/Group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,IAAI,CAAC,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAErC,CAAA;AAED,qBAAa,KAAM,SAAQ,uBAAuB,CAAC,UAAU,CAAC;IAC1D,OAAO,2SAGN;CACJ"}
|
|
@@ -9,6 +9,6 @@ export type MatchedRouteProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare class MatchedRoute extends TungstenSimpleInternalStoreComponent<MatchedRouteProps> {
|
|
11
11
|
init: () => void;
|
|
12
|
-
content: () => string | number | boolean | import("../ContentNode.js").ContentNodeHtml | import("../ContentNode.js").ContentNodeClassComponent | import("../ContentNode.js").ContentNodeFunctionComponent | import("../ContentNode.js").ContentNodeArray | null | undefined;
|
|
12
|
+
content: () => string | number | boolean | import("../ContentNode.js").ContentNodeHtml | import("../ContentNode.js").ContentNodeClassComponent | import("../ContentNode.js").ContentNodeFunctionComponent | import("../ContentNode.js").ContentNodeFragment | import("../ContentNode.js").ContentNodeArray | null | undefined;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=MatchedRoute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatchedRoute.d.ts","sourceRoot":"","sources":["../../src/routing/MatchedRoute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,oCAAoC,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,WAAW,EAA0B,MAAM,mBAAmB,CAAA;AAIvE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,KAAK,CAAC,EAAE,aAAa,CAAA;CACxB,CAAA;AACD,qBAAa,YAAa,SAAQ,oCAAoC,CAAC,iBAAiB,CAAC;IACrF,IAAI,aAA4C;IAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"MatchedRoute.d.ts","sourceRoot":"","sources":["../../src/routing/MatchedRoute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,oCAAoC,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,WAAW,EAA0B,MAAM,mBAAmB,CAAA;AAIvE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,KAAK,CAAC,EAAE,aAAa,CAAA;CACxB,CAAA;AACD,qBAAa,YAAa,SAAQ,oCAAoC,CAAC,iBAAiB,CAAC;IACrF,IAAI,aAA4C;IAChD,OAAO,uTAaN;CACJ"}
|