@stencil/core 5.0.0-beta.9 → 5.0.0-rc.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 (40) hide show
  1. package/dist/app-data/index.d.ts +1 -1
  2. package/dist/app-data/index.js +1 -0
  3. package/dist/{client-BRu0GtRn.mjs → client-ClM4H9-P.mjs} +204 -76
  4. package/dist/compiler/browser.d.ts +120 -81
  5. package/dist/compiler/browser.js +964 -402
  6. package/dist/compiler/index.d.mts +110 -2
  7. package/dist/compiler/index.mjs +3 -3
  8. package/dist/compiler/utils/index.d.mts +2 -2
  9. package/dist/compiler/utils/index.mjs +3 -3
  10. package/dist/{compiler-wLrjuSOK.mjs → compiler-DFanjq9z.mjs} +5300 -3005
  11. package/dist/declarations/stencil-public-compiler.d.ts +178 -133
  12. package/dist/declarations/stencil-public-docs.d.ts +23 -0
  13. package/dist/declarations/stencil-public-runtime.d.ts +81 -59
  14. package/dist/{index-BvF31nqP.d.mts → index-DvfFOkiJ.d.mts} +220 -133
  15. package/dist/{index-BXAcVN2j.d.ts → index-XQHZl0MW.d.ts} +70 -57
  16. package/dist/{index-BAP9T4CB.d.mts → index-aBMJC5F9.d.mts} +6 -2
  17. package/dist/index.d.mts +3 -0
  18. package/dist/index.mjs +1 -1
  19. package/dist/jsx-runtime.d.mts +6 -0
  20. package/dist/jsx-runtime.mjs +1 -1
  21. package/dist/{node-75gQKkFz.mjs → node-DJP8JuAS.mjs} +42 -48
  22. package/dist/runtime/client/lazy.js +522 -262
  23. package/dist/runtime/client/runtime.d.ts +100 -68
  24. package/dist/runtime/client/runtime.js +522 -262
  25. package/dist/runtime/index.d.ts +6 -6
  26. package/dist/runtime/index.js +521 -261
  27. package/dist/runtime/server/index.d.mts +36 -12
  28. package/dist/runtime/server/index.mjs +635 -304
  29. package/dist/runtime/server/runner.d.mts +49 -6
  30. package/dist/runtime/server/runner.mjs +385 -87
  31. package/dist/signals/index.d.ts +11 -2
  32. package/dist/signals/index.js +15 -35
  33. package/dist/sys/node/index.d.mts +1 -1
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.mjs +2 -2
  36. package/dist/testing/index.d.mts +152 -124
  37. package/dist/testing/index.mjs +535 -269
  38. package/dist/{util-IKfWWLJo.mjs → util-C-H1H84W.mjs} +8 -1
  39. package/dist/{validation-DAdGTrys.mjs → validation-ByYYKvnS.mjs} +37 -3
  40. package/package.json +8 -4
