mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.91k stars 145 forks source link

chore(deps): update lexical packages #402

Closed david10sing closed 6 months ago

david10sing commented 6 months ago

Description

This PR is to upgrade lexical to latest version - 0.14.2.

I am working in a remix monorepo project with ESM on and getting errors stating lexical being CJS

image

Lexical is already on v0.14.2 which has esm support.

I've tried installing locally from file but it is still complaining about the CJS issue but it might also be due to pnpm workspace.

david10sing commented 6 months ago

@petyosi

Thank you for reviewing. 🙏

petyosi commented 6 months ago

@david10sing - thank you very much, the upgrade is indeed necessary. To ensure that I'm not missing something, please let me know the testing you did after the upgrade. Sometimes there are errors like incompatible types, etc.

david10sing commented 6 months ago

Hi @petyosi

I ran the ladle build and did a quick smoke test locally. There was no apparent error on the build and in browser.

I also did a build and there was no error.

Let me know if there needs to be further testing and I will do it.

Cheers

petyosi commented 6 months ago

Thank you. I'm not familiar with Astro, but it would be great if you can confirm that the upgrade solves the cjs problem there. I will test the Next.js/Remix examples.

petyosi commented 6 months ago

Merged that. As far as I can tell, the additional changes are still needed in the Remix environment, the module is still recognized as a CommonJS one. I will keep an eye on this: https://github.com/facebook/lexical/pull/5737, as it might address it.

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 2.19.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

petyosi commented 6 months ago

@david10sing to clarify, this approach: https://github.com/mdx-editor/mdx-editor-in-remix/blob/master/app/routes/_index.tsx seems to work as expected. However, I'm not a Remix expert.

david10sing commented 6 months ago

Right I mjs file... but yes I think that fix will remedy the cjs issue.