
Product
Go Support Is Now Generally Available
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
2.0.0 (2018-06-12)
SVGR now supports Prettier (.prettierc
) and SVGO (.svgo.yml
) configurations. It also supports a new .svgrrc
configuration. See the readme for more detail.
Rollup has now an official SVGR plugin available under @svgr/rollup
.
SVGR is now an ecosystem of four modules:
@svgr/core
: Core of SVGR, it exposes the Node API@svgr/cli
: Command Line Interface@svgr/webpack
: webpack loader@svgr/rollup
: a fresh new Rollup pluginsvgAttributes
and titleProp
optionsTwo new options appears, the first one svgAttributes
gives you the opportunity to add attribute on the root svg
tag without creating a custom template:
Command:
svgr --svg-attributes focusable=true foo.svg
Output:
;(props) => <svg focusable="false" />
The second one, titleProp
, adds a custom property title
to specify the title of the SVG.
Command:
svgr --title-prop foo.svg
Output:
;({ title }) => (
<svg>
<title>{title}</title>
</svg>
)
Node v6 support has been dropped, you need Node >= 8 to run SVGR.
All Prettier options have been removed:
jsx-bracket-same-line
no-bracket-spacing
no-semi
single-quote
tab-width
trailing-comma
use-tabs
If you used it, use a .prettierrc
instead of use the new option --prettier-config
:
v1.x:
svgr --no-semi file.svg
v2.x:
svgr --prettier-config '{"semi": true}' file.svg
All SVGO options have been removed:
ids
keep-useless-defs
no-title
no-view-box
precision
If you used it, use a .svgo.yml
instead of use the new option --svgo-config
:
v1.x:
svgr --ids file.svg
v2.x:
svgr --svgo-config '{"plugins": [{"cleanupIDs": {"remove": false, "minify": false}}]}' file.svg
replace-attr-value
has been renamed into replace-attr-values
In API, replaceAttrValues
is now an object instead of an array.
rawConvert
method has been droppedcode
, config
and state
componentName
must now be passed in stateThanks to @MarquesDev and @lifeiscontent.
<a name="1.10.0"></a>
FAQs
Convert raw SVG into React components.
The npm package svgr receives a total of 1,361 weekly downloads. As such, svgr popularity was classified as popular.
We found that svgr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
Security News
vlt adds real-time security selectors powered by Socket, enabling developers to query and analyze package risks directly in their dependency graph.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.