Release 0.12.0


I just tagged a 0.12.0 release for all the prosemirror-* modules. The main new thing is decorations (the replacement for markRange), but a number of other things happened. The demos on the website are fully functional again with this release, and I intend to stabilize this release’s interface towards a 1.0 release. (I.e. only make more breaking changes when there is a really extra super good reason to do so.)

This would be a good time to start porting 0.10.x code forward, since 0.12.0 covers all the features 0.10.x had. The reference docs are complete, the guide docs still aren’t very extensive.

This happened:

Release Notes

prosemirror-model 0.12.0 (2016-10-21)

Breaking changes

Drops support for some undocumented options to the DOM serializer that were used by the view.

Bug fixes

When rendering DOM attributes, only ignore null values, not all falsy values.

prosemirror-transform 0.12.0 (2016-10-21)

Breaking changes

Mapped positions now count as deleted when the token to the side specified by the assoc parameter is deleted, rather than when both tokens around them are deleted. (This is usually what you already wanted anyway.)

prosemirror-state 0.12.0 (2016-10-21)

Breaking changes

The interace to EditorState.toJSON and EditorState.fromJSON has changed.

The way plugins declare their state field has changed. Only one state field per plugin is supported, and state fields no longer have hard-coded names. Plugin.getState is the way to access plugin state now.

Plugin dependencies are no longer supported.

Plugin.reconfigure is gone. Plugins are now always created with new Plugin.

Plugins no longer have a config field.

Bug fixes

Node selections are now properly dropped when mapped over a change that replaces their nodes.

New features

Plugin keys can now be used to find plugins by identity.

Transform actions now have a time field containing the timestamp when the change was made.

prosemirror-view 0.12.0 (2016-10-21)

Breaking changes

The return value of EditorView.posAtCoords changed to contain an inside property pointing at the innermost node that the coordinates are inside of. (Note that the docs for this method were wrong in the previous release.)

Bug fixes

Reduce reliance on shift-state tracking to minimize damage when it gets out of sync.

Fix bug that’d produce bogus document positions for DOM positions inside non-document nodes.

Don’t treat fast ctrl-clicks as double or triple clicks.

New features

Implement decorations, a way to influence the way the document is drawn. Add the decorations prop to specify them.

prosemirror-keymap 0.12.0 (2016-10-21)

Breaking changes

Key names are now based on KeyboardEvent.key instead of .code. This means that, for character-producing keys, you’ll want to use the character typed, not the key name. So Ctrl-Z now means uppercase Z, and you’ll usually want Ctrl-z instead. Single-quoted key names are no longer supported.

prosemirror-history 0.12.0 (2016-10-21)

Breaking changes

The history export is now a function that creates a history plugin, rather than a plugin instance.

New features

Add a newGroupDelay plugin option. This brings back the behavior where pausing between edits will automatically cause the history to put subsequent changes in a new undo event.

prosemirror-commands 0.12.0 (2016-10-21)

Bug fixes

Fix crash when backspacing into nodes with complex content expressions.

prosemirror-schema-basic 0.12.0 (2016-10-21)

Bug fixes

Don’t treat <b style=font-weight: normal> as strong when parsing. (Google Docs puts such ridiculous HTML on the clipboard.)


Decoration. This is a great choice for naming this feat., better than markRange. Thanks for your hard work.


YAY! Will work on my 0.10 -> 0.12 soon.

Note: The link for decoractions above didn’t work for me. works while does not


Awesome! I’ll work on migrating our code base from 0.10 to 0.12 soon :slight_smile:


Hah. Thanks for letting me know. The Date.getMonth-is-zero-based issue bit me again when I generated the release notes. I’ve updated the post, will update the real release notes in a moment.


Same here, will work on porting from 0.10 soon. How stable do you think the json format is? We are discussion whether or not to switch from storing in html, and preferably we won’t switch many more times after the first switch. And how about the json format of the collaboration steps? Have they changed since 0.10?


I don’t think the JSON formats will change again. The format of marks (and thus, documents) was changed since 0.10, but you can do something like this to convert from the old format:

function updateJSONDoc(json) {
  if (json.content) json.content.forEach(updateJSONDoc)
  if (json.marks) json.marks = => {
    let value = {type: mark._, attrs: mark}
    delete value.attrs._
    return value

OK, good to know things seem to stabilize.

Will there also be a porting guide from 0.10 to 0.12? It seems like a lot has changed, including most of the variable and function names and how they work. I think it would help a lot if either @marijn or someone else who has done the conversion already could write a guide so we don’t all have to relearn everything from zero.

I can try to help, but given that we really have everything major we need in the 0.10 version, it may take me some time to get through the conversion.