You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been spending too much time (more than I should) to try to adopt ESM (a little bit of background here if you need more context) in some o orgajs packages. Mainly because some of the key packages that orgajs rely on is moving forward to pure ESM land. Here is a list of the major ones:
I am not going to list them all, basically, the whole unified ecosystem, and tons of useful tools are moving to ESM only right now. Which means we are frozen in time if we don't move. But there are two main reasons for us to stay in the commonjs land right now:
Next.jsis still working on it. It seems that the PR is merged. I haven't tried it yet, will definitely revisit when it's in stable release.
Orga currently heavily rely on these two eco-systems, so until they officially support ESM, I don't feel comfortable converting the packages.
That being said, I did successfully hack my way around it by using esbuild to transpile and bundle all esm modules into a cjs one, consumed by gatsby plugins. But there are drawbacks for that approach:
Increased bundle size. Since the esm packages are already in dependencies, bundle them into the package double the size of the final package. Yes I can move them into devDepdencies, but it's just not nice.
hard to maintain the build order if using 2 compilers (typescript and esbuild), it's just clumsy
So after some thought, I decided to roll back the packages and lock them down to the last version before ESM. I think we are gonna have to wait it out for now.
Plan B is to revisit the esbuild solution if an official solution for gatsby is still nowhere to be seen after a while. I understand it's a major change, and I can't even pretend to understand how complicated it would be for projects like gatsby.
The text was updated successfully, but these errors were encountered:
Okay, let's talk about ESM.
I have been spending too much time (more than I should) to try to adopt ESM (a little bit of background here if you need more context) in some o orgajs packages. Mainly because some of the key packages that orgajs rely on is moving forward to pure ESM land. Here is a list of the major ones:
I am not going to list them all, basically, the whole unified ecosystem, and tons of useful tools are moving to ESM only right now. Which means we are frozen in time if we don't move. But there are two main reasons for us to stay in the commonjs land right now:
Orga currently heavily rely on these two eco-systems, so until they officially support ESM, I don't feel comfortable converting the packages.
That being said, I did successfully hack my way around it by using esbuild to transpile and bundle all esm modules into a cjs one, consumed by gatsby plugins. But there are drawbacks for that approach:
devDepdencies
, but it's just not nice.But boy oh boy, is esbuild fast!
So after some thought, I decided to roll back the packages and lock them down to the last version before ESM. I think we are gonna have to wait it out for now.
Plan B is to revisit the esbuild solution if an official solution for gatsby is still nowhere to be seen after a while. I understand it's a major change, and I can't even pretend to understand how complicated it would be for projects like gatsby.
The text was updated successfully, but these errors were encountered: