Skip to content

Commit

Permalink
remove assetsDir backwards compatibility (#3341)
Browse files Browse the repository at this point in the history
the `assetsDir` option for the `@Component` decorator was deprecated
some time ago in favor of the `assetsDirs` option, but we have retained
backwards-compatibility with the old option nonetheless. this commit
removes that backwards compatibility.

STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component

BREAKING CHANGE: setting `assetsDir` on a component will no longer work.
Users should migrate to `assetsDirs` instead.
  • Loading branch information
alicewriteswrongs authored and rwaskiewicz committed Jan 25, 2023
1 parent cb1f5fc commit 6074a29
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { augmentDiagnosticWithNode, buildError, buildWarn, isString, validateComponentTag } from '@utils';
import { augmentDiagnosticWithNode, buildError, validateComponentTag } from '@utils';
import ts from 'typescript';

import type * as d from '../../../declarations';
Expand Down Expand Up @@ -41,13 +41,6 @@ export const componentDecoratorToStatic = (

const assetsDirs = componentOptions.assetsDirs || [];

if (isString((componentOptions as any).assetsDir)) {
assetsDirs.push((componentOptions as any).assetsDir);
const warn = buildWarn(diagnostics);
warn.messageText = `@Component option "assetsDir" should be renamed to "assetsDirs" and the value should be an array of strings.`;
augmentDiagnosticWithNode(warn, componentDecorator);
}

if (assetsDirs.length > 0) {
newMembers.push(createStaticGetter('assetsDirs', convertValueToLiteral(assetsDirs)));
}
Expand Down

0 comments on commit 6074a29

Please sign in to comment.