Skip to content

feat(esm): Adding experimental support for ESM apps (1/n)#349

Merged
Tobbe merged 5 commits into
mainfrom
tobbe-esm-prep
Aug 9, 2025
Merged

feat(esm): Adding experimental support for ESM apps (1/n)#349
Tobbe merged 5 commits into
mainfrom
tobbe-esm-prep

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented Aug 9, 2025

With #80 in such a great place ✅ I had to decide on how to actually merge it into the code base

I had two options in my mind

  1. Make feat(create-cedar-app): Create ESM apps #80 a hard breaking change. Remove all CJS support, including jest etc and go ESM only
  2. Try to support both CJS and ESM projects

I was going to do option 2 first, but then when I saw how much #80 grew over time (it was at over 400 changed files at one point!) I started leaning more and more towards 1. So I updated all templates, test fixtures, generators etc to only use ESM syntax.

If I did option 1 I'd release ESM-only CedarJS as v1.0.0, and that version could then also include a few other breaking changes I have lined up.

But as I started thinking more about it I'm back at option 2.
If I add ESM support in a backwards compatible way I can release it as minor versions. That way I can potentially get more people to try it out earlier/easier. And I can release smaller major versions with other breaking changes alongside working on full ESM support.

So this PR is the first step of adding ESM-only code in a way that's backwards compatible. I start by adding ESM test fixtures and templates. There's currently no way to set up a new Cedar app using those templates, and the test fixtures aren't used yet. But this lets me merge a big chunk of the ESM changes in #80 without any disruption to existing apps or disruption to my ability to release new patches and minor versions of CedarJS

For posterity, this is where #80 was at when I created this PR:
image

@Tobbe Tobbe added this to the next-release milestone Aug 9, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 9, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit dd4b7a3
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/68973391680cc700088c4a96

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.

1 participant