@stencil/core 4.18.3 → 4.19.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 (47) hide show
  1. package/cli/index.cjs +43 -16
  2. package/cli/index.js +43 -16
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +175 -72
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +3 -3
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/dev-server/ws.js +1 -1
  13. package/internal/app-data/package.json +1 -1
  14. package/internal/client/index.js +534 -507
  15. package/internal/client/package.json +3 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +108 -50
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.d.ts +29 -11
  20. package/internal/hydrate/runner.js +239 -260
  21. package/internal/package.json +1 -1
  22. package/internal/stencil-private.d.ts +39 -14
  23. package/internal/stencil-public-compiler.d.ts +21 -0
  24. package/internal/stencil-public-runtime.d.ts +0 -2
  25. package/internal/testing/index.js +439 -407
  26. package/internal/testing/package.json +1 -1
  27. package/mock-doc/index.cjs +137 -131
  28. package/mock-doc/index.d.ts +18 -4
  29. package/mock-doc/index.js +137 -131
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +34 -6
  32. package/screenshot/index.js +1 -1
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +10 -10
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +95 -16
  39. package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
  40. package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
  41. package/testing/jest/jest-28/matchers/events.d.ts +4 -0
  42. package/testing/jest/jest-28/matchers/index.d.ts +2 -1
  43. package/testing/jest/jest-29/matchers/events.d.ts +4 -0
  44. package/testing/jest/jest-29/matchers/index.d.ts +2 -1
  45. package/testing/mocks.d.ts +9 -9
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.18.3",
3
+ "version": "4.19.0",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -983,23 +983,23 @@ export interface HydrateResults {
983
983
  buildId: string;
984
984
  diagnostics: Diagnostic[];
985
985
  url: string;
986
- host: string;
987
- hostname: string;
988
- href: string;
989
- port: string;
990
- pathname: string;
991
- search: string;
992
- hash: string;
993
- html: string;
986
+ host: string | null;
987
+ hostname: string | null;
988
+ href: string | null;
989
+ port: string | null;
990
+ pathname: string | null;
991
+ search: string | null;
992
+ hash: string | null;
993
+ html: string | null;
994
994
  components: HydrateComponent[];
995
995
  anchors: HydrateAnchorElement[];
996
996
  imgs: HydrateImgElement[];
997
997
  scripts: HydrateScriptElement[];
998
998
  styles: HydrateStyleElement[];
999
999
  staticData: HydrateStaticData[];
1000
- title: string;
1000
+ title: string | null;
1001
1001
  hydratedCount: number;
1002
- httpStatus: number;
1002
+ httpStatus: number | null;
1003
1003
  }
1004
1004
  export interface HydrateComponent {
1005
1005
  tag: string;
@@ -1276,7 +1276,7 @@ export interface ComponentRuntimeMeta {
1276
1276
  /**
1277
1277
  * This number is used to hold a series of bitflags for various features we
1278
1278
  * support on components. The flags which this value is intended to store are
1279
- * documented in the {@link CMP_FLAGS} enum.
1279
+ * documented in the `CMP_FLAGS` enum.
1280
1280
  */
1281
1281
  $flags$: number;
1282
1282
  /**
@@ -1320,7 +1320,7 @@ export interface ComponentRuntimeMembers {
1320
1320
  * The fields are:
1321
1321
  *
1322
1322
  * 1. A number used to hold bitflags for component members. The bit flags which
1323
- * this is intended to store are documented in the {@link MEMBER_FLAGS} enum.
1323
+ * this is intended to store are documented in the `MEMBER_FLAGS` enum.
1324
1324
  * 2. The attribute name to observe.
1325
1325
  */
1326
1326
  export type ComponentRuntimeMember = [number, string?];
@@ -1329,7 +1329,7 @@ export type ComponentRuntimeMember = [number, string?];
1329
1329
  * runtime. The field are:
1330
1330
  *
1331
1331
  * 1. A number used to hold bitflags for listeners. The bit flags which this is
1332
- * intended to store are documented in the {@link LISTENER_FLAGS} enum.
1332
+ * intended to store are documented in the `LISTENER_FLAGS` enum.
1333
1333
  * 2. The event name.
1334
1334
  * 3. The method name.
1335
1335
  */
@@ -1610,6 +1610,12 @@ export interface ScreenshotOptions {
1610
1610
  * more sensitive. Defaults to the testing config `pixelmatchThreshold` value;
1611
1611
  */
1612
1612
  pixelmatchThreshold?: number;
1613
+ /**
1614
+ * Capture the screenshot beyond the viewport.
1615
+ *
1616
+ * @defaultValue `false` if there is no `clip`. `true` otherwise.
1617
+ */
1618
+ captureBeyondViewport?: boolean;
1613
1619
  }
1614
1620
  export interface ScreenshotBoundingBox {
1615
1621
  /**
@@ -1707,6 +1713,11 @@ export interface PackageJsonData {
1707
1713
  name?: string;
1708
1714
  version?: string;
1709
1715
  main?: string;
1716
+ exports?: {
1717
+ [key: string]: string | {
1718
+ [key: string]: string;
1719
+ };
1720
+ };
1710
1721
  description?: string;
1711
1722
  bin?: {
1712
1723
  [key: string]: string;
@@ -1823,6 +1834,11 @@ declare global {
1823
1834
  * received the correct custom event `detail` data.
1824
1835
  */
1825
1836
  toHaveFirstReceivedEventDetail(eventDetail: any): void;
1837
+ /**
1838
+ * When given an EventSpy, checks the last event has
1839
+ * received the correct custom event `detail` data.
1840
+ */
1841
+ toHaveLastReceivedEventDetail(eventDetail: any): void;
1826
1842
  /**
1827
1843
  * When given an EventSpy, checks the event at an index
1828
1844
  * has received the correct custom event `detail` data.
@@ -2076,6 +2092,15 @@ export interface TypesImportData {
2076
2092
  * as generating `components.d.ts` files.
2077
2093
  */
2078
2094
  export interface TypesMemberNameData {
2095
+ /**
2096
+ * The original name of the import before any aliasing was applied.
2097
+ *
2098
+ * i.e. if a component imports a type as follows:
2099
+ * `import { MyType as MyCoolType } from './my-type';`
2100
+ *
2101
+ * the `originalName` would be 'MyType'. If the import is not aliased, then `originalName` and `localName` will be the same.
2102
+ */
2103
+ originalName: string;
2079
2104
  /**
2080
2105
  * The name of the type as it's used within a file.
2081
2106
  */
@@ -2134,7 +2159,7 @@ export interface CompilerWorkerContext {
2134
2159
  transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
2135
2160
  }
2136
2161
  /**
2137
- * The methods that are supported on a {@link d.CompilerWorkerContext}
2162
+ * The methods that are supported on a {@link CompilerWorkerContext}
2138
2163
  */
2139
2164
  export type WorkerContextMethod = keyof CompilerWorkerContext;
2140
2165
  /**
@@ -79,6 +79,13 @@ export interface StencilConfig {
79
79
  * Below is an example folder structure containing a webapp's global sass file, named app.css.
80
80
  */
81
81
  globalStyle?: string;
82
+ /**
83
+ * Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
84
+ * for each component in the build when `true`.
85
+ *
86
+ * @default false
87
+ */
88
+ generateExportMaps?: boolean;
82
89
  /**
83
90
  * When the hashFileNames config is set to true, and it is a production build,
84
91
  * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
@@ -838,6 +845,19 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
838
845
  * Remove HTML comments. Defaults to `true`.
839
846
  */
840
847
  removeHtmlComments?: boolean;
848
+ /**
849
+ * If set to `false` Stencil will ignore the fact that a component has a `shadow: true`
850
+ * flag and serializes it as a scoped component. If set to `true` the component will
851
+ * be rendered within a Declarative Shadow DOM.
852
+ * @default false
853
+ */
854
+ serializeShadowRoot?: boolean;
855
+ /**
856
+ * The `fullDocument` flag determines the format of the rendered output. Set it to true to
857
+ * generate a complete HTML document, or false to render only the component.
858
+ * @default true
859
+ */
860
+ fullDocument?: boolean;
841
861
  }
842
862
  export interface HydrateFactoryOptions extends SerializeDocumentOptions {
843
863
  serializeToHtml: boolean;
@@ -1581,6 +1601,7 @@ export interface RollupInputOptions {
1581
1601
  [id: string]: string;
1582
1602
  };
1583
1603
  treeshake?: boolean;
1604
+ external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
1584
1605
  }
1585
1606
  export interface RollupOutputOptions {
1586
1607
  globals?: {
@@ -989,7 +989,6 @@ export declare namespace JSXBase {
989
989
  interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
990
990
  form?: string;
991
991
  htmlFor?: string;
992
- htmlfor?: string;
993
992
  }
994
993
  interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
995
994
  value?: string | string[] | number;
@@ -1100,7 +1099,6 @@ export declare namespace JSXBase {
1100
1099
  interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
1101
1100
  form?: string;
1102
1101
  htmlFor?: string;
1103
- htmlfor?: string;
1104
1102
  name?: string;
1105
1103
  }
1106
1104
  interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {