@stencil/core 4.37.1 → 4.38.0-dev.1759726935.ef05b45

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 (43) hide show
  1. package/cli/index.cjs +2 -2
  2. package/cli/index.js +2 -2
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +337 -169
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +3 -3
  12. package/internal/app-data/index.cjs +1 -1
  13. package/internal/app-data/index.js +1 -1
  14. package/internal/app-data/package.json +1 -1
  15. package/internal/app-globals/package.json +1 -1
  16. package/internal/client/index.js +95 -46
  17. package/internal/client/package.json +1 -1
  18. package/internal/client/patch-browser.js +1 -1
  19. package/internal/hydrate/index.js +116 -64
  20. package/internal/hydrate/package.json +1 -1
  21. package/internal/hydrate/runner.d.ts +2 -0
  22. package/internal/hydrate/runner.js +1 -1
  23. package/internal/package.json +1 -1
  24. package/internal/stencil-core/index.d.ts +2 -0
  25. package/internal/stencil-private.d.ts +33 -8
  26. package/internal/stencil-public-compiler.d.ts +5 -0
  27. package/internal/stencil-public-runtime.d.ts +16 -2
  28. package/internal/testing/index.js +91 -44
  29. package/internal/testing/package.json +1 -1
  30. package/mock-doc/index.cjs +1 -1
  31. package/mock-doc/index.js +1 -1
  32. package/mock-doc/package.json +1 -1
  33. package/package.json +1 -1
  34. package/screenshot/index.js +2 -2
  35. package/screenshot/package.json +1 -1
  36. package/screenshot/pixel-match.js +1 -1
  37. package/sys/node/index.js +34 -34
  38. package/sys/node/package.json +1 -1
  39. package/sys/node/worker.js +1 -1
  40. package/testing/index.d.ts +1 -1
  41. package/testing/index.js +114 -12
  42. package/testing/mocks.d.ts +1 -0
  43. package/testing/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/sys/node",
3
- "version": "4.37.1",
3
+ "version": "4.38.0-dev.1759726935.ef05b45",
4
4
  "description": "Stencil Node System.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,4 +1,4 @@
1
1
  /*!
2
- Stencil Node System Worker v4.37.1 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System Worker v4.38.0-dev.1759726935.ef05b45 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";var f=Object.create;var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var g=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of E(t))!R.call(n,e)&&e!==r&&d(n,e,{get:()=>t[e],enumerable:!(s=p(t,e))||s.enumerable});return n};var c=(n,t,r)=>(r=n!=null?f(y(n)):{},g(t||!n||!n.__esModule?d(r,"default",{value:n,enumerable:!0}):r,n));var l=c(require("../../compiler/stencil.js")),m=c(require("../../sys/node/index.js"));var a=(n,t)=>{let r=e=>{e&&e.code==="ERR_IPC_CHANNEL_CLOSED"&&n.exit(0)},s=(e,o)=>{let i={stencilId:e,stencilRtnValue:null,stencilRtnError:"Error"};typeof o=="string"?i.stencilRtnError+=": "+o:o&&(o.stack?i.stencilRtnError+=": "+o.stack:o.message&&(i.stencilRtnError+=":"+o.message)),n.send(i,r)};n.on("message",async e=>{if(e&&typeof e.stencilId=="number")try{let o={stencilId:e.stencilId,stencilRtnValue:await t(e),stencilRtnError:null};n.send(o,r)}catch(o){s(e.stencilId,o)}}),n.on("unhandledRejection",e=>{s(-1,e)})};var k=m.createNodeSys({process}),M=l.createWorkerMessageHandler(k);a(process,M);
@@ -1,6 +1,6 @@
1
1
  export { getCreateJestPuppeteerEnvironment, getCreateJestTestRunner, getJestPreprocessor, getJestPreset, getJestSetupTestFramework, } from './jest/jest-stencil-connector';
2
2
  export { mockFetch, MockHeaders, MockRequest, MockRequestInfo, MockRequestInit, MockResponse, MockResponseInit, } from './mock-fetch';
3
- export { mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, } from './mocks';
3
+ export { mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, } from './mocks';
4
4
  export { E2EElement, E2EPage, newE2EPage } from './puppeteer';
5
5
  export { newSpecPage } from './spec-page';
6
6
  export { transpile } from './test-transpile';
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v4.37.1 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v4.38.0-dev.1759726935.ef05b45 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
 
@@ -1673,6 +1673,7 @@ __export(index_exports, {
1673
1673
  mockBuildCtx: () => mockBuildCtx,
1674
1674
  mockCompilerCtx: () => mockCompilerCtx,
1675
1675
  mockCompilerSystem: () => mockCompilerSystem,
1676
+ mockComponentMeta: () => mockComponentMeta,
1676
1677
  mockConfig: () => mockConfig,
1677
1678
  mockDocument: () => mockDocument,
1678
1679
  mockFetch: () => mockFetch,
@@ -1891,22 +1892,27 @@ var formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
1891
1892
  }
1892
1893
  const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
1893
1894
  const hostListeners = formatHostListeners(compilerMeta);
1894
- const watchers = formatComponentRuntimeWatchers(compilerMeta);
1895
+ const watchers = formatComponentRuntimeReactiveHandlers(compilerMeta, "watchers");
1896
+ const serializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "serializers");
1897
+ const deserializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "deserializers");
1895
1898
  return trimFalsy([
1896
1899
  flags,
1897
1900
  compilerMeta.tagName,
1898
1901
  Object.keys(members).length > 0 ? members : void 0,
1899
1902
  hostListeners.length > 0 ? hostListeners : void 0,
1900
- Object.keys(watchers).length > 0 ? watchers : void 0
1903
+ Object.keys(watchers).length > 0 ? watchers : void 0,
1904
+ Object.keys(serializers).length > 0 ? serializers : void 0,
1905
+ Object.keys(deserializers).length > 0 ? deserializers : void 0
1901
1906
  ]);
1902
1907
  };
1903
- var formatComponentRuntimeWatchers = (compilerMeta) => {
1904
- const watchers = {};
1905
- compilerMeta.watchers.forEach(({ propName, methodName }) => {
1906
- var _a;
1907
- watchers[propName] = [...(_a = watchers[propName]) != null ? _a : [], methodName];
1908
+ var formatComponentRuntimeReactiveHandlers = (compilerMeta, decorator) => {
1909
+ var _a;
1910
+ const handlers = {};
1911
+ (_a = compilerMeta[decorator]) == null ? void 0 : _a.forEach(({ propName, methodName }) => {
1912
+ var _a2;
1913
+ handlers[propName] = [...(_a2 = handlers[propName]) != null ? _a2 : [], methodName];
1908
1914
  });
1909
- return watchers;
1915
+ return handlers;
1910
1916
  };
1911
1917
  var formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
1912
1918
  return {
@@ -7230,6 +7236,7 @@ var validateConfig = (userConfig = {}, bootstrapConfig) => {
7230
7236
  setBooleanConfig(validatedConfig, "autoprefixCss", null, validatedConfig.buildEs5);
7231
7237
  setBooleanConfig(validatedConfig, "validateTypes", null, !validatedConfig._isTesting);
7232
7238
  setBooleanConfig(validatedConfig, "allowInlineScripts", null, true);
7239
+ setBooleanConfig(validatedConfig, "suppressReservedPublicNameWarnings", null, false);
7233
7240
  if (!isString(validatedConfig.taskQueue)) {
7234
7241
  validatedConfig.taskQueue = "async";
7235
7242
  }
@@ -8351,6 +8358,95 @@ var shouldIgnore = (filePath) => {
8351
8358
  };
8352
8359
  var IGNORE = [".ds_store", ".gitignore", "desktop.ini", "thumbs.db"];
8353
8360
 
8361
+ // src/compiler/types/tests/ComponentCompilerMeta.stub.ts
8362
+ var stubComponentCompilerMeta = (overrides = {}) => ({
8363
+ assetsDirs: [],
8364
+ attachInternalsMemberName: null,
8365
+ componentClassName: "StubCmp",
8366
+ dependencies: [],
8367
+ dependents: [],
8368
+ deserializers: [],
8369
+ directDependencies: [],
8370
+ directDependents: [],
8371
+ docs: { text: "docs", tags: [] },
8372
+ doesExtend: false,
8373
+ elementRef: "",
8374
+ encapsulation: "none",
8375
+ events: [],
8376
+ excludeFromCollection: false,
8377
+ formAssociated: false,
8378
+ hasAttribute: false,
8379
+ hasAttributeChangedCallbackFn: false,
8380
+ hasComponentDidLoadFn: false,
8381
+ hasComponentDidRenderFn: false,
8382
+ hasComponentDidUpdateFn: false,
8383
+ hasComponentShouldUpdateFn: false,
8384
+ hasComponentWillLoadFn: false,
8385
+ hasComponentWillRenderFn: false,
8386
+ hasComponentWillUpdateFn: false,
8387
+ hasConnectedCallbackFn: false,
8388
+ hasDeserializer: false,
8389
+ hasDisconnectedCallbackFn: false,
8390
+ hasElement: false,
8391
+ hasEvent: false,
8392
+ hasLifecycle: false,
8393
+ hasListener: false,
8394
+ hasListenerTarget: false,
8395
+ hasListenerTargetBody: false,
8396
+ hasListenerTargetDocument: false,
8397
+ hasListenerTargetParent: false,
8398
+ hasListenerTargetWindow: false,
8399
+ hasMember: false,
8400
+ hasMethod: false,
8401
+ hasMode: false,
8402
+ hasModernPropertyDecls: false,
8403
+ hasProp: false,
8404
+ hasPropBoolean: false,
8405
+ hasPropMutable: false,
8406
+ hasPropNumber: false,
8407
+ hasPropString: false,
8408
+ hasReflect: false,
8409
+ hasRenderFn: false,
8410
+ hasSerializer: false,
8411
+ hasState: false,
8412
+ hasStyle: false,
8413
+ hasVdomAttribute: false,
8414
+ hasVdomClass: false,
8415
+ hasVdomFunctional: false,
8416
+ hasVdomKey: false,
8417
+ hasVdomListener: false,
8418
+ hasVdomPropOrAttr: false,
8419
+ hasVdomRef: false,
8420
+ hasVdomRender: false,
8421
+ hasVdomStyle: false,
8422
+ hasVdomText: false,
8423
+ hasVdomXlink: false,
8424
+ hasWatchCallback: false,
8425
+ htmlAttrNames: [],
8426
+ htmlParts: [],
8427
+ htmlTagNames: [],
8428
+ internal: false,
8429
+ isCollectionDependency: false,
8430
+ isPlain: false,
8431
+ isUpdateable: false,
8432
+ jsFilePath: "/some/stubbed/path/my-component.js",
8433
+ listeners: [],
8434
+ methods: [],
8435
+ potentialCmpRefs: [],
8436
+ properties: [],
8437
+ serializers: [],
8438
+ shadowDelegatesFocus: false,
8439
+ sourceFilePath: "/some/stubbed/path/my-component.tsx",
8440
+ sourceMapPath: "/some/stubbed/path/my-component.js.map",
8441
+ states: [],
8442
+ styleDocs: [],
8443
+ styles: [],
8444
+ tagName: "stub-cmp",
8445
+ virtualProperties: [],
8446
+ watchers: [],
8447
+ ...overrides
8448
+ });
8449
+
8354
8450
  // src/testing/testing-logger.ts
8355
8451
  var TestingLogger = class {
8356
8452
  constructor() {
@@ -9100,6 +9196,7 @@ var createTestingSystem = () => {
9100
9196
  };
9101
9197
 
9102
9198
  // src/testing/mocks.ts
9199
+ var mockComponentMeta = stubComponentCompilerMeta;
9103
9200
  function mockValidatedConfig(overrides = {}) {
9104
9201
  var _a;
9105
9202
  const baseConfig = mockConfig(overrides);
@@ -9126,6 +9223,7 @@ function mockValidatedConfig(overrides = {}) {
9126
9223
  rootDir: rootDir4,
9127
9224
  srcDir: "/src",
9128
9225
  srcIndexHtml: "src/index.html",
9226
+ suppressReservedPublicNameWarnings: false,
9129
9227
  sys: createTestingSystem(),
9130
9228
  testing: {},
9131
9229
  transformAliasedImportPaths: true,
@@ -9173,6 +9271,7 @@ function mockConfig(overrides = {}) {
9173
9271
  },
9174
9272
  rootDir: rootDir4,
9175
9273
  sourceMap: true,
9274
+ suppressReservedPublicNameWarnings: false,
9176
9275
  sys,
9177
9276
  testing: null,
9178
9277
  validateTypes: false,
@@ -10700,6 +10799,7 @@ var getBuildFeatures = (cmps) => {
10700
10799
  const f = {
10701
10800
  allRenderFn: cmps.every((c) => c.hasRenderFn),
10702
10801
  formAssociated: cmps.some((c) => c.formAssociated),
10802
+ deserializer: cmps.some((c) => c.hasDeserializer),
10703
10803
  element: cmps.some((c) => c.hasElement),
10704
10804
  event: cmps.some((c) => c.hasEvent),
10705
10805
  hasRenderFn: cmps.some((c) => c.hasRenderFn),
@@ -10715,14 +10815,16 @@ var getBuildFeatures = (cmps) => {
10715
10815
  method: cmps.some((c) => c.hasMethod),
10716
10816
  mode: cmps.some((c) => c.hasMode),
10717
10817
  modernPropertyDecls: cmps.some((c) => c.hasModernPropertyDecls),
10718
- observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
10818
+ observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback || c.hasDeserializer),
10719
10819
  prop: cmps.some((c) => c.hasProp),
10720
10820
  propBoolean: cmps.some((c) => c.hasPropBoolean),
10821
+ propChangeCallback: cmps.some((c) => c.hasWatchCallback || c.hasDeserializer || c.hasSerializer),
10721
10822
  propNumber: cmps.some((c) => c.hasPropNumber),
10722
10823
  propString: cmps.some((c) => c.hasPropString),
10723
10824
  propMutable: cmps.some((c) => c.hasPropMutable),
10724
- reflect: cmps.some((c) => c.hasReflect),
10825
+ reflect: cmps.some((c) => c.hasReflect || c.hasSerializer),
10725
10826
  scoped: cmps.some((c) => c.encapsulation === "scoped"),
10827
+ serializer: cmps.some((c) => c.hasSerializer),
10726
10828
  shadowDom,
10727
10829
  shadowDelegatesFocus: shadowDom && cmps.some((c) => c.shadowDelegatesFocus),
10728
10830
  slot,
@@ -10742,7 +10844,6 @@ var getBuildFeatures = (cmps) => {
10742
10844
  vdomRender: cmps.some((c) => c.hasVdomRender),
10743
10845
  vdomStyle: cmps.some((c) => c.hasVdomStyle),
10744
10846
  vdomText: cmps.some((c) => c.hasVdomText),
10745
- watchCallback: cmps.some((c) => c.hasWatchCallback),
10746
10847
  taskQueue: true
10747
10848
  };
10748
10849
  f.vdomAttribute = f.vdomAttribute || f.reflect;
@@ -11251,6 +11352,7 @@ function setupTestingConfig(validatedConfig) {
11251
11352
  mockBuildCtx,
11252
11353
  mockCompilerCtx,
11253
11354
  mockCompilerSystem,
11355
+ mockComponentMeta,
11254
11356
  mockConfig,
11255
11357
  mockDocument,
11256
11358
  mockFetch,
@@ -1,6 +1,7 @@
1
1
  import type * as d from '@stencil/core/internal';
2
2
  import { TestingLogger } from './testing-logger';
3
3
  import { TestingSystem } from './testing-sys';
4
+ export declare const mockComponentMeta: (overrides?: Partial<d.ComponentCompilerMeta>) => d.ComponentCompilerMeta;
4
5
  /**
5
6
  * Creates a mock instance of an internal, validated Stencil configuration object
6
7
  * the caller
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "4.37.1",
3
+ "version": "4.38.0-dev.1759726935.ef05b45",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",