Skip to content

v3.0.0

Compare
Choose a tag to compare
@jonkoops jonkoops released this 31 Jan 10:17
· 32 commits to main since this release

New Features ✨

  • Package is now distributed in the ECMAScript module syntax (see #36).
  • Definitions for TypeScript are now included out of the box (see #37).

Enhancements 📝

  • The the NPM package only includes the production files (see #23).

Breaking Changes 💥

  • Support for Bower has been dropped, use NPM or another package manager instead.
  • Some functions that were already marked as private are now no longer available (see #37).
  • Support for CommonJS modules has been dropped, use the ES module import instead (see migration guide).
  • The default export has been changed to a named export (see migration guide).

Migration 🚚

Use the new import

Previously when importing a default export would be provided with methods attached to it, this has been replaced with a named one.

This means the following code:

const template = require('url-template');
const emailUrlTemplate = template.parse('/{email}/{folder}/{id}');

Will become:

import { parseTemplate } from 'url-template';
const emailUrlTemplate = parseTemplate('/{email}/{folder}/{id}');

TypeScript

If you are a user of TypeScript you can remove @types/url-template from your project. The type definitions are now included in the package itself, so it is no longer required to keep a separate dependency around.

npm uninstall @types/url-template