Hi all. I’ve released version 0.17.0 of ProseMirror. I had the chance to do some work on real-world editors for customers in the past weeks, and that led to a number of bugfixes and tweaks to improve various small issues I ran into. But the main change in this release is the new transaction system.
You can see the relevant discussion here, but the short of it is that Redux-style actions, the way we had them, were a poor fit for the pluggable state representation in ProseMirror, and the system has moved to a more structured representation of state updates, which it calls a
Transaction, and which is pretty much the old
EditorTransform plus a few extra properties and methods to represent updates to other state fields, and to store custom metadata for use by plugins.
As always, you can find the new modules on NPM. Here are the release notes:
prosemirror-model 0.17.0 (2017-01-05)
Node.marksAt was replaced with
ResolvedPos.marks. It still works (with a warning) in this release, but will be removed in the next one.
prosemirror-state 0.17.0 (2017-01-05)
EditorTransform class was renamed
Transaction, and extended to allow changing the set of stored marks and attaching custom metadata.
Plugins now accept a
filterTransaction option that can be used to filter out transactions as they come in.
Plugins also got an
appendTransaction option making it possible to follow up transactions with another transaction.
prosemirror-view 0.17.0 (2017-01-05)
handleDOMEvent prop has been dropped in favor of the
handleDOMEvents (plural) prop.
onChange prop has been replaced by a
dispatchTransaction prop (which takes a transaction instead of an action).
Added support for a
handleDOMEvents prop, which allows you to provide handler functions per DOM event, and works even for events that the editor doesn’t normally add a handler for.
Add view method
dispatch, which provides a convenient way to dispatch transactions.
dispatchTransaction (used to be
onAction) prop is now optional, and will default to simply applying the transaction to the current view state.
Widget decorations now accept an option
associative which can be used to configure on which side of content inserted at their position they end up.
Typing immediately after deleting text now preserves the marks of the deleted text.
Transactions that update the selection because of mouse or touch input now get a metadata property
pointer with the value
prosemirror-commands 0.17.0 (2017-01-05)
dispatch function passed to commands is now passed a
Transaction, not an action object.