Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup the project as only ESM by default #2

Open
talatkuyuk opened this issue Feb 6, 2024 · 3 comments
Open

setup the project as only ESM by default #2

talatkuyuk opened this issue Feb 6, 2024 · 3 comments
Labels
question Further information is requested

Comments

@talatkuyuk
Copy link

Thanks for the plugin.

As you know, recma plugins are a part of mdx ecosystem.

The package @mdx-js/mdx itself is an ESM package which uses remark / reyhpe / recma plugins that might only ESM and mostly. This is not directly related with nextjs which can import ESM only packages, as well.

I think this package should be and enough to be only ESM.

@domdomegg
Copy link
Owner

Hi, thanks for raising an issue!

Can you clarify what the benefits of converting this package to ESM by default would be for end users? There's also some discussion here as to CJS / ESM thoughts: mdx-js/mdx#2230 (comment)

@talatkuyuk
Copy link
Author

talatkuyuk commented Feb 6, 2024

I didn't know the discussion :)

I have created about 10 remark/rehype/recma plugins up to now, and all of them are ESM only. I've been using them in nextjs v.13 and v.14 apps in CJS setup with no problem.

As an example you can have a look my latest recma plugin recma-mdx-escape-missing-components which is ESM only as well. It is tested in a CJS setup nextjs v.14.1 app.

This is for your information. The benefit is that all remark / mdx ecosystem is towards to ESM only. I recommend you to convert the package to ESM only, because it doesn't cause any problem.

@domdomegg
Copy link
Owner

Thanks for your response!

The benefit is that all remark / mdx ecosystem is towards to ESM only.

I'm not sure I understand this benefit. I can understand other packages might be ESM-only, but given this package is CJS and ESM compatible it presuambly still works within that ecosystem? Sorry if I'm missing something here!

@domdomegg domdomegg added the question Further information is requested label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants