-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chore(atomic): update getAssetPath #4946
base: master
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
|
is this really a |
packages/atomic/src/components/search/atomic-layout/search-layout.spec.ts
Outdated
Show resolved
Hide resolved
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.
How does the assetPath works for NPM user today, and how would it works afterward?
Co-authored-by: Louis Bompart <lbompart@coveo.com>
For NPM users today, if the This behavior remains the same moving forward. Since the |
So technically RESOURCE_URL could be any string or any variable since it is undefined in the npm build and replaced in the cdn one ? Also, this is not a |
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 think that's fine.
However, QA Approval will be mandatory for this one
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.
lets try it !
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.
🚀
Update the logic to handle asset paths without the need of Stencil. The logic is based on Stencil/core's
getAssetPath
function, where the resourceUrl is dynamically determined based on how the app is built.Logic
When served from a CDN, the resourceUrl is computed based on the file location (
import.meta.url
). This value is injected at build time via a TypeScript custom transformer.Otherwise, it is computed from the document location.
Test Configuration Update:
packages/atomic/vitest.config.ts
: Updated the test configuration to defineimport.meta.env.RESOURCE_URL
.https://coveord.atlassian.net/browse/KIT-3944