Release 0.15.0

#1

Only two weeks after 0.14.0! Things are really starting to feel stable… which I guess is about time.

The main change in this release is that a bunch more things (typing, in-textblock backspacing) are left to the browser, and ProseMirror takes care not to re-render content when it doesn’t have to. Which goes exactly against the original concept of ProseMirror (‘never trust the browser, we’ll do it ourselves’), but more and more issues came up where browser or platform features, such as spell-check, long-press to type character variants on OS, double-space for a period on iOS, were broken because the browser and/or the OS didn’t realize what was going on.

So for relatively uncontroversial functionality (there’s not too much disagreement on what should happen to your document when you type a character), the editor now takes a hands-off approach. This is not without danger, and is likely going to cause some new bugs and issues, but I feel it’s a more promising route than continuing to throw up my hands and say ‘nothing I can do’ for the various broken native editing features.

Release Notes

prosemirror-model 0.15.0 (2016-12-10)

Breaking changes

ResolvedPos.atNodeBoundary is deprecated and will be removed in the next release. Use textOffset > 0 instead.

New features

Parse rules associated with a schema can now specify a priority to influence the order in which they are applied.

Resolved positions have a new getter textOffset to find their position within a text node (if any).

prosemirror-transform 0.15.0 (2016-12-10)

Bug fixes

Fix bug where pasted/inserted content would sometimes get incorrectly closed at the right side.

prosemirror-state 0.15.0 (2016-12-10)

Breaking changes

Selection actions no longer scroll the new selection into view by default (they never were supposed to, but due to a bug they did). Add a scrollIntoView property to the action to get this behavior.

prosemirror-view 0.15.0 (2016-12-10)

Breaking changes

The editor view no longer wraps its editable DOM element in a wrapper element. The ProseMirror CSS class now applies directly to the editable element. The ProseMirror-content CSS class is still present for ease of upgrading but will be dropped in the next release.

The editor view no longer draws a drop cursor when dragging content over the editor. The new prosemirror-dropcursor module implements this as a plugin.

Bug fixes

Simple typing and backspacing now gets handled by the browser without ProseMirror redrawing the touched nodes, making spell-checking and various platform-specific input tricks (long-press on OS X, double space on iOS) work in the editor.

Improve tracking of DOM nodes that have been touched by user changes, so that updateState can reliably fix them.

Changes to the document that happen while dragging editor content no longer break moving of the content.

Adding or removing a mark directly in the DOM (for example with the bold/italic buttons in iOS’ context menu) now produces mark steps, rather than replace steps.

Pressing backspace at the start of a paragraph on Android now allows key handlers for backspace to fire.

Toggling a mark when there is no selection now works better on mobile platforms.

New features

Introduces an endOfTextblock method on views, which can be used to find out in a bidi- and layout-aware way whether the selection is on the edge of a textblock.

prosemirror-commands 0.15.0 (2016-12-10)

Breaking changes

Drops suppport for delete(Char|Word)(Before|After) and move(Back|For)ward, since we are now letting the browser handle those natively.

Bug fixes

The joinForward and joinBackward commands can now strip out markup and nodes that aren’t allowed in the joined node.

New features

A new command exitCode allows a user to exit a code block by creating a new paragraph below it.

The joinForward and joinBackward commands now use a bidirectional-text-aware way to determine whether the cursor is at the proper side of its parent textblock when they are passed a view.

#2

Great release! I’m really close to finishing our transition to the latest version and am looking forward to 1.0 :slight_smile: (in production we’re still on 0.10, but I’ve been keeping a dev branch in sync with master for some time now).

Oh, and it looks like you have pasted the release notes twice.

#3

Woops. Doing releases late at night is asking for trouble. Fixed now.

#4

If you don’t mind a bug report here I noticed the following:

  • http://prosemirror.net/
  • drag&drop the owl image into the editor
  • cursor is now invisible until you blur and focus the editor

Edit: Forgot to double-check between browsers. This happens in Firefox, but Opera and Edge look like they work normally.

#5

Congrats on the release! :confetti_ball:

The main change in this release is that a bunch more things (typing, in-textblock backspacing) are left to the browser, and ProseMirror takes care not to re-render content when it doesn’t have to.

Can you point to any expand on the general process here a bit more, or point to an example in code where the browser mutates content and ProseMirror updates afterwards?

#6

The editor still has its own conception of what the DOM should look like for a given document. For simple text changes, that will often match what the browser did, so it doesn’t have to do anything. But if you add or remove marks, for example, it’ll end up adjusting the DOM, or if you press backspace on Android, where we can’t capture the keydown event because none is fired, you’ll get the native behavior first, which is then fixed up by ProseMirror.

#7

@typicalprosemiruser I wasn’t able to reproduce what you describe, though I did run into another issue with drag/drop on Firefox (reported here, still looking for a workaround). In general, if you run into problems, please open issues on the issue tracker.