Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): removed support for tagNameTransform #5853

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/app-data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export const BUILD: BuildConditionals = {
initializeNextTick: false,
asyncLoading: false,
asyncQueue: false,
transformTagName: false,
attachStyles: true,
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
experimentalSlotFixes: false,
Expand Down
1 change: 0 additions & 1 deletion src/compiler/config/test/validate-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ describe('validation', () => {
expect(config.extras.scriptDataOpts).toBe(false);
expect(config.extras.slotChildNodesFix).toBe(false);
expect(config.extras.initializeNextTick).toBe(false);
expect(config.extras.tagNameTransform).toBe(false);
expect(config.extras.scopedSlotTextContentFix).toBe(false);
});

Expand Down
1 change: 0 additions & 1 deletion src/compiler/config/validate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export const validateConfig = (
validatedConfig.extras.lifecycleDOMEvents = !!validatedConfig.extras.lifecycleDOMEvents;
validatedConfig.extras.scriptDataOpts = !!validatedConfig.extras.scriptDataOpts;
validatedConfig.extras.initializeNextTick = !!validatedConfig.extras.initializeNextTick;
validatedConfig.extras.tagNameTransform = !!validatedConfig.extras.tagNameTransform;

// TODO(STENCIL-914): remove when `experimentalSlotFixes` is the default behavior
// If the user set `experimentalSlotFixes` and any individual slot fix flags to `false`, we need to log a warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ const generateCustomElementsTypesOutput = async (
* @returns the contents of the type declaration file for the provided `cmp`
*/
const generateCustomElementType = (componentsDtsRelPath: string, cmp: d.ComponentCompilerMeta): string => {
const stencilPublicRuntime = join(dirname(componentsDtsRelPath), 'stencil-public-runtime.d.ts');
const tagNameAsPascal = dashToPascalCase(cmp.tagName);
const o: string[] = [
`import type { Components, JSX } from "${componentsDtsRelPath}";`,
`import type { CustomElementsDefineOptions } from "${stencilPublicRuntime}";`,
``,
`interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
`export const ${tagNameAsPascal}: {`,
Expand All @@ -198,7 +200,7 @@ const generateCustomElementType = (componentsDtsRelPath: string, cmp: d.Componen
`/**`,
` * Used to define this component and all nested components recursively.`,
` */`,
`export const defineCustomElement: () => void;`,
`export const defineCustomElement: (options?: CustomElementsDefineOptions) => void;`,
``,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const getLazyBuildConditionals = (

build.lazyLoad = true;
build.hydrateServerSide = false;
build.transformTagName = config.extras.tagNameTransform;
build.asyncQueue = config.taskQueue === 'congestionAsync';
build.taskQueue = config.taskQueue !== 'immediate';
build.initializeNextTick = config.extras.initializeNextTick;
Expand Down
13 changes: 0 additions & 13 deletions src/compiler/output-targets/test/build-conditionals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,6 @@ describe('build-conditionals', () => {
expect(config.taskQueue).toBe('async');
});

it('tagNameTransform default', () => {
const { config } = validateConfig(userConfig, mockLoadConfigInit());
const bc = getLazyBuildConditionals(config, cmps);
expect(bc.transformTagName).toBe(false);
});

it('tagNameTransform true', () => {
userConfig.extras = { tagNameTransform: true };
const { config } = validateConfig(userConfig, mockLoadConfigInit());
const bc = getLazyBuildConditionals(config, cmps);
expect(bc.transformTagName).toBe(true);
});

it('hydrateClientSide default', () => {
const { config } = validateConfig(userConfig, mockLoadConfigInit());
const bc = getLazyBuildConditionals(config, cmps);
Expand Down
1 change: 0 additions & 1 deletion src/declarations/stencil-private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
shadowDomShim?: boolean;
asyncQueue?: boolean;
transformTagName?: boolean;
attachStyles?: boolean;

// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
Expand Down
6 changes: 0 additions & 6 deletions src/declarations/stencil-public-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,6 @@ interface ConfigExtrasBase {
*/
initializeNextTick?: boolean;

/**
* Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName
* can be customized at runtime. Defaults to `false`.
*/
tagNameTransform?: boolean;

// TODO(STENCIL-1086): remove this option when it's the default behavior
/**
* Experimental flag.
Expand Down
1 change: 0 additions & 1 deletion src/declarations/stencil-public-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,6 @@ export interface CustomElementsDefineOptions {
exclude?: string[];
resourcesUrl?: string;
syncQueue?: boolean;
transformTagName?: (tagName: string) => string;
jmp?: (c: Function) => any;
raf?: (c: FrameRequestCallback) => number;
ael?: (
Expand Down
5 changes: 1 addition & 4 deletions src/runtime/bootstrap-lazy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ export const bootstrapLazy = (lazyBundles: d.LazyBundlesRuntimeData, options: d.
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
}
const tagName =
BUILD.transformTagName && options.transformTagName
? options.transformTagName(cmpMeta.$tagName$)
: cmpMeta.$tagName$;
const tagName = cmpMeta.$tagName$;
const HostElement = class extends HTMLElement {
['s-p']: Promise<void>[];
['s-rc']: (() => void)[];
Expand Down