Skip to content

chore: migrate to new versions of prosemirror packages - #2854

Merged
bdbch merged 14 commits into
mainfrom
prosemirror-ts-update
Jun 20, 2022
Merged

bdbch merged 14 commits into
mainfrom
prosemirror-ts-update

Conversation

@bdbch

@bdbch bdbch commented Jun 7, 2022

Copy link
Copy Markdown
Member

Since Prosemirror switched to Typescript in their new version Tiptap was broken on a fresh install because of a non-fixed version requiring a workaround via overrides. See this issue: #2836

In this PR I'm working on a fix for that to migrate to the new prosemirror versions by default.

@netlify

netlify Bot commented Jun 7, 2022 •

Copy link
Copy Markdown

✅ Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 75740d3
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/62b04011aa8c740392b7cf99
😎 Deploy Preview https://deploy-preview-2854--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@bdbch

bdbch commented Jun 7, 2022

Copy link
Copy Markdown
Member Author

Because of this upgrade, the tables package is broken for now.
See: ProseMirror/prosemirror-tables#96

I'll see if I can find a fix - otherwise will revert the tables package back to a version that still works.

@bdbch
bdbch marked this pull request as ready for review June 17, 2022 19:24
@bdbch bdbch changed the title WIP: chore: migrate to new versions of prosemirror packages chore: migrate to new versions of prosemirror packages Jun 20, 2022
@bdbch
bdbch merged commit 1ebc8f8 into main Jun 20, 2022
@bdbch
bdbch deleted the prosemirror-ts-update branch June 20, 2022 09:45
@anton-liubushkin

Copy link
Copy Markdown
Contributor

🔥

"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.23.6"
"lowlight": "^1.20.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bdbch!

I’m trying to upgrade tiptap packages in our application, and I noticed that in the latest released version of code-block-lowlight declares the lowlight package as a dependency and a peerDependency: https://unpkg.com/browse/@tiptap/extension-code-block-lowlight@2.0.0-beta.72/package.json

This is not the case in the master branch: https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code-block-lowlight/package.json#L25.

What I find confusing is that part of the changes that I submitted in the PR that moves lowlight to a peerDependency are also included in the latest released version, which differs from what exists in the master branch.

Why is the package.json file different in the master branch and the released package?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats weird, could you bring this up in an issue so we can track it? I'd like to look into where this dependency is coming from.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick response @bdbch 🙇🏼. I created the issue: #2915

@rootlinux2

Copy link
Copy Markdown

Any advance here?

@iamursky

Copy link
Copy Markdown

Any advance here?

Upgrade your dependencies.

@bdbch

bdbch commented Jun 22, 2022

Copy link
Copy Markdown
Member Author

This is already merged @rootlinux2 the problem you described is coming from the prosemirror-tables package. I'll fork it and work on it to make it work with cjs / require syntax.

@rootlinux2

Copy link
Copy Markdown

@bdbch, @Amursky
I updated tip-tap to the latest versions

image

but I'm still facing this error!

Error: Must use import to load ES Module: /home/rootlinux2/Documents/Front10/apexedge-widgets/node_modules/prosemirror-tables-contently/dist/index.js
require() of ES modules is not supported.
require() of /home/rootlinux2/Documents/Front10/apexedge-widgets/node_modules/prosemirror-tables-contently/dist/index.js from /home/rootlinux2/Documents/Front10/apexedge-widgets/node_modules/@tiptap/extension-table/dist/tiptap-extension-table.cjs.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/rootlinux2/Documents/Front10/apexedge-widgets/node_modules/prosemirror-tables-contently/package.json.

@bdbch

bdbch commented Jun 24, 2022

Copy link
Copy Markdown
Member Author

Hey @rootlinux2 we'll publish a new release ASAP. I'll let you know.

@kivikakk kivikakk mentioned this pull request Aug 16, 2022
2 tasks done
andrewlu0 pushed a commit to trybaseplate/tiptap that referenced this pull request Oct 20, 2023
* refactor: upgrade prosemirror packages to new typescript versions

* refactor: migrate to new typings from prosemirror

* style: fix linting issues

* style: fix linting issues

* style: fix linting issues

* fix(ci): fix build process by reimplement filterTransaction

* fix(extension-test): fix broken build because of wrong output file names

* fix: fix prosemirror-tables not being bundled correctly for ES6

* fix: move to prosemirror-tables-contently until es6 build is working

* fix: fix tests for youtube

* fix: fix youtube test

* fix(demos): fix demos build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants