Releases: gregberge/svgr
Releases · gregberge/svgr
v6.2.0
v6.1.2
v6.1.1
v6.1.0
v6.0.0
SVGR v6 uses SVGO v2 under the hood and includes tons of improvement. It also contains small breaking changes. In most cases you will have nothing to change. But be sure to check the migration guide.
Bug Fixes
- fix XML entities in generated JavaScript (#553) (b3998eb)
- formatExportName for single names (#548) (5decc94)
- template: make it possible to use type in template (#619) (5966714), closes #556
- webpack: fix webpack 5 behaviour with url-loader (1a8cc98)
Features
- add option to explicitly use named export (#584) (f18ea80)
- add TypeScript declarations to
[@svgr](https://github.com/svgr)/core
(#555) (681303a) - add webpack typescript preset configuration (#573) (16072d4)
- upgrade to svgo v2 (1f107af)
- typescript: types everything (#611) (1666432)
- add "index" option (#607) (4978610)
- cli: allow all CLI options in config (#615) (aa9feb2), closes #570
- support jsxRuntime (#613) (3700aba)
- support mask-type property (#621) (a857bb1), closes #336
- allow to specify icon size (3c0b779), closes #571
- support CSS variables (cbdb47f), closes #582
BREAKING CHANGES
- Config format of SVGO changes & SVGR does not merge SVGO config
- Template has a new format
- core: @svgr/core now exposes { transform } instead of default export
- using --icon as latest arg now requires "--"
v6.0.0-alpha.4
v6.0.0-alpha.3
v6.0.0-alpha.2
v6.0.0-alpha.1
Bug Fixes
Features
BREAKING CHANGES
Templates
Template signature has changed, it is now much more simpler to create custom templates. Also you don't have to do anything specific to use TypeScript in your template. If you need some Babel specific things you have to import it by yourself.
v5.x
const template = (
{ template },
opts,
{ imports, interfaces, componentName, props, jsx, exports }
) => {
const plugins = ["jsx"];
if (opts.typescript) {
plugins.push("typescript");
}
const typeScriptTpl = template.smart({ plugins });
return typeScriptTpl.ast`${imports}
${interfaces}
function ${componentName}(${props}) {
return ${jsx};
}
${exports}
`;
};
module.exports = template;
v6.x
const template = (variables, { tpl }) => {
return tpl`
${variables.imports};
${variables.interfaces};
const ${variables.componentName} = (${variables.props}) => (
${variables.jsx}
);
${variables.exports};
`;
};
module.exports = template;
v6.0.0-alpha.0
Bug Fixes
Features
- add option to explicitly use named export (#584) (f18ea80)
- add TypeScript declarations to
[@svgr](https://github.com/svgr)/core
(#555) (681303a) - add webpack typescript preset configuration (#573) (16072d4)
- upgrade to svgo v2 (1f107af)
BREAKING CHANGES
- config format of SVGO changes & SVGR does not merge SVGO config.