tungsten 0.3.13 → 0.4.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.
Files changed (41) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/FrameworkConfig.d.ts +0 -1
  3. package/dist/FrameworkConfig.d.ts.map +1 -1
  4. package/dist/ReqRes.d.ts +163 -1
  5. package/dist/ReqRes.d.ts.map +1 -1
  6. package/dist/ReqRes.js +5 -0
  7. package/dist/Servers/DevServer.d.ts.map +1 -1
  8. package/dist/Servers/DevServer.js +10 -12
  9. package/dist/Servers/ProdServer.d.ts.map +1 -1
  10. package/dist/Servers/ProdServer.js +8 -7
  11. package/dist/Servers/StaticSiteServer.d.ts.map +1 -1
  12. package/dist/Servers/StaticSiteServer.js +2 -1
  13. package/dist/Servers/serveStatic.d.ts +5 -0
  14. package/dist/Servers/serveStatic.d.ts.map +1 -0
  15. package/dist/Servers/serveStatic.js +13 -0
  16. package/dist/api/Request.d.ts +1 -1
  17. package/dist/api/Request.d.ts.map +1 -1
  18. package/dist/api/Response.d.ts +1 -1
  19. package/dist/api/Response.d.ts.map +1 -1
  20. package/dist/helpers/getFetchCompatibleHeaders.d.ts +1 -1
  21. package/dist/helpers/getFetchCompatibleHeaders.d.ts.map +1 -1
  22. package/dist/hydrate/hydrate.d.ts +2 -0
  23. package/dist/hydrate/hydrate.d.ts.map +1 -1
  24. package/dist/hydrate/hydrate.js +25 -28
  25. package/dist/markOptionSelected.d.ts +15 -0
  26. package/dist/markOptionSelected.d.ts.map +1 -0
  27. package/dist/markOptionSelected.js +31 -0
  28. package/dist/postcssPlugins/TransformCssNames.d.ts.map +1 -1
  29. package/dist/postcssPlugins/TransformCssNames.js +9 -0
  30. package/dist/postcssPlugins/scopeAnimationValue.d.ts.map +1 -1
  31. package/dist/postcssPlugins/scopeAnimationValue.js +4 -6
  32. package/dist/postcssPlugins/unwrapIgnoreMarker.d.ts +2 -0
  33. package/dist/postcssPlugins/unwrapIgnoreMarker.d.ts.map +1 -0
  34. package/dist/postcssPlugins/unwrapIgnoreMarker.js +9 -0
  35. package/dist/render/componentNodeToRenderingTree.js +1 -0
  36. package/dist/render/processRenderingNodeHtml.d.ts.map +1 -1
  37. package/dist/render/processRenderingNodeHtml.js +3 -30
  38. package/dist/testing/hydrateTestApp.js +2 -5
  39. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  40. package/dist/update/integrateUpdateVdom.js +8 -11
  41. package/package.json +4 -3
@@ -1 +1 @@
1
- 1786887752204
1
+ 1788168941029
@@ -32,7 +32,6 @@ export type FrameworkConfigBase = {
32
32
  suppressEnvOverwriteWarnings?: boolean;
33
33
  warnOnFrameworkChange?: boolean;
34
34
  hmr?: boolean | 'reload';
35
- csr?: boolean;
36
35
  };
