-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from evoactivity/embroider-issues
Update asset inlining strategy
- Loading branch information
Showing
12 changed files
with
4,096 additions
and
3,504 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
pull_request: | ||
|
||
env: | ||
NODE_VERSION: '14' | ||
NODE_VERSION: '16' | ||
|
||
jobs: | ||
lint_and_test: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ on: | |
pull_request: | ||
|
||
env: | ||
NODE_VERSION: '14' | ||
NODE_VERSION: '16' | ||
|
||
jobs: | ||
lint: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,3 +118,4 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
yarn.lock.* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import makeSVG from 'ember-svg-jar/utils/make-svg'; | ||
import assets from '../inlined'; | ||
|
||
function getInlineAsset(assetId) { | ||
try { | ||
return assets[assetId]().default; | ||
} catch (err) { | ||
return null; | ||
} | ||
} | ||
|
||
export function svgJar(assetId, svgAttrs) { | ||
return makeSVG(assetId, svgAttrs, getInlineAsset); | ||
} | ||
|
||
export default helper(function svgJarHelper([assetId], svgAttrs) { | ||
return svgJar(assetId, svgAttrs); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
import { helper } from '@ember/component/helper'; | ||
import makeSVG from 'ember-svg-jar/utils/make-svg'; | ||
|
||
function getInlineAsset(assetId) { | ||
try { | ||
/* eslint-disable global-require */ | ||
return require(`ember-svg-jar/inlined/${assetId}`).default; | ||
} catch (err) { | ||
return null; | ||
} | ||
} | ||
|
||
export function svgJar(assetId, svgAttrs) { | ||
return makeSVG(assetId, svgAttrs, getInlineAsset); | ||
} | ||
|
||
export default helper(function svgJarHelper([assetId], svgAttrs) { | ||
return svgJar(assetId, svgAttrs); | ||
}); | ||
export { default, svgJar } from 'ember-svg-jar/helpers/svg-jar'; |
This file contains 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
This file contains 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
This file contains 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
6 changes: 4 additions & 2 deletions
6
packages/ember-svg-jar/tests/acceptance/symbols-loader-test.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Oops, something went wrong.