You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorporate asset-map service/helper duo adapter - #716
In order to deprecate ember-cli-ifa, which does too many things at build-time while being an addon (which doesn't fit very well w/ migration to Vite), this PR introduces a:
an asset-map service/helper duo
a build-time function allowing consumer apps to intentionally opt-in to the behaviour ember-cli-ifa brought
ember-cli-ifa was used to make our lives easier when using assets with dynamically built paths (e.g: @upfluence/oss-components/assets/${someVariable}.svg).
We use the exact same helper/service names as exported by ember-cli-ifa (asset-map) so we have drop-in replacement inside our runtime code, and we just have to update the apps' ember-cli-build.js file.
What are the observable changes?
Warning
This is a transition tooling
In an ideal and modern world, we would just do import mySvgFile from './my-svg-file.svg and > use it in components.
And in case of dynamic asset, we would import them all, then in the code handle the conditions to return the right ones, opening the door for tree-shaking to avoid publishing unused assets to consumers.
Until we reach that stage, this PR unlocks some improvements while allowing to work as usual.
Good PR checklist
Title makes sense
Is against the correct branch
Only addresses one issue
Properly assigned
Added/updated tests
Added/updated documentation with Figma design link. Don't forget to replace "design" by "file" in the URL. For example https://www.figma.com/file/example
This shortcut skips a valid fingerprint mapping when a logical path overlaps the consumer's base path. With rootURL: '/assets/' and assets/logo.svg → assets/logo-123.svg, resolving /assets/logo.svg returns the unhashed input, while assets/logo.svg resolves to /assets/assets/logo-123.svg. This breaks leading-slash normalization and can request a file removed by fingerprinting. Only apply this shortcut when the normalized name is not a manifest key, and add a regression test for this overlap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
In order to deprecate ember-cli-ifa, which does too many things at build-time while being an addon (which doesn't fit very well w/ migration to Vite), this PR introduces a:
ember-cli-ifa was used to make our lives easier when using assets with dynamically built paths (e.g:
@upfluence/oss-components/assets/${someVariable}.svg).We use the exact same helper/service names as exported by ember-cli-ifa (asset-map) so we have drop-in replacement inside our runtime code, and we just have to update the apps'
ember-cli-build.jsfile.What are the observable changes?
Warning
This is a transition tooling
In an ideal and modern world, we would just do
import mySvgFile from './my-svg-file.svgand > use it in components.And in case of dynamic asset, we would import them all, then in the code handle the conditions to return the right ones, opening the door for tree-shaking to avoid publishing unused assets to consumers.
Until we reach that stage, this PR unlocks some improvements while allowing to work as usual.
Good PR checklist