37
36
  export type FrameworkConfigWithRootComponent = FrameworkConfigBase & {
38
37
  useRootComponent?: true;
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkConfig.d.ts","sourceRoot":"","sources":["../src/FrameworkConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInD,KAAK,WAAW,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC5C,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACtC,KAAK,kBAAkB,GAAG,MAAM,CAAA;AAEhC,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAenF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAA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M,wBAAwB,GAAG,IAAI,CAC3C,2BAA2B,EAC3B,YAAY,GAAG,gBAAgB,CAC9B,CAAA"}
package/dist/ReqRes.d.ts CHANGED
@@ -1,4 +1,166 @@
1
- import { Request, Response } from 'express';
1
+ declare global {
2
+ namespace Express {
3
+ interface Request {
4
+ }
5
+ interface Response {
6
+ }
7
+ }
8
+ }
9
+ export interface IncomingHeaders {
10
+ 'set-cookie'?: string[] | undefined;
11
+ [name: string]: string | string[] | undefined;
12
+ }
13
+ export interface OutgoingHeaders {
14
+ [name: string]: number | string | string[] | undefined;
15
+ }
16
+ export interface ParsedQuery {
17
+ [key: string]: undefined | string | ParsedQuery | (string | ParsedQuery)[];
18
+ }
19
+ export interface MediaType {
20
+ value: string;
21
+ quality: number;
22
+ type: string;
23
+ subtype: string;
24
+ }
25
+ export interface CookieOptions {
26
+ maxAge?: number | undefined;
27
+ signed?: boolean | undefined;
28
+ expires?: Date | undefined;
29
+ httpOnly?: boolean | undefined;
30
+ path?: string | undefined;
31
+ domain?: string | undefined;
32
+ secure?: boolean | undefined;
33
+ encode?: ((val: string) => string) | undefined;
34
+ sameSite?: boolean | 'lax' | 'strict' | 'none' | undefined;
35
+ priority?: 'low' | 'medium' | 'high';
36
+ partitioned?: boolean | undefined;
37
+ }
38
+ export interface RangeParserRange {
39
+ start: number;
40
+ end: number;
41
+ }
42
+ export interface RangeParserRanges extends Array<RangeParserRange> {
43
+ type: string;
44
+ }
45
+ export type RangeParserResult = -1 | -2;
46
+ export type Errback = (err?: Error) => void;
47
+ export type NextFunction = (err?: any) => void;
48
+ export interface Request extends Express.Request {
49
+ get(name: 'set-cookie'): string[] | undefined;
50
+ get(name: string): string | undefined;
51
+ header(name: 'set-cookie'): string[] | undefined;
52
+ header(name: string): string | undefined;
53
+ accepts(): string[];
54
+ accepts(type: string): string | false;
55
+ accepts(type: string[]): string | false;
56
+ accepts(...type: string[]): string | false;
57
+ acceptsCharsets(): string[];
58
+ acceptsCharsets(charset: string): string | false;
59
+ acceptsCharsets(charset: string[]): string | false;
60
+ acceptsCharsets(...charset: string[]): string | false;
61
+ acceptsEncodings(): string[];
62
+ acceptsEncodings(encoding: string): string | false;
63
+ acceptsEncodings(encoding: string[]): string | false;
64
+ acceptsEncodings(...encoding: string[]): string | false;
65
+ acceptsLanguages(): string[];
66
+ acceptsLanguages(lang: string): string | false;
67
+ acceptsLanguages(lang: string[]): string | false;
68
+ acceptsLanguages(...lang: string[]): string | false;
69
+ range(size: number, options?: {
70
+ combine?: boolean | undefined;
71
+ }): RangeParserRanges | RangeParserResult | undefined;
72
+ is(type: string | string[]): string | false | null;
73
+ accepted: MediaType[];
74
+ body: any;
75
+ cookies: any;
76
+ signedCookies: any;
77
+ params: Record<string, string | string[]>;
78
+ query: ParsedQuery;
79
+ readonly protocol: string;
80
+ readonly secure: boolean;
81
+ readonly ip: string | undefined;
82
+ readonly ips: string[];
83
+ readonly subdomains: string[];
84
+ readonly path: string;
85
+ readonly hostname: string;
86
+ readonly host: string;
87
+ readonly fresh: boolean;
88
+ readonly stale: boolean;
89
+ readonly xhr: boolean;
90
+ originalUrl: string;
91
+ baseUrl: string;
92
+ app: unknown;
93
+ route: any;
94
+ res?: Response | undefined;
95
+ next?: NextFunction | undefined;
96
+ headers: IncomingHeaders;
97
+ rawHeaders: string[];
98
+ httpVersion: string;
99
+ httpVersionMajor: number;
100
+ httpVersionMinor: number;
101
+ trailers: Record<string, string | undefined>;
102
+ rawTrailers: string[];
103
+ method: string;
104
+ url: string;
105
+ complete: boolean;
106
+ socket: unknown;
107
+ destroy(error?: Error): void;
108
+ setEncoding(encoding: string): this;
109
+ on(event: string, listener: (...args: any[]) => void): this;
110
+ once(event: string, listener: (...args: any[]) => void): this;
111
+ off(event: string, listener: (...args: any[]) => void): this;
112
+ }
113
+ export interface Response extends Express.Response {
114
+ status(code: number): this;
115
+ sendStatus(code: number): this;
116
+ links(links: any): this;
117
+ send(body?: any): this;
118
+ json(body?: any): this;
119
+ jsonp(body?: any): this;
120
+ sendFile(path: string, fn?: Errback): void;
121
+ sendFile(path: string, options: any, fn?: Errback): void;
122
+ download(path: string, fn?: Errback): void;
123
+ download(path: string, filename: string, fn?: Errback): void;
124
+ contentType(type: string): this;
125
+ type(type: string): this;
126
+ format(obj: any): this;
127
+ attachment(filename?: string): this;
128
+ set(field: any): this;
129
+ set(field: string, value?: string | string[]): this;
130
+ header(field: any): this;
131
+ header(field: string, value?: string | string[]): this;
132
+ get(field: string): string | undefined;
133
+ clearCookie(name: string, options?: CookieOptions): this;
134
+ cookie(name: string, val: any, options?: CookieOptions): this;
135
+ location(url: string): this;
136
+ redirect(url: string): void;
137
+ redirect(status: number, url: string): void;
138
+ render(view: string, options?: object, callback?: (err: Error, html: string) => void): void;
139
+ render(view: string, callback?: (err: Error, html: string) => void): void;
140
+ vary(field: string): this;
141
+ append(field: string, value?: string[] | string): this;
142
+ locals: Record<string, any>;
143
+ charset: string;
144
+ app: unknown;
145
+ req: Request;
146
+ statusCode: number;
147
+ statusMessage: string;
148
+ headersSent: boolean;
149
+ setHeader(name: string, value: number | string | readonly string[]): this;
150
+ getHeader(name: string): number | string | string[] | undefined;
151
+ getHeaders(): OutgoingHeaders;
152
+ getHeaderNames(): string[];
153
+ hasHeader(name: string): boolean;
154
+ removeHeader(name: string): void;
155
+ write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
156
+ end(chunk?: any, callback?: () => void): this;
157
+ writeHead(statusCode: number, headers?: OutgoingHeaders | (number | string | string[])[]): this;
158
+ flushHeaders(): void;
159
+ socket: unknown;
160
+ on(event: string, listener: (...args: any[]) => void): this;
161
+ once(event: string, listener: (...args: any[]) => void): this;
162
+ off(event: string, listener: (...args: any[]) => void): this;
163
+ }
2
164
  export type ReqRes = {
3
165
  req: Request;
4
166
  res: Response;
@@ -1 +1 @@
1
- {"version":3,"file":"ReqRes.d.ts","sourceRoot":"","sources":["../src/ReqRes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA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C,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAA;IAC/F,YAAY,IAAI,IAAI,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;IAC3D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;IAC7D,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;CAC/D;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,QAAQ,CAAA;CAAE,CAAA;AACpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,CAAA"}
package/dist/ReqRes.js CHANGED
@@ -1 +1,6 @@
1
+ // In-house structural mirror of express's Request/Response.
2
+ // Deliberately importless: importing from 'express' pulls @types/node ambients into every
3
+ // public type that reaches Instance/registerGlobalData, i.e. most of indexInner.
4
+ // Runtime objects are still express's - these types only have to be a supertype of them.
5
+ // Conformance against the real express types is asserted in ReqRes.sxyt.ts.
1
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../../src/Servers/DevServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAA4D,MAAM,SAAS,CAAA;AAGlF,OAAO,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,uBAAuB,EAAwB,MAAM,uBAAuB,CAAA;AAC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1B;IACD,IAAI,aAMH;CAGJ"}
@@ -19,6 +19,7 @@ import { log } from "../appOutput.js";
19
19
  import { throwError } from "../throwError.js";
20
20
  import { getRoutesDev } from "../getRoutesDevs.js";
21
21
  import { getComponentDev } from "../getComponentDev.js";
22
+ import { serveStatic } from "./serveStatic.js";
22
23
  import { routing } from "./routing.js";
23
24
  import { globalDataFunc } from "../routing/registerGlobalData.js";
24
25
  import { TungstenServer } from "./TungstenServer.js";
@@ -532,22 +533,19 @@ export class DevServer extends TungstenServer {
532
533
  this.addServerMiddleware(config.serverMiddleware);
533
534
  }
534
535
  // can we set the mime type for .cjs files?
535
- express.static.mime.define({
536
- 'application/javascript': ['cjs']
537
- });
538
- this.app.use(`/.tungsten.config.js`, express.static(join(this.compilationInfo.buildLocation, '.tungsten.config.js'))); // compiled packages
539
- this.app.use(`/${packagesFolder}/`, express.static(join(this.compilationInfo.buildLocation, packagesFolder))); // compiled packages
540
- this.app.use(`/${clientFolder}/`, express.static(join(this.compilationInfo.buildLocation, clientFolder))); // compiled packages
541
- this.app.use(`/${componentCssFolder}/`, express.static(join(this.compilationInfo.buildLocation, componentCssFolder))); // user component css
542
- this.app.use(`/${frameworkCssFolder}/`, express.static(join(this.compilationInfo.buildLocation, frameworkCssFolder))); // framework component css
543
- this.app.use(express.static(join(this.compilationInfo.buildLocation, staticFolder))); // compiled stylesheets? -- etag: false to disable caching
536
+ this.app.use(`/.tungsten.config.js`, serveStatic(join(this.compilationInfo.buildLocation, '.tungsten.config.js'))); // compiled packages
537
+ this.app.use(`/${packagesFolder}/`, serveStatic(join(this.compilationInfo.buildLocation, packagesFolder))); // compiled packages
538
+ this.app.use(`/${clientFolder}/`, serveStatic(join(this.compilationInfo.buildLocation, clientFolder))); // compiled packages
539
+ this.app.use(`/${componentCssFolder}/`, serveStatic(join(this.compilationInfo.buildLocation, componentCssFolder))); // user component css
540
+ this.app.use(`/${frameworkCssFolder}/`, serveStatic(join(this.compilationInfo.buildLocation, frameworkCssFolder))); // framework component css
541
+ this.app.use(serveStatic(join(this.compilationInfo.buildLocation, staticFolder))); // compiled stylesheets? -- etag: false to disable caching
544
542
  const publicLocation = join(this.compilationInfo.buildLocation, publicFolder);
545
- if (existsSync(publicLocation)) this.app.use(express.static(publicLocation)); // files from public folder
543
+ if (existsSync(publicLocation)) this.app.use(serveStatic(publicLocation)); // files from public folder
546
544
  //cliWarn(`assets dir:`, this.config.assetsDir)
547
545
  if (this.config.assetsDir !== undefined) {
548
- this.app.use(`/${this.config.assetsDir}`, express.static(join(this.compilationInfo.buildLocation, assetsFolder))); // files from assets folder
546
+ this.app.use(`/${this.config.assetsDir}`, serveStatic(join(this.compilationInfo.buildLocation, assetsFolder))); // files from assets folder
549
547
  }
550
- this.app.use(`/${this.compilationInfo.codeSubPath}`, express.static(this.compilationInfo.buildCodeLocation, {
548
+ this.app.use(`/${this.compilationInfo.codeSubPath}`, serveStatic(this.compilationInfo.buildCodeLocation, {
551
549
  dotfiles: 'allow'
552
550
  })); // serving the compiled app files
553
551
  //this.app.use('/__server_rpc__', this.handleRpc)
@@ -1 +1 @@
1
- {"version":3,"file":"ProdServer.d.ts","sourceRoot":"","sources":["../../src/Servers/ProdServer.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAI7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAQpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAM3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAKnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,O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AAE,IAAI,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IA0B5D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAY9B"}
@@ -14,6 +14,7 @@ import { makeInstanceConfigFromFrameworkConfig } from "../makeInstanceConfigFrom
14
14
  //import { addRequireResolveHooks } from '../reRouting/addRequireResolveHooks.js'
15
15
  import { standardizeWebPath } from "../standardizeWebPath.js";
16
16
  import { throwError } from "../throwError.js";
17
+ import { serveStatic } from "./serveStatic.js";
17
18
  import { routing } from "./routing.js";
18
19
  import { globalDataFunc } from "../routing/registerGlobalData.js";
19
20
  import { TungstenServer } from "./TungstenServer.js";
@@ -312,18 +313,18 @@ export class ProdServer extends TungstenServer {
312
313
  if (this.compilationInfo.bundleLocation === undefined) {
313
314
  throwError('ProdServer', 'compilationInfo.bundleLocation is unset/undefined');
314
315
  }
315
- this.app.use('/bundle', express.static(this.compilationInfo.bundleLocation));
316
- this.app.use(`/${componentCssFolder}/`, express.static(join(this.compilationInfo.buildLocation, componentCssFolder)));
317
- this.app.use(`/${frameworkCssFolder}/`, express.static(join(this.compilationInfo.buildLocation, frameworkCssFolder)));
316
+ this.app.use('/bundle', serveStatic(this.compilationInfo.bundleLocation));
317
+ this.app.use(`/${componentCssFolder}/`, serveStatic(join(this.compilationInfo.buildLocation, componentCssFolder)));
318
+ this.app.use(`/${frameworkCssFolder}/`, serveStatic(join(this.compilationInfo.buildLocation, frameworkCssFolder)));
318
319
  const publicLocation = join(this.compilationInfo.buildLocation, publicFolder);
319
320
  //console.log('publicLocation', publicLocation, existsSync(publicLocation))
320
- if (existsSync(publicLocation)) this.app.use(express.static(publicLocation)); // files from public folder
321
+ if (existsSync(publicLocation)) this.app.use(serveStatic(publicLocation)); // files from public folder
321
322
  //console.log("serving static files with etag")
322
- this.app.use(express.static(join(this.compilationInfo.buildLocation, staticFolder)));
323
+ this.app.use(serveStatic(join(this.compilationInfo.buildLocation, staticFolder)));
323
324
  if (this.config.assetsDir !== undefined) {
324
- this.app.use('/assets', express.static(join(this.compilationInfo.buildLocation, assetsFolder)));
325
+ this.app.use('/assets', serveStatic(join(this.compilationInfo.buildLocation, assetsFolder)));
325
326
  }
326
- this.app.use(`/${this.compilationInfo.codeSubPath}`, express.static(this.compilationInfo.buildCodeLocation));
327
+ this.app.use(`/${this.compilationInfo.codeSubPath}`, serveStatic(this.compilationInfo.buildCodeLocation));
327
328
  if (typeof _config.apiRoutes === 'string' && _config.apiRoutes !== '') {
328
329
  const apiPath = standardizeWebPath(this.config.apiPath);
329
330
  cliOut(`API listening at ${apiPath}`);
@@ -1 +1 @@
1
- {"version":3,"file":"StaticSiteServer.d.ts","sourceRoot":"","sources":["../../src/Servers/StaticSiteServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,qBAAa,gBAAgB;IACzB,MAAM,EAAE,uBAAuB,CAAA;IAE/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;gBAEd,MAAM,EAAE,uBAAuB;IAa3C,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAW3B;IACD,IAAI,aAEH;CACJ"}
1
+ {"version":3,"file":"StaticSiteServer.d.ts","sourceRoot":"","sources":["../../src/Servers/StaticSiteServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAM7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,qBAAa,gBAAgB;IACzB,MAAM,EAAE,uBAAuB,CAAA;IAE/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;gBAEd,MAAM,EAAE,uBAAuB;IAa3C,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAW3B;IACD,IAAI,aAEH;CACJ"}
@@ -2,6 +2,7 @@ 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 express from 'express';
5
+ import { serveStatic } from "./serveStatic.js";
5
6
  import { join } from 'path';
6
7
  import { staticSiteFolder } from "../settings.js";
7
8
  import { cliNews } from "../cliOutput.js";
@@ -32,7 +33,7 @@ export class StaticSiteServer {
32
33
  //this.port = 3001
33
34
  this.app = express();
34
35
  this.staticSiteLocation = join(process.cwd(), staticSiteFolder);
35
- this.app.use(this.config.siteBasePath, express.static(this.staticSiteLocation));
36
+ this.app.use(this.config.siteBasePath, serveStatic(this.staticSiteLocation));
36
37
  this.app.use(this.config.siteBasePath, (req, res) => res.send('Not found').end());
37
38
  if (this.config.siteBasePath) {
38
39
  this.app.use((req, res) => res.send(`The localtion ${req.path} is outside of the siteBasePath of ${this.config.siteBasePath}`).end());
@@ -0,0 +1,5 @@
1
+ import express from 'express';
2
+ type StaticOptions = NonNullable<Parameters<typeof express.static>[1]>;
3
+ export declare function serveStatic(root: string, options?: StaticOptions): ReturnType<typeof express.static>;
4
+ export {};
5
+ //# sourceMappingURL=serveStatic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serveStatic.d.ts","sourceRoot":"","sources":["../../src/Servers/serveStatic.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAKtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,CAQpG"}
@@ -0,0 +1,13 @@
1
+ import express from 'express';
2
+ // serve-static v2 (express 5) resolves .cjs to 'application/node', which browsers refuse to
3
+ // execute. Express 4's global `express.static.mime.define()` is gone in v5, so the mapping has
4
+ // to be set per response instead - wrapped here so every mount gets it, as the global did.
5
+ export function serveStatic(root, options) {
6
+ return express.static(root, {
7
+ ...options,
8
+ setHeaders: (res, path, stat) => {
9
+ if (path.endsWith('.cjs')) res.setHeader('Content-Type', 'text/javascript');
10
+ options?.setHeaders?.(res, path, stat);
11
+ }
12
+ });
13
+ }
@@ -1,2 +1,2 @@
1
- export type { Request } from 'express';
1
+ export type { Request } from '../ReqRes.js';
2
2
  //# sourceMappingURL=Request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../src/api/Request.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../src/api/Request.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
@@ -1,2 +1,2 @@
1
- export type { Response } from 'express';
1
+ export type { Response } from '../ReqRes.js';
2
2
  //# sourceMappingURL=Response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../src/api/Response.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../src/api/Response.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Request } from 'express';
1
+ import type { Request } from '../ReqRes.js';
2
2
  export declare function getFetchCompatibleHeaders(req: Request): Headers;
3
3
  //# sourceMappingURL=getFetchCompatibleHeaders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFetchCompatibleHeaders.d.ts","sourceRoot":"","sources":["../../src/helpers/getFetchCompatibleHeaders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAKtC,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAY/D"}
1
+ {"version":3,"file":"getFetchCompatibleHeaders.d.ts","sourceRoot":"","sources":["../../src/helpers/getFetchCompatibleHeaders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAY/D"}
@@ -8,7 +8,9 @@ import '../hmr/applyHmrModule.js';
8
8
  export type HydrateMeta = {
9
9
  insideForm: boolean;
10
10
  mismatches: TaggedAttributeMismatch[];
11
+ selectValue: unknown;
11
12
  };
13
+ export declare function makeDefaultHydrateMeta(): HydrateMeta;
12
14
  export declare function hydrate(appRoutes: AppRoutes, RootComponent: TungstenBaseComponentType | null, instanceConfig: InstanceConfig): Promise<void>;
13
15
  export declare function hydrateRootComponent<ComponentType extends TungstenBaseComponentType<any, any>>(instance: Instance, RootComponent: ComponentType, domPointer: DomPointer, meta: HydrateMeta, props?: InstanceType<ComponentType>['props'], // eslint-disable-line no-type-assertion/no-type-assertion -- default only reached when Props is empty, same as the hardcoded {} this replaces
14
16
  routeParams?: Record<string, string>, routeData?: unknown): Promise<InstanceType<ComponentType>>;
@@ -1 +1 @@
1
- {"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../src/hydrate/hydrate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAoBxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAM7C,OAAO,EAAE,yBAAyB,EAAoD,MAAM,mBAAmB,CAAA;AAE/G,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAmBlD,OAAO,EAC4B,KAAK,uBAAuB,EAC9D,MAAM,oCAAoC,CAAA;AAQ3C,OAAO,0BAA0B,CAAA;AASjC,MAAM,MAAM,WAAW,GAAG;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,uBAAuB,EAAE,CAAA;CACxC,CAAA;AAKD,wBAAsB,OAAO,CACzB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,yBAAyB,GAAG,IAAI,EAC/C,cAAc,EAAE,cAAc,iBA2DjC;AAyBD,wBAAsB,oBAAoB,CACtC,aAAa,SAAS,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,EAEzD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,WAAW,EAIjB,KAAK,GAAE,YAAY,CAAC,aAAa,CAAC,CAAC,OAAO,CAA8C,EAAE,8IAA8I;AACxO,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CA6DtC"}
1
+ {"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../src/hydrate/hydrate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAoBxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAM7C,OAAO,EAAE,yBAAyB,EAAoD,MAAM,mBAAmB,CAAA;AAE/G,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAoBlD,OAAO,EAC4B,KAAK,uBAAuB,EAC9D,MAAM,oCAAoC,CAAA;AAQ3C,OAAO,0BAA0B,CAAA;AASjC,MAAM,MAAM,WAAW,GAAG;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,uBAAuB,EAAE,CAAA;IAGrC,WAAW,EAAE,OAAO,CAAA;CACvB,CAAA;AACD,wBAAgB,sBAAsB,IAAI,WAAW,CAEpD;AAID,wBAAsB,OAAO,CACzB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,yBAAyB,GAAG,IAAI,EAC/C,cAAc,EAAE,cAAc,iBA2DjC;AAyBD,wBAAsB,oBAAoB,CACtC,aAAa,SAAS,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,EAEzD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,WAAW,EAIjB,KAAK,GAAE,YAAY,CAAC,aAAa,CAAC,CAAC,OAAO,CAA8C,EAAE,8IAA8I;AACxO,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CA6DtC"}
@@ -29,6 +29,7 @@ import { MatchedRoute } from "../routing/MatchedRoute.js";
29
29
  import { isDev } from "../isDev.js";
30
30
  import { warn } from "../appOutput.js";
31
31
  import { reconcileHydratedAttributes } from "./reconcileHydratedAttributes.js";
32
+ import { markOptionSelected } from "../markOptionSelected.js";
32
33
  import { renderHydrationMismatchBanner } from "./renderHydrationMismatchBanner.js";
33
34
  import { setCurrentInstance } from "../hmr/instanceRegistry.js";
34
35
  // side-effect only: pulls applyHmrModule.js (and its clean, non-dynamic-import dependencies)
@@ -43,12 +44,13 @@ function debug(...texts) {
43
44
  //console.log(...texts)
44
45
  //console.log(getStackTrace().split('\n')[2])
45
46
  }
46
- function makeDefaultHydrateMeta() {
47
+ export function makeDefaultHydrateMeta() {
47
48
  return {
48
49
  insideForm: false,
49
- mismatches: []
50
+ mismatches: [],
51
+ selectValue: undefined
50
52
  };
51
- } // can we opto this out in production?
53
+ }
52
54
  export async function hydrate(appRoutes, RootComponent, instanceConfig) {
53
55
  debug('hydrate start');
54
56
  //console.log('hydration global data ', __tungsten_global_data__)
@@ -502,31 +504,6 @@ async function hydrateNodeSingle(node, parentElement, domPointer, instance, meta
502
504
  debug('hydarating atts');
503
505
  hydrateAttributes(node, domNode, meta);
504
506
  //!!! node.domElement = domNode
505
- const props = node[$props];
506
- if (node[$type] === 'textarea') {
507
- if ('value' in props) {
508
- if (props.children !== undefined && !(Array.isArray(node[$props].children) && node[$props].children.length === 0)) {
509
- if (isDev) {
510
- warn('textarea element has both value attribute and children, children will be ignored.');
511
- }
512
- }
513
- //if (props.value !== undefined)
514
- props.children = props.value;
515
- delete props.value;
516
- }
517
- }
518
- /// !!! TODO
519
- // This code relies on the select node being the immediate parent.
520
- // This may not be the case (there could be a wrapping component), and could be improved
521
- // if (node[$type] === 'option') {
522
- // if (ContentNodeIsHtml(parentNode) && parentNode[$type] === 'select') {
523
- // if (parentNode[$props].value !== undefined) {
524
- // if (props.value === parentNode[$props].value) {
525
- // props.selected = 'selected'
526
- // }
527
- // }
528
- // }
529
- // }
530
507
  // look up any refs
531
508
  //const props = node[$props]
532
509
  //const ref = node[$props].ref
@@ -535,6 +512,9 @@ async function hydrateNodeSingle(node, parentElement, domPointer, instance, meta
535
512
  }
536
513
  debug('valid children', validChildren(node[$props].children), node[$props].children);
537
514
  const children = node[$props].children;
515
+ // the value is only known once hydrateAttributes() has resolved any bind above
516
+ const outerSelectValue = meta.selectValue;
517
+ if (node[$type] === 'select') meta.selectValue = node[$props].value;
538
518
  let renderedChildren = $contentNull;
539
519
  if (node[$type] === 'body' && instance.config.csr) {
540
520
  // CSR: body shipped empty on purpose, nothing to hydrate against - create fresh.
@@ -556,6 +536,7 @@ async function hydrateNodeSingle(node, parentElement, domPointer, instance, meta
556
536
  const childDomPointer = new DomPointer(domNode);
557
537
  renderedChildren = await hydrateNode(children, parentElement, childDomPointer, instance, meta);
558
538
  }
539
+ meta.selectValue = outerSelectValue;
559
540
  if (node[$type] === 'select' && node[$props].value !== undefined && node[$props].value !== null) {
560
541
  domNode.value = String(node[$props].value);
561
542
  }
@@ -599,6 +580,22 @@ async function hydrateNodeComponent(node, parentElement, domPointer, instance, m
599
580
  function hydrateAttributes(node, domNode, meta) {
600
581
  // handle bind attributes and merge together event handlers
601
582
  processAttributes(node);
583
+ // The two prop rewrites the server does before it writes any markup (processRenderingNodeHtml).
584
+ // They have to happen here, after bind has supplied a value and before the reconcile below,
585
+ // or what the client renders differs from the served markup and reads as a mismatch.
586
+ if (ContentNodeElementIsHtml(node)) {
587
+ const props = node[$props];
588
+ if (node[$type] === 'textarea' && 'value' in props) {
589
+ if (props.children !== undefined && !(Array.isArray(props.children) && props.children.length === 0)) {
590
+ if (isDev) {
591
+ warn('textarea element has both value attribute and children, children will be ignored.');
592
+ }
593
+ }
594
+ props.children = props.value;
595
+ delete props.value;
596
+ }
597
+ if (node[$type] === 'option') markOptionSelected(props, meta.selectValue);
598
+ }
602
599
  // Bring the server's attributes into line with what this render produced.
603
600
  // Runs in production as well as development: leaving a known-wrong value in
604
601
  // place is not better in production, it is only quieter. Only genuine
@@ -0,0 +1,15 @@
1
+ type OptionProps = {
2
+ children?: unknown;
3
+ value?: unknown;
4
+ selected?: unknown;
5
+ };
6
+ /**
7
+ * Marks an <option> as the one its enclosing <select> has chosen, given that select's value.
8
+ *
9
+ * Every renderer needs this, not just the server: markup is the only way the server can express
10
+ * a selection, so the client's content tree has to carry the same prop or hydration reconciles
11
+ * the server's `selected` attribute away as an attribute the client never rendered.
12
+ */
13
+ export declare function markOptionSelected(props: OptionProps, selectValue: unknown): void;
14
+ export {};
15
+ //# sourceMappingURL=markOptionSelected.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markOptionSelected.d.ts","sourceRoot":"","sources":["../src/markOptionSelected.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AA6B9E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CAQjF"}
@@ -0,0 +1,31 @@
1
+ import { $props, $type } from "./contentNodeSymbols.js";
2
+ // An option with no value attribute is identified by its label text, so gather it the way the
3
+ // browser does: script content and raw HTML are not label text, anything else contributes.
4
+ function collectOptionText(node) {
5
+ if (node === undefined || node === null || typeof node === 'boolean') return '';
6
+ if (Array.isArray(node)) {
7
+ let text = '';
8
+ for (const child of node) text += collectOptionText(child);
9
+ return text;
10
+ }
11
+ if (typeof node === 'string' || typeof node === 'number') return String(node);
12
+ if (typeof node !== 'object') return '';
13
+ const element = node; // eslint-disable-line no-type-assertion/no-type-assertion -- content and rendering nodes are both { [$type], [$props] }
14
+ if (element[$type] === 'script' || typeof element[$props]?.__html === 'string') return '';
15
+ return collectOptionText(element[$props]?.children);
16
+ }
17
+ function normalizeOptionText(text) {
18
+ return text.replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g, '').replace(/[\t\n\f\r ]+/g, ' ');
19
+ }
20
+ /**
21
+ * Marks an <option> as the one its enclosing <select> has chosen, given that select's value.
22
+ *
23
+ * Every renderer needs this, not just the server: markup is the only way the server can express
24
+ * a selection, so the client's content tree has to carry the same prop or hydration reconciles
25
+ * the server's `selected` attribute away as an attribute the client never rendered.
26
+ */
27
+ export function markOptionSelected(props, selectValue) {
28
+ if (selectValue === undefined || selectValue === null) return;
29
+ const optionValue = props.value !== undefined && props.value !== null ? String(props.value) : normalizeOptionText(collectOptionText(props.children));
30
+ if (optionValue === String(selectValue)) props.selected = 'selected';
31
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"TransformCssNames.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/TransformCssNames.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAoE9C,KAAK,IAAI,GAAG;IACR,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;CACrB,CAAA;AAaD,eAAO,MAAM,iBAAiB;WAAU,IAAI;;mBAezB,IAAI;;;CAqJtB,CAAA"}
1
+ {"version":3,"file":"TransformCssNames.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/TransformCssNames.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAqE9C,KAAK,IAAI,GAAG;IACR,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;CACrB,CAAA;AAaD,eAAO,MAAM,iBAAiB;WAAU,IAAI;;mBAezB,IAAI;;;CA4KtB,CAAA"}
@@ -11,6 +11,7 @@ extract classes -> localise
11
11
  */
12
12
  import { parseSelectorsRich } from "./parseSelectorsRich.js";
13
13
  import { scopeAnimationValue } from "./scopeAnimationValue.js";
14
+ import { unwrapIgnoreMarker } from "./unwrapIgnoreMarker.js";
14
15
  import { componentBumpClass } from "../componentClassName.js";
15
16
  import { throwError, warnMessage } from "../throwError.js";
16
17
  import { warn } from "../output.js";
@@ -86,10 +87,18 @@ export const TransformCssNames = opts => {
86
87
  // keyframe offsets (0%, from, to) are Rules within the at-rule, but they are positions
87
88
  // rather than selectors, so they are collected here and passed over by the selector walk
88
89
  const keyframeOffsets = new Set();
90
+ // a custom property registration applies to the whole document, so it cannot be scoped
91
+ // to a module at all - it belongs in a global stylesheet, which skips this plugin
92
+ root.walkAtRules('property', atRule => {
93
+ throwError('TransformCssNames', `@property ${atRule.params.trim()} in module '${moduleName}' registers a custom` + ` property for the whole document, so it cannot come from a component` + ` stylesheet. Move it to a global stylesheet` + (sourceFile === undefined ? '' : ` (${sourceFile})`));
94
+ });
89
95
  // the animation name is scoped like a class, so two modules can each define `fade`
90
96
  root.walkAtRules(keyframesAtRule, atRule => {
91
97
  const name = atRule.params.trim();
92
98
  if (name === '') return;
99
+ // the marker only says where a name is used, it cannot define one - keyframes a
100
+ // module defines are always its own
101
+ if (unwrapIgnoreMarker(name) !== undefined) throwError('TransformCssNames', `@${atRule.name} ${name} in module '${moduleName}' is marked to be left global,` + ` but keyframes a module defines are always scoped to it. Drop the marker, or` + ` define the animation in a global stylesheet and reference it from here` + (sourceFile === undefined ? '' : ` (${sourceFile})`));
93
102
  const newName = transformClass(escapeModuleName(moduleName), name);
94
103
  names.keyframes[name] = newName;
95
104
  atRule.params = newName;
@@ -1 +1 @@
1
- {"version":3,"file":"scopeAnimationValue.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/scopeAnimationValue.ts"],"names":[],"mappings":"AA+BA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAkB9F"}
1
+ {"version":3,"file":"scopeAnimationValue.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/scopeAnimationValue.ts"],"names":[],"mappings":"AA4BA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAkB9F"}
@@ -1,4 +1,5 @@
1
1
  import { splitCssValue } from "./splitCssValue.js";
2
+ import { unwrapIgnoreMarker } from "./unwrapIgnoreMarker.js";
2
3
  // every keyword the animation shorthand accepts. A word that is none of these, and does not
3
4
  // read as a time, a number or a function, is the animation name
4
5
  const animationKeywords = new Set(['none', 'forwards', 'backwards', 'both',
@@ -20,9 +21,6 @@ function isAnimationName(word) {
20
21
  if (animationKeywords.has(word.toLowerCase())) return false;
21
22
  return identifierStart.test(word);
22
23
  }
23
- // The value side of the `:i()` selector marker, naming an animation to leave global. A colon
24
- // cannot open a declaration value in css, sass or scss, so the marker drops it here
25
- const ignoreMarker = /^(?:i|ignore)\((.*)\)$/i;
26
24
  // Scopes the animation names in an `animation` or `animation-name` value, e.g.
27
25
  // `fade 2s linear, slide 1s` -> `Card_fade 2s linear, Card_slide 1s`.
28
26
  // A value may list several animations, separated by commas, but names only one per list entry.
@@ -33,10 +31,10 @@ export function scopeAnimationValue(value, scopeName) {
33
31
  named = false;
34
32
  return part;
35
33
  }
36
- const ignored = ignoreMarker.exec(part);
37
- if (ignored !== null) {
34
+ const ignored = unwrapIgnoreMarker(part);
35
+ if (ignored !== undefined) {
38
36
  named = true;
39
- return (ignored[1] ?? '').trim();
37
+ return ignored;
40
38
  }
41
39
  if (named || !isAnimationName(part)) return part;
42
40
  named = true;
@@ -0,0 +1,2 @@
1
+ export declare function unwrapIgnoreMarker(word: string): string | undefined;
2
+ //# sourceMappingURL=unwrapIgnoreMarker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unwrapIgnoreMarker.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/unwrapIgnoreMarker.ts"],"names":[],"mappings":"AAMA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAInE"}
@@ -0,0 +1,9 @@
1
+ // The value side of the `:i()` selector marker, naming something to leave global. A colon cannot
2
+ // open a declaration value in css, sass or scss alike, so the marker drops it here
3
+ const ignoreMarker = /^(?:i|ignore)\((.*)\)$/i;
4
+ // returns the marked name, or undefined when the word carries no marker
5
+ export function unwrapIgnoreMarker(word) {
6
+ const marked = ignoreMarker.exec(word);
7
+ if (marked === null) return undefined;
8
+ return (marked[1] ?? '').trim();
9
+ }
@@ -17,6 +17,7 @@ export async function componentNodeToRenderingTree(componentNode, parentComponen
17
17
  } else {
18
18
  location = render.location;
19
19
  if (typeof render === 'object' && 'placeholder') {
20
+ // not sure what this is
20
21
  placeholder = render.placeholder;
21
22
  }
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"processRenderingNodeHtml.d.ts","sourceRoot":"","sources":["../../src/render/processRenderingNodeHtml.ts"],"names":[],"mappings":"AAEA,OAAO,EACiB,KAAK,iBAAiB,EAE7C,MAAM,qBAAqB,CAAA;AAqC5B,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,QAwDhE"}
1
+ {"version":3,"file":"processRenderingNodeHtml.d.ts","sourceRoot":"","sources":["../../src/render/processRenderingNodeHtml.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAQ5D,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,QA+ChE"}
@@ -1,29 +1,9 @@
1
- import { RenderingNodeElementIsComponent, RenderingNodeElementIsHtml } from "../RenderingNode.js";
2
1
  import { bindableHtmlElements } from "../components/bindable/bindableHtmlElements.js";
3
2
  import { cliWarn } from "../cliOutput.js";
4
3
  import { debug } from "./debug.js";
5
4
  import { $props, $type } from "../contentNodeSymbols.js";
6
5
  import { checkedValueToBoolean } from "../checkedValueToBoolean.js";
7
- function collectOptionText(node) {
8
- if (node === undefined || node === null || node === false || node === true) return '';
9
- if (Array.isArray(node)) {
10
- let text = '';
11
- for (const child of node) text += collectOptionText(child);
12
- return text;
13
- }
14
- if (typeof node === 'string' || typeof node === 'number') return String(node);
15
- if (RenderingNodeElementIsHtml(node)) {
16
- if (node[$type] === 'script' || typeof node[$props].__html === 'string') return '';
17
- return collectOptionText(node[$props].children);
18
- }
19
- if (RenderingNodeElementIsComponent(node)) {
20
- return collectOptionText(node[$props].children);
21
- }
22
- return '';
23
- }
24
- function normalizeOptionText(text) {
25
- return text.replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g, '').replace(/[\t\n\f\r ]+/g, ' ');
26
- }
6
+ import { markOptionSelected } from "../markOptionSelected.js";
27
7
  export function processRenderingNodeHtml(node, lastSelect) {
28
8
  const props = node[$props];
29
9
  debug('processRenderingNodeHtml', node);
@@ -57,15 +37,8 @@ export function processRenderingNodeHtml(node, lastSelect) {
57
37
  delete props.value;
58
38
  }
59
39
  }
60
- if (node[$type] === 'option') {
61
- if (lastSelect !== null) {
62
- if (lastSelect[$props].value !== undefined && lastSelect[$props].value !== null) {
63
- const optionValue = props.value !== undefined && props.value !== null ? String(props.value) : normalizeOptionText(collectOptionText(props.children));
64
- if (optionValue === String(lastSelect[$props].value)) {
65
- props.selected = 'selected';
66
- }
67
- }
68
- }
40
+ if (node[$type] === 'option' && lastSelect !== null) {
41
+ markOptionSelected(props, lastSelect[$props].value);
69
42
  }
70
43
  debug('post processRenderingNodeHtml', node);
71
44
  }
@@ -8,7 +8,7 @@ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a),
8
8
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
9
9
  import { $props, $type } from "../contentNodeSymbols.js";
10
10
  import { Instance } from "../Instance/Instance.js";
11
- import { hydrateRootComponent } from "../hydrate/hydrate.js";
11
+ import { hydrateRootComponent, makeDefaultHydrateMeta } from "../hydrate/hydrate.js";
12
12
  import { contentTreeToRenderingTree } from "../render/contentTreeToRenderingTree.js";
13
13
  import { renderingNodeToHtml } from "../render/renderingTreeToHtml.js";
14
14
  import { initStores } from "../Servers/initStores.js";
@@ -221,10 +221,7 @@ export async function hydrateTestApp(RootComponent, ...args) {
221
221
  const store = override.registration.getStore(instance.stores);
222
222
  await override.initialize(store);
223
223
  }
224
- const meta = {
225
- insideForm: false,
226
- mismatches: []
227
- };
224
+ const meta = makeDefaultHydrateMeta();
228
225
  const domPointer = new DomPointer(container, 0);
229
226
  const component = await hydrateRootComponent(instance, RootComponent, domPointer, meta, clientProps, options?.routeParams, options?.routeData);
230
227
  return new HydrateTestAppImplementation(document, container, component, instance, scheduler, ownsContainer, html, meta.mismatches);
@@ -1 +1 @@
1
- {"version":3,"file":"integrateUpdateVdom.d.ts","sourceRoot":"","sources":["../../src/update/integrateUpdateVdom.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EACH,WAAW,EAAwC,eAAe,EAElE,uBAAuB,EAG1B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,OAAO,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAA;AAE1D,OAAO,EACe,mBAAmB,EAIT,4BAA4B,EAI3D,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAYhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAwEhE,MAAM,MAAM,mBAAmB,GA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AC9B,IAAI,EAAE,mBAAmB,CAAC,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAC/D,IAAI,CAON;AA8QD,wBAAsB,wBAAwB,CAC1C,UAAU,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,GAC5E,OAAO,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAiC3C;AAED,wBAAsB,qBAAqB,CACvC,UAAU,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,GAC1F,OAAO,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAyCjD"}
@@ -17,6 +17,7 @@ import { $key, $props, $routeData, $routeParams, $type } from "../contentNodeSym
17
17
  import { printComponentNamesInSource } from "../render/printComponentNameInSource.js";
18
18
  import { bindableHtmlElementsNumber, bindableHtmlElementsString } from "../components/bindable/bindableHtmlElements.js";
19
19
  import { checkedValueToBoolean } from "../checkedValueToBoolean.js";
20
+ import { markOptionSelected } from "../markOptionSelected.js";
20
21
  import { innerHtmlFromProps } from "../innerHtmlFromProps.js";
21
22
  import { validChildren } from "../validChildren.js";
22
23
  import { setCurrentComponent } from 'tungsten/hooks/setCurrentComponent.js';
@@ -798,17 +799,13 @@ export function processHtmlNode(node, parentNode) {
798
799
  delete props.value;
799
800
  }
800
801
  }
801
- // This code relies on the select node being the immediate parent.
802
- // This may not be the case (there could be a wrapping component), and could be improved
803
- // if (node[$type] === 'option') {
804
- // if (ContentNodeIsHtml(parentNode) && parentNode[$type] === 'select') {
805
- // if (parentNode[$props].value !== undefined) {
806
- // if (props.value === parentNode[$props].value) {
807
- // props.selected = 'selected'
808
- // }
809
- // }
810
- // }
811
- // }
802
+ // Marked here as well as on the server so a client render of a select produces the same
803
+ // markup a served one does.
804
+ // !!! TODO: this relies on the select being the immediate parent, which it need not be
805
+ // (a component can render the options). Hydration carries the value on its meta instead.
806
+ if (node[$type] === 'option' && ContentNodeIsHtml(parentNode) && parentNode[$type] === 'select') {
807
+ markOptionSelected(props, parentNode[$props].value);
808
+ }
812
809
  //console.log('processed:', node)
813
810
  debug('post processHtmlNode', node);
814
811
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tungsten",
3
- "version": "0.3.13",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,7 @@
9
9
  "main": "dist/index.js",
10
10
  "exports": {
11
11
  ".": "./dist/index.js",
12
+ "./ssr": "./dist/ssr.js",
12
13
  "./compat": "./dist/compat/index.js",
13
14
  "./library": "./dist/components/library/index.js",
14
15
  "./react-zone": "./dist/zones/react.js",
@@ -54,7 +55,7 @@
54
55
  "decamelize": "^6.0.1",
55
56
  "dotenv": "^16.6.1",
56
57
  "esm-reload": "^1.0.1",
57
- "express": "^4.22.1",
58
+ "express": "^5.2.1",
58
59
  "find-package-json": "^1.2.0",
59
60
  "fs-extra": "^10.1.0",
60
61
  "globby": "^13.2.2",
@@ -90,7 +91,7 @@
90
91
  "@types/babel__generator": "^7.27.0",
91
92
  "@types/chai": "^4.3.20",
92
93
  "@types/cookie-parser": "^1.4.10",
93
- "@types/express": "^4.17.25",
94
+ "@types/express": "^5.0.6",
94
95
  "@types/find-package-json": "^1.2.7",
95
96
  "@types/fs-extra": "^11.0.4",
96
97
  "@types/ini": "^1.3.34",