Release 0.19.0

I’ve just tagged ProseMirror version 0.19.0. This release mostly contains a number of bugfixes and minor tweaks that came up in the process of trying to implement some difficult use cases.

The only potentially disruptive change is that selections work somewhat differently—they always have a head and anchor now, so if you’re checking for those properties to determine whether something is a text selection, you have to stop doing that. In general, it is now possible to write custom selection subclasses and set those as the editor selection, so code shouldn’t assume that a selection must be either a node or a text selection. The JSON representation of selections changed to be able to handle custom selections, but the old JSON format will continue to be accepted by fromJSON.

I invite you to consider this and subsequent releases betas for 1.0. Though small incremental improvements in response to problems that people run into are likely to continue, I’m not going to do anything radical to the API anymore and will start preferring backwards-compatibility over elegance (i.e. better to leave a wart than to force people to change their code again).

Enjoy!

Release Notes

prosemirror-model 0.19.0 (2017-03-16)

Breaking changes

MarkSpec.inclusiveRight was replaced by inclusive, which behaves slightly differently. inclusiveRight will be interpreted as inclusive (with a warning) until the next release.

New features

The new inlineContent property on nodes and node types tells you whether a node type supports inline content.

MarkSpec.inclusive can now be used to control whether content inserted at the boundary of a mark receives that mark.

Parse rule context restrictions can now use node groups, not just node names, to specify valid context.

prosemirror-state 0.19.0 (2017-03-16)

Breaking changes

Selection.between is now called TextSelection.between, and only returns text selections.

The JSON representation of selections changed. fromJSON will continue to understand the old representation, but if your own code touches the JSON data, you’ll have to adjust it.

All Selection objects now have $head/$anchor properties, so those can no longer be used to recognize text selections (use $cursor or instanceof).

New features

It is now possible to write your own Selection subclasses and set the editor selection to an instance of them (provided you implement all required methods and register them with Selection.jsonID).

Text selections now have a $cursor getter which returns a position only if this is a cursor selection.

The new Transaction.ensureMarks method makes it easier to ensure given set of active marks without needlessly setting storedMarks.

prosemirror-view 0.19.0 (2017-03-16)

Breaking changes

endOfTextblock no longer always returns false for horizontal motion on non-cursor selections, but checks the position of the selection head instead.

Bug fixes

Typing after adding/removing a mark no longer briefly shows the new text with the wrong marks.

posAtCoords is now more reliable on modern browsers by using browser APIs.

Fix a bug where the view would in some circumstances leave superfluous DOM nodes around inside marks.

New features

You can now override the selection the editor creates for a given DOM selection with the createSelectionBetween prop.

prosemirror-history 0.19.0 (2017-03-16)

New features

A new function closeHistory can be used to force separation of history events at the start of a given transaction.

prosemirror-collab 0.19.0 (2017-03-16)

New features

You can now use strings (as well as numbers) as client IDs (this already worked, but now the documentation reflects this).

prosemirror-commands 0.19.0 (2017-03-16)

Bug fixes

Calling joinBackward at the start of a node that can’t be joined no longer raises an error.

prosemirror-schema-basic 0.19.0 (2017-03-16)

Breaking changes

Link marks are now non-inclusive by default.

1 Like

thx

Didn’t you also make menubar a plugin ? it’s a breaking change, MenuBarEditorView need to be changed to EditorView …

(also did you notice https://github.com/ProseMirror/prosemirror-menu/pull/9 ?)

There seems to be a (new?) bug with turning marks off

in basic demo hit bold start typing and try to hit the button again to turn bold off (before pressing newline) - it stays on

Yeah, but the menu module isn’t part of the core set of modules so my changelog generator doesn’t pick it up. Still, that’s probably good to mention here:

The MenuBarEditorView class was replaced by a menuBar addon.

Thanks for pointing that out. Fixed in prosemirror-state 0.19.1.

great

I can’t bring 0.19.1 via npm update, is it there ?

A request, can we have it so that the github package.json points main to the src directory and only the npm have main pointing to dist ?

This will make it easy to work with the github heads in general

thx!

Yes: https://www.npmjs.com/package/prosemirror-state

No. But you can symlink dist to src if you want (the command-line tool in the prosemirror repository has a pm link-src command to do this in all modules).

strange, npm update didn’t bring it, I had to remove and reinstall

cool, I’ll try

YAY!! This upgrade went very smooth, love the deprecation warnings!

I 100% have no regrets starting with this project when I did but it definitely came with a few week+ upgrades where I had to explain to my non-tech cofounder that YES, we absolutely want to stay on latest versions. It’s nice to no longer fear new releases :slight_smile:

I don’t think I really knew about context. I don’t have a use for it yet, just wanted to say it is awesome! I really like how schema has shaped up. Powerful stuff!

Cheers & thanks again for the hard work!