remirror v0.4.0 Release Notes

Release Date: 2019-07-22 // almost 5 years ago
  • โž• Added

    • ๐Ÿš€ @remirror/extension-collaboration: Collaboration library added based on the brilliant example available in tiptap.
    • ๐Ÿš€ @remirror/extension-mention: Mentions can now be picked up from pasting data.
    • ๐Ÿš€ @remirror/extension-code-block: Add commands toggleCodeBlock, createCodeBlock, updateCodeBlock and formatCodeBlock, add keymap support for formatting, add backspace support for better navigation and other features.
    • @remirror/core: Add CommandNodeTypeParams, CommandMarkTypeParams, CommandTypeParams which is now passed to the commands method for extensions.
    • โš  @remirror/react-utils, @remirror/react: Add suppressHydrationWarning prop to Remirror component. Set to true to ignore the hydration warning for a mismatch between the server and client content.
    • @remirror/core: Add new extensionData method to the ExtensionManager which allows the extension to provide data on every transaction which will be available for consumption in the renderProp, React Context hooks and HOC's.
    • @remirror/core: Add getActions to the params of all extension manager methods. This will throw an error if called before initialization.
    • ๐Ÿ‘€ @remirror/core: Allow extensions to override baseExtension in the RemirrorManager component.
    • ๐Ÿ”ง @remirror/core: Add ensureTrailingParagraph as a configuration option for the paragraph node. In some scenarios, it is difficult to place a cursor after the last element. This ensures there's always space to select the position afterwards and fixes a whole range of issues. It defaults to false otherwise it breaks a lot of tests.
    • jest-prosemirror: Enable editorViewOptions for the createEditor method. For example, now it is possible to intercept transactions with the dispatchTransaction hook.
    • @remirror/renderer-react: Pass extension options through to SSR components as a prop.

    • โž• Add internal modifier key functions for puppeteer testing.

    • โž• Add integration editor tests for the Wysiwyg editor.

    ๐Ÿ”„ Changed

    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/core: Change the way commands are configured. The command function on extensions now only accepts an object with the command names being globally unique. For example, the heading extension used to return a function now it returns an object with the following signature.
    {
      toggleHeading(attrs?: Attrs<{level: number}>): CommandFunction;
    }
    

    This command can now be accessed via actions.toggleHeading({ level: 2 })

    This is a large breaking change and may cause a lot of your existing code to stop working ๐Ÿ˜ข. ๐Ÿ‘ However, it paves the way for a better development experience, a simpler to manage library and some exciting features using type inference. Please do bear with me as I make these changes. I truly believe they'll be worthwhile.

    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/core: Change usage isEnabled and isActive which are now methods on the command. e.g. actions.toggleHeading.isEnabled() would check whether the toggle heading button can be used at this moment.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/core: Change Extension function signature actions of active and enabled.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/core: Rename getEditorState to getState.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/core: Change method getPortalContainer to property portalContainer on the extension manager.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/extension-mention: Complete rewrite of internals and public API with better tests and more robust editing.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/extension-mention: Change MentionExtension from NodeType to MarkType. Text is now editable after a mention is created.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/react: Rename setChildAsRoot to childAsRoot on RemirrorContextProviderProps and all it consumers. This affects the RemirrorContextProvider, RemirrorProvider and ManagedRemirrorProvider exports. The prop now can take a boolean or the object with props to inject into the root.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/react: All RemirrorProviders now require a children prop. This prevents a bug when rendering in non-dom environments.
    • ๐Ÿ’ฅ ๐Ÿ’ฅ BREAKING @remirror/react: dispatchTransaction has been renamed to onDispatchTransaction. It now must return a transaction and can be used to edit the transaction that will be used to create a new state.

    • ๐Ÿ› @remirror/core: Fix bug with extension manager failing to provide attributes from the extensions.

    • ๐Ÿ› @remirror/core: Fix TypeScript type of SSRComponent. Change from Component to ComponentType.

    • ๐Ÿ› @remirror/editor-twitter: Fix bug where text area didn't expand to the full height of editor container.

    • ๐Ÿ› @remirror/editor-wysiwyg: Fix bug where positioner was causing the editor to take up 10000 px in height.