# Migrate to ES6 modules?

**URL:** <https://discuss.prosemirror.net/t/migrate-to-es6-modules/335>\
**Category:** Uncategorized\
**Created:** [June 14, 2016, 4:01pm UTC](https://discuss.prosemirror.net/t/migrate-to-es6-modules/335 "2016-06-14T16:01:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lessless](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/lessless/32/154_2.png) [@lessless](https://discuss.prosemirror.net/u/lessless)\
**Post date:** [June 14, 2016, 4:01pm UTC](https://discuss.prosemirror.net/t/migrate-to-es6-modules/335/1 "2016-06-14T16:01:39Z")

</div>

Hello,

I know that they’re not implemented natively yet, but due to the fact that PM already using Babel, can we consider to migrate from AMD to ES6 modules?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [June 14, 2016, 6:45pm UTC](https://discuss.prosemirror.net/t/migrate-to-es6-modules/335/2 "2016-06-14T18:45:58Z")

</div>

I just migrated the other way – 0.7.0 uses ES6 modules, but 0.8.0 will be CommonJS, because it means we can run the code without compilation step on modern platforms, which greatly streamlines development. Once browsers implement `<script type=module>`, I’ll change back.

---

<div class="post-metadata">

**Author:** ![johanneswilm](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/johanneswilm/32/19_2.png) [@johanneswilm](https://discuss.prosemirror.net/u/johanneswilm)\
**Post date:** [June 14, 2016, 7:37pm UTC](https://discuss.prosemirror.net/t/migrate-to-es6-modules/335/3 "2016-06-14T19:37:13Z")

</div>

As long as you change back once they start being available natively, it’s ok for FW.

I had previously mildly protested this switch because for me it means that I have to explain to developers who are new to JavaScript modules (and to remember myself) how two different import/module systems work. Even though there doesn’t seem to be any difficulty combining our ES6 modules with CommonJS modules in PM as long as everything is transpiled, I generally end up having to study PM code quite a bit.

But I can see that it is a major advantage for your development setup, and it’s not that big a deal for us at least. I just hope the day of ES6 module support in browsers comes sooner rather than later.
