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 committed Apr 21, 2022
1 parent 0749dc0 commit eb61f89
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as d from '../../../declarations';
import { augmentDiagnosticWithNode, buildError, validateComponentTag, isString, buildWarn } from '@utils';
import { augmentDiagnosticWithNode, buildError, validateComponentTag } from '@utils';
import { getDeclarationParameters } from './decorator-utils';
import { convertValueToLiteral, createStaticGetter } from '../transform-utils';
import { styleToStatic } from './style-to-static';
Expand Down Expand Up @@ -40,13 +40,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 eb61f89

Please sign in to comment.