Skip to content

Releases: gregberge/svgr

v6.2.0

10 Jan 08:17
ba84ff5
Compare
Choose a tag to compare

Bug Fixes

  • cli: pass in parser to prettier format to avoid deprecation warning (#662) (74fa3ae)
  • plugin-svgo: handle potential errors from optimize (#663) (7582d31)

Features

v6.1.2

12 Dec 14:27
3991389
Compare
Choose a tag to compare

Bug Fixes

  • specify valid peer deps (45a76ed)
  • rollup: missing dep & missing map return (#652) (12627fc)

v6.1.1

04 Dec 20:59
214564c
Compare
Choose a tag to compare

Bug Fixes

v6.1.0

01 Dec 21:50
2536e19
Compare
Choose a tag to compare

Bug Fixes

Features

  • native: automatically convert inline style in native (138c493), closes #588

Performance Improvements

  • remove useless loader-utils package (387bc72), closes #631

v6.0.0

28 Nov 22:16
af9a6cb
Compare
Choose a tag to compare

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

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

13 Nov 08:41
a5effba
Compare
Choose a tag to compare
v6.0.0-alpha.4 Pre-release
Pre-release

Features

BREAKING CHANGES

  • using --icon as latest arg now requires "--"

v6.0.0-alpha.3

12 Nov 08:44
261e1b5
Compare
Choose a tag to compare
v6.0.0-alpha.3 Pre-release
Pre-release

Bug Fixes

  • template: make it possible to use type in template (#619) (5966714), closes #556
  • webpack: fix webpack 5 behaviour with url-loader (1a8cc98)

Code Refactoring

Features

BREAKING CHANGES

  • core: @svgr/core now exposes { transform } instead of default export.

v6.0.0-alpha.2

12 Nov 08:46
f729efa
Compare
Choose a tag to compare
v6.0.0-alpha.2 Pre-release
Pre-release

Features

v6.0.0-alpha.1

31 Oct 08:58
22e2736
Compare
Choose a tag to compare
v6.0.0-alpha.1 Pre-release
Pre-release

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

24 Sep 21:55
4ab46a3
Compare
Choose a tag to compare
v6.0.0-alpha.0 Pre-release
Pre-release

Bug Fixes

  • fix XML entities in generated JavaScript (#553) (b3998eb)

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.