Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@TrySound TrySound released this 07 Aug 10:07
· 9 commits to master since this release

This major bump mostly improves and simplifies distribution.

  • source code is converted to esm
  • lib is not longer published to hide internals and allow us safely change them
  • we started to use rollup to provide umd, cjs and esm bundles
  • bower support is removed as not relevant these days
  • autolinker is upgraded so you should not get old vulnerabilities

To make esm/cjs interop safe we migrated to named exports in public api

- import Remarkable from 'remarkable';
- const utils = Remarkable.utils;
+ import { Remarkable, utils } from 'remarkable';
- const Remarkable = require('remarkable');
- const utils = Remarkable.utils;
+ const { Remarkable, utils } = require('remarkable');
- const Remarkable = window.Remarkable;
- const utils = Remarkable.utils;
+ // note: window namespace is lowercased
+ const { Remarkable, utils } = window.remarkable;

In order is reduce bundle size for browser builds linkify option is decoupled into own plugin

- import Remarkable from 'remarkable';
- new Remarkable({ html: true, linkify: true })
+ import { Remarkable } from 'remarkable';
+ import { linkify } from 'remarkable/linkify';
+ new Remarkable({ html: true }).use(linkify);

For the same reason we ditched large generated entities list in favour of dom trick in browser build.

Checkout bundlephobia to see results we achieved