@@ -59,6 +59,16 @@ interface SsrDocumentOptions {
59
59
  * Sets `document.referrer`
60
60
  */
61
61
  referrer?: string;
62
+ /**
63
+ * Render into one long-lived mock window, reset between renders, instead of creating a new one
64
+ * for every call. Skips evaluating the whole SSR platform (runtime and every component)
65
+ * on each render: most of the cost of rendering a small fragment, and a good part of a whole page.
66
+ *
67
+ * Applies to HTML string input (not a `Document`). One window per distinct `serializeShadowRoot` value,
68
+ * and renders sharing a window run one at a time.
69
+ * Defaults to `false`, except in the `ssr-wasm` output target, where it defaults to `true`.
70
+ */
71
+ reuseWindow?: boolean;
62
72
  /**
63
73
  * Removes every `<script>` element found in the `document`. Defaults to `false`.
64
74
  */
@@ -139,7 +149,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
139
149
  * Note that this is "approximate", in that HTML may often not be able
140
150
  * to be split at an exact line width. Additionally, new lines created
141
151
  * is where HTML naturally already has whitespace, such as before an
142
- * attribute or spaces between words. Defaults to `100`.
152
+ * attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
143
153
  */
144
154
  approximateLineWidth?: number;
145
155
  /**
@@ -157,12 +167,12 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
157
167
  prettyHtml?: boolean;
158
168
  /**
159
169
  * Remove quotes from attribute values when possible.
160
- * Defaults to `true`.
170
+ * Defaults to `false` (`true` when prerendering).
161
171
  */
162
172
  removeAttributeQuotes?: boolean;
163
173
  /**
164
174
  * Remove the `=""` from standardized `boolean` attributes,
165
- * such as `hidden` or `checked`. Defaults to `true`.
175
+ * such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
166
176
  */
167
177
  removeBooleanAttributeQuotes?: boolean;
168
178
  /**
@@ -171,7 +181,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
171
181
  */
172
182
  removeEmptyAttributes?: boolean;
173
183
  /**
174
- * Remove HTML comments. Defaults to `true`.
184
+ * Remove HTML comments. Defaults to `false` (`true` when prerendering).
175
185
  */
176
186
  removeHtmlComments?: boolean;
177
187
  /**
@@ -190,6 +200,12 @@ interface SsrFactoryOptions extends SerializeDocumentOptions {
190
200
  serializeToHtml: boolean;
191
201
  destroyWindow: boolean;
192
202
  destroyDocument: boolean;
203
+ /**
204
+ * A canonical key for `serializeShadowRoot`, set by the renderer. Renders with the same key
205
+ * render every component the same way, so they can share an SSR platform.
206
+ * @internal
207
+ */
208
+ serializeShadowRootKey?: string;
193
209
  }
194
210
  interface Diagnostic {
195
211
  absFilePath?: string | undefined;
@@ -300,9 +316,22 @@ declare function ssrDocument(doc: any | string, options?: SsrDocumentOptions): P
300
316
  declare const hydrateDocument: typeof ssrDocument;
301
317
  declare function serializeDocumentToString(doc: Document, opts: SsrFactoryOptions): string;
302
318
  //#endregion
319
+ //#region src/server/runner/reusable-window.d.ts
320
+ /**
321
+ * Drop every reusable window and render queue. For hosts where a render can be abandoned without
322
+ * ever settling (the `ssr-wasm` plugin, when a call ends with a render still waiting), so the
323
+ * next render doesn't queue behind it forever.
324
+ */
325
+ declare function resetReusableWindows(): void;
326
+ //#endregion
303
327
  //#region src/server/runner/window-initialize.d.ts
304
328
  /**
305
- * Reset the docData counters. Useful for testing to ensure deterministic IDs.
329
+ * Restart the hydration ids used by fragment renders (`fullDocument: false`).
330
+ *
331
+ * Optional - ids only need to be unique within a page, and they are without it. Call it once at
332
+ * the start of each request that renders fragments, to get the same output for the same input.
333
+ * Never call it between fragments that end up in the same page, or their ids will collide.
334
+ * Full-document renders always start from 1 and aren't affected.
306
335
  */
307
336
  declare function resetSsrDocData(): void;
308
337
  //#endregion
@@ -319,4 +348,18 @@ declare function transformTag<T extends string>(tag: T): T;
319
348
  */
320
349
  declare function setTagTransformer(transformer: TagTransformer): void;
321
350
  //#endregion
322
- export { createWindowFromHtml, hydrateDocument, renderToString, resetSsrDocData, serializeDocumentToString, setTagTransformer, ssrDocument, streamToString, transformTag };
351
+ //#region src/server/runner/index.d.ts
352
+ /**
353
+ * Render components under transformed tag names, to match tag transformation on the client.
354
+ *
355
+ * Components are registered under their transformed names when a window's SSR platform is set up,
356
+ * so this also discards the reusable windows (see the `reuseWindow` option): later renders set up
357
+ * new ones that use the new transformer.
358
+ *
359
+ * (A function declaration with its own name, so the runtime's `setTagTransformer` keeps its name in
360
+ * the bundle - the SSR build looks for it - and this is hoisted.)
361
+ * @param transformer the tag transformer
362
+ */
363
+ declare function setTagTransformerForSsr(transformer: Parameters<typeof setTagTransformer>[0]): void;
364
+ //#endregion
365
+ export { createWindowFromHtml, hydrateDocument, renderToString, resetReusableWindows, resetSsrDocData, serializeDocumentToString, setTagTransformerForSsr as setTagTransformer, ssrDocument, streamToString, transformTag };