Skip to content

Recent port of ProseMirror to TypeScript and ProseMirror version bumps (hours ago) break TipTap #2836

Description

@tgv1975

What’s the bug you are facing?

ProseMirror has been recently ported to TypeScript, and a few hours ago ProseMirror lib versions have been bumped.

Due to TipTap not using fixed dependency versions (for example, in core), when doing a clean install of TipTap now, the new ProseMirror libs are used, and they are incompatible with TipTap on the TypeScript side.

For example, when compiling something that uses TipTap, I now get typing errors like:

ERROR: node_modules/@tiptap/core/dist/packages/core/src/Editor.d.ts:95:39 - error TS2315: Type 'Transaction' is not generic.

95     captureTransaction(fn: Function): Transaction<any> | null;

node_modules/@tiptap/core/dist/packages/core/src/NodeView.d.ts:18:9 - error TS2416: Property 'contentDOM' in type 'NodeView<Component, Editor, Options>' is not assignable to the same property in base type 'NodeView'.
  Type 'Element' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 111 more.

18     get contentDOM(): Element | null;

node_modules/@tiptap/core/dist/packages/core/src/helpers/findParentNode.d.ts:8:11 - error TS2315: Type 'Node' is not generic.

8     node: import("prosemirror-model").Node<any>;

node_modules/@tiptap/extension-bubble-menu/dist/packages/extension-bubble-menu/src/bubble-menu-plugin.d.ts:43:76 - error TS2707: Generic type 'Plugin<PluginState>' requires between 0 and 1 type arguments.

43 export declare const BubbleMenuPlugin: (options: BubbleMenuPluginProps) => Plugin<any, any>;

node_modules/@tiptap/extension-table/dist/packages/extension-table/src/utilities/createTable.d.ts:2:129 - error TS2315: Type 'Fragment' is not generic.

2 export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode;

node_modules/@tiptap/extension-table/dist/packages/extension-table/src/utilities/createTable.d.ts:2:148 - error TS2315: Type 'Node' is not generic.

2 export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode;


node_modules/@tiptap/extension-table/dist/packages/extension-table/src/utilities/createTable.d.ts:2:180 - error TS2315: Type 'Node' is not generic.

2 export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode;

Here's a screenshot which is perhaps more readable than the above dump:

image

This makes a fresh TipTap install completely unusable, for both new users, and existing users who refresh their node_modules.

Which browser was this experienced in? Are any special extensions installed?

Not a browser issue, this pertains to the installation/transpilation phase.

How can we reproduce the bug on our side?

Do a fresh install of TipTap. I'm using these:

"@tiptap/core": "2.0.0-beta.176",
"@tiptap/extension-blockquote": "2.0.0-beta.26",
"@tiptap/extension-bubble-menu": "2.0.0-beta.56",
"@tiptap/extension-bullet-list": "2.0.0-beta.26",
"@tiptap/extension-color": "2.0.0-beta.9",
"@tiptap/extension-gapcursor": "2.0.0-beta.34",
"@tiptap/extension-hard-break": "2.0.0-beta.30",
"@tiptap/extension-highlight": "2.0.0-beta.33",
"@tiptap/extension-horizontal-rule": "2.0.0-beta.31",
"@tiptap/extension-image": "2.0.0-beta.27",
"@tiptap/extension-link": "2.0.0-beta.38",
"@tiptap/extension-list-item": "2.0.0-beta.20",
"@tiptap/extension-ordered-list": "2.0.0-beta.27",
"@tiptap/extension-placeholder": "2.0.0-beta.48",
"@tiptap/extension-subscript": "2.0.0-beta.10",
"@tiptap/extension-superscript": "2.0.0-beta.10",
"@tiptap/extension-table": "2.0.0-beta.49",
"@tiptap/extension-table-cell": "2.0.0-beta.20",
"@tiptap/extension-table-header": "2.0.0-beta.22",
"@tiptap/extension-table-row": "2.0.0-beta.19",
"@tiptap/extension-text-align": "2.0.0-beta.29",
"@tiptap/extension-text-style": "2.0.0-beta.23",
"@tiptap/extension-underline": "2.0.0-beta.23",
"@tiptap/starter-kit": "2.0.0-beta.185",

Then, instantiate an editor, and transpile that code.

Can you provide a CodeSandbox?

N/A

What did you expect to happen?

A normal transpilation of the code using TipTap.

Anything to add? (optional)

I believe the quick solution to this is to set all ProseMirror dependencies to the last working fixed versions, thus reverting to normal, until there is time for TipTap to catch up with the ProseMirror TypeScript port. The latter will likely take a long time, during which TipTap installs are essentially unusable.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions