Skip to content

Commit 719bd4d

Browse files
alicewriteswrongsrwaskiewicz
authored andcommitted
chore(output-targets): soft-remove the dist-custom-elements-bundle… (#3579)
This soft-removes the dist-custom-elements-bundle output target by removing it from our list of valid output targets and fixing the few issues that causes w/ tests, type checking, etc. This also adds TODO(STENCIL-561) comments that (hopefully) point out the main places we'll need to delete code later one when we tear the whole thing out all the way. STENCIL-260: Soft Removal of dist-custom-elements-bundle
1 parent c9fde10 commit 719bd4d

File tree

12 files changed

+11
-33
lines changed

12 files changed

+11
-33
lines changed

src/compiler/config/outputs/index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import { buildError, buildWarn } from '@utils';
1+
import { buildError } from '@utils';
22

33
import type * as d from '../../../declarations';
4-
import {
5-
DIST_CUSTOM_ELEMENTS_BUNDLE,
6-
isValidConfigOutputTarget,
7-
VALID_CONFIG_OUTPUT_TARGETS,
8-
} from '../../output-targets/output-utils';
4+
import { isValidConfigOutputTarget, VALID_CONFIG_OUTPUT_TARGETS } from '../../output-targets/output-utils';
95
import { validateCollection } from './validate-collection';
106
import { validateCustomElement } from './validate-custom-element';
117
import { validateCustomElementBundle } from './validate-custom-element-bundle';
@@ -26,10 +22,6 @@ export const validateOutputTargets = (config: d.ValidatedConfig, diagnostics: d.
2622
err.messageText = `Invalid outputTarget type "${
2723
outputTarget.type
2824
}". Valid outputTarget types include: ${VALID_CONFIG_OUTPUT_TARGETS.map((t) => `"${t}"`).join(', ')}`;
29-
} else if (outputTarget.type === DIST_CUSTOM_ELEMENTS_BUNDLE) {
30-
// TODO(STENCIL-260): Remove this check when the 'dist-custom-elements-bundle' is removed
31-
const warning = buildWarn(diagnostics);
32-
warning.messageText = `dist-custom-elements-bundle is deprecated and will be removed in a future major version release. Use "dist-custom-elements" instead. If "dist-custom-elements" does not meet your needs, please add a comment to https://github.com/ionic-team/stencil/issues/3136.`;
3325
}
3426
});
3527

src/compiler/config/outputs/validate-custom-element-bundle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
12
import { isBoolean } from '@utils';
23

34
import type * as d from '../../../declarations';

src/compiler/config/test/validate-config.spec.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -345,19 +345,6 @@ describe('validation', () => {
345345
expect(validated.diagnostics).toHaveLength(1);
346346
});
347347

348-
it('should warn when dist-custom-elements-bundle is found', () => {
349-
userConfig.outputTargets = [
350-
{
351-
type: 'dist-custom-elements-bundle',
352-
},
353-
];
354-
const validated = validateConfig(userConfig, bootstrapConfig);
355-
expect(validated.diagnostics).toHaveLength(1);
356-
expect(validated.diagnostics[0].messageText).toBe(
357-
'dist-custom-elements-bundle is deprecated and will be removed in a future major version release. Use "dist-custom-elements" instead. If "dist-custom-elements" does not meet your needs, please add a comment to https://github.com/ionic-team/stencil/issues/3136.'
358-
);
359-
});
360-
361348
it('should default outputTargets with www', () => {
362349
const { config } = validateConfig(userConfig, bootstrapConfig);
363350
expect(config.outputTargets.some((o) => o.type === 'www')).toBe(true);

src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-build-conditionals.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO(STENCIL-561): move this into ../dist-custom-elements and rename things accordingly
12
import type * as d from '../../../declarations';
23
import { getBuildFeatures, updateBuildConditionals } from '../../app-core/app-data';
34

src/compiler/output-targets/dist-custom-elements-bundle/custom-elements-bundle-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
12
import { dashToPascalCase, normalizePath } from '@utils';
23
import { dirname, join, relative } from 'path';
34

src/compiler/output-targets/dist-custom-elements-bundle/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
12
import {
23
catchError,
34
dashToPascalCase,

src/compiler/output-targets/output-utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const isOutputTargetDistCollection = (o: d.OutputTarget): o is d.OutputTa
2828
export const isOutputTargetDistCustomElements = (o: d.OutputTarget): o is d.OutputTargetDistCustomElements =>
2929
o.type === DIST_CUSTOM_ELEMENTS;
3030

31+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
3132
export const isOutputTargetDistCustomElementsBundle = (
3233
o: d.OutputTarget
3334
): o is d.OutputTargetDistCustomElementsBundle => o.type === DIST_CUSTOM_ELEMENTS_BUNDLE;
@@ -73,6 +74,7 @@ export const CUSTOM = 'custom';
7374
export const DIST = 'dist';
7475
export const DIST_COLLECTION = 'dist-collection';
7576
export const DIST_CUSTOM_ELEMENTS = 'dist-custom-elements';
77+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
7678
export const DIST_CUSTOM_ELEMENTS_BUNDLE = 'dist-custom-elements-bundle';
7779

7880
export const DIST_TYPES = 'dist-types';
@@ -101,7 +103,6 @@ export const VALID_CONFIG_OUTPUT_TARGETS = [
101103
DIST,
102104
DIST_COLLECTION,
103105
DIST_CUSTOM_ELEMENTS,
104-
DIST_CUSTOM_ELEMENTS_BUNDLE,
105106
DIST_LAZY,
106107
DIST_HYDRATE_SCRIPT,
107108

src/compiler/output-targets/test/output-targets-dist-custom-elements.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
outputCustomElements,
2020
} from '../dist-custom-elements';
2121
import * as outputCustomElementsMod from '../dist-custom-elements';
22+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
2223
import { DIST_CUSTOM_ELEMENTS, DIST_CUSTOM_ELEMENTS_BUNDLE } from '../output-utils';
2324

2425
const setup = () => {

src/compiler/types/tests/validate-package-json.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { mockBuildCtx, mockCompilerCtx, mockValidatedConfig } from '@stencil/cor
33
import path from 'path';
44

55
import { normalizePath } from '../../../utils/normalize-path';
6+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
67
import { DIST_COLLECTION, DIST_CUSTOM_ELEMENTS, DIST_CUSTOM_ELEMENTS_BUNDLE } from '../../output-targets/output-utils';
78
import * as v from '../validate-build-package-json';
89

@@ -93,6 +94,7 @@ describe('validate-package-json', () => {
9394
expect(buildCtx.diagnostics).toHaveLength(0);
9495
});
9596

97+
// TODO(STENCIL-561): fully delete dist-custom-elements-bundle code
9698
it('validate custom elements bundle module', async () => {
9799
config.outputTargets = [
98100
{

test/end-to-end/stencil.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ export const config: Config = {
3333
{
3434
type: 'dist',
3535
},
36-
{
37-
type: 'dist-custom-elements-bundle',
38-
},
3936
{
4037
type: 'dist-hydrate-script',
4138
},

0 commit comments

Comments
 (0)