diff --git a/src/compiler/transformers/core-runtime-apis.ts b/src/compiler/transformers/core-runtime-apis.ts index 5ba0ec6f4ba..faab64d5247 100644 --- a/src/compiler/transformers/core-runtime-apis.ts +++ b/src/compiler/transformers/core-runtime-apis.ts @@ -1,6 +1,5 @@ import type * as d from '../../declarations'; -export const ATTACH_SHADOW = '__stencil_attachShadow'; export const CREATE_EVENT = '__stencil_createEvent'; export const DEFINE_CUSTOM_ELEMENT = '__stencil_defineCustomElement'; export const GET_ELEMENT = '__stencil_getElement'; @@ -12,7 +11,6 @@ export const REGISTER_HOST = '__stencil_registerHost'; export const H = '__stencil_h'; export const RUNTIME_APIS = { - attachShadow: `attachShadow as ${ATTACH_SHADOW}`, createEvent: `createEvent as ${CREATE_EVENT}`, defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`, getElement: `getElement as ${GET_ELEMENT}`, diff --git a/src/compiler/transformers/test/core-runtime-apis.spec.ts b/src/compiler/transformers/test/core-runtime-apis.spec.ts index 1a46582ba09..eb098fee806 100644 --- a/src/compiler/transformers/test/core-runtime-apis.spec.ts +++ b/src/compiler/transformers/test/core-runtime-apis.spec.ts @@ -21,23 +21,23 @@ describe('addCoreRuntimeApi()', () => { expect(mockModule.coreRuntimeApis).toBeDefined(); expect(mockModule.coreRuntimeApis).toHaveLength(0); - addCoreRuntimeApi(mockModule, RUNTIME_APIS.attachShadow); - expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.attachShadow]); + addCoreRuntimeApi(mockModule, RUNTIME_APIS.Host); + expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.Host]); addCoreRuntimeApi(mockModule, RUNTIME_APIS.createEvent); - expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.attachShadow, RUNTIME_APIS.createEvent]); + expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.Host, RUNTIME_APIS.createEvent]); }); it("does not allow duplicate entries in a module's coreRuntimeApis", () => { expect(mockModule.coreRuntimeApis).toBeDefined(); expect(mockModule.coreRuntimeApis).toHaveLength(0); - addCoreRuntimeApi(mockModule, RUNTIME_APIS.attachShadow); - expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.attachShadow]); + addCoreRuntimeApi(mockModule, RUNTIME_APIS.Host); + expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.Host]); // attempt to add the api again, doing so shall not create a duplicate entry - addCoreRuntimeApi(mockModule, RUNTIME_APIS.attachShadow); - expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.attachShadow]); + addCoreRuntimeApi(mockModule, RUNTIME_APIS.Host); + expect(mockModule.coreRuntimeApis).toEqual([RUNTIME_APIS.Host]); }); }); @@ -57,12 +57,12 @@ describe('addOutputTargetCoreRuntimeApi()', () => { expect(mockModule.outputTargetCoreRuntimeApis).toBeDefined(); expect(Object.entries(mockModule.outputTargetCoreRuntimeApis)).toHaveLength(0); - addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.attachShadow); - expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.attachShadow] }); + addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.Host); + expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.Host] }); addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.createEvent); expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ - [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.attachShadow, RUNTIME_APIS.createEvent], + [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.Host, RUNTIME_APIS.createEvent], }); }); @@ -70,12 +70,12 @@ describe('addOutputTargetCoreRuntimeApi()', () => { expect(mockModule.outputTargetCoreRuntimeApis).toBeDefined(); expect(Object.entries(mockModule.outputTargetCoreRuntimeApis)).toHaveLength(0); - addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.attachShadow); - expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.attachShadow] }); + addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.Host); + expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.Host] }); // attempt to add the api again, doing so shall not create a duplicate entry - addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.attachShadow); - expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.attachShadow] }); + addOutputTargetCoreRuntimeApi(mockModule, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.Host); + expect(mockModule.outputTargetCoreRuntimeApis).toEqual({ [DIST_CUSTOM_ELEMENTS]: [RUNTIME_APIS.Host] }); }); });