-
Notifications
You must be signed in to change notification settings - Fork 785
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
remove assetsDir backwards compatibility #3341
Conversation
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.
if (isString((componentOptions as any).assetsDirs)) { | ||
const error = buildError(diagnostics); | ||
error.messageText = `@Component option "assetsDir" is no longer supported. "assetsDirs" should be used instead.` | ||
augmentDiagnosticWithNode(error, componentDecorator) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may be able to delete this conditional in its entirety. ATM, assetsDirs
is typed as a string[]
:
/**
* Array of relative links to folders of assets required by the component.
*/
assetsDirs?: string[];
I think if folks are still using it as a string literal, we can lean on the TS type checker to yell at them. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to leave a review comment on this but forgot - my thought initially was to just remove the whole conditional, but I wasn't sure if we wanted to try to have some sort of last-ditch error throwing deprecation warning. But I'm for removing it entirely if you think that makes sense :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it's acceptable at this point from a usability standpoint. assetsDir: string
was deprecated in v2.0.0, so I'd argue folks have definitely had enough time to migrate to assetsDir: string[]
In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
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.
…pat (#3343) In #3341 we removed backwards compatibility for the deprecated `assetsDir` component decorator prop. This updates the BREAKING_CHANGES document to reflect that change. STENCIL-410: Remove Backwards Compatibility for assetDir Field on @component
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm test
) were run locally and passednpm run test.karma.prod
) were run locally and passednpm run prettier
) was run locally and passedPull request type
Please check the type of change your PR introduces:
What is the current behavior?
GitHub Issue Number: N/A
Right now we have backwards compatibility for the
assetsDir
option by converting it under the hood fromstring
tostring[]
and setting it onassetsDirs
. This removes that, since the param has been deprecated for quite some time now.What is the new behavior?
It will no longer allow the backwards compatibility.
Does this introduce a breaking change?
Users will need to remove any
assetsDir
props passed in to the@Component
decorator, and migrate toassetsDirs
instead.Testing
I ran the unit tests and also installed this into a test component repo to verify that things are working alright
Other information