Skip to content

Add ESM Import Compatibility #660

@evanplaice

Description

@evanplaice

ESM is coming. It is already supported in most browsers and is coming to Node 1.

With that said, there are few libraries that have native support for it yet. As far as Markdown parsers go:

  • markdown-it is very heavily invested in CommonJS, ESM support will likely never happen there
  • marked - had a contributor implement ESM support and the maintainers rejected the PR
  • remark - also heavily invested in CommonJS
  • markdown-js - looks like it's no longer being maintained

Long-story-short, unless somebody starts a 'clean room' implementation of a Markdown parser in ES this is going to be a pain point for FE devs working in native ESM.

I've been experimenting a bit and managed to create a PR that adds support with very minimal impact on the existing codebase.

1 I'm a participant on the Node/Modules work group. If all goes well, we may see unflagged support before the end of the year.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions