Skip to content

Conversation

@snebjorn
Copy link
Contributor

@snebjorn snebjorn commented Oct 21, 2025

⚠️ This is a breaking change ⚠️

Packages now compiles to ESM. No more CommonJS. Users needing CommonJS should stay on the previous version.

Updated a bunch of packages that was stuck on old versions as they moved to pure ESM and we couldn't use them. But now we can.

Related:

Breaking changes:

  • Orval will no longer look for orval.config.cjs
  • orval.config.(js|mjs|ts) must be ESM
// orval.config
// before
module.exports = {...

// after
export default {...
  • user provided hooks and mutators must be ESM
// my-mutator
// before
module.exports = ...

// after
export default ...

For TypeScript users there's no changes

@melloware melloware added the breaking change Breaking change on upgrade label Oct 21, 2025
@melloware melloware added this to the 7.15.0 milestone Oct 21, 2025
@melloware
Copy link
Collaborator

Yeah this should be an 8.0 feature I think?

@melloware melloware modified the milestones: 7.15.0, FUTURE Oct 21, 2025
@melloware
Copy link
Collaborator

I just read through that post and it seems a lot of users have concerns moving to ESM.

I know in my life it's been a nightmare working on a few different open source react projects.

@snebjorn
Copy link
Contributor Author

I just read through that post and it seems a lot of users have concerns moving to ESM.

I know in my life it's been a nightmare working on a few different open source react projects.

I could be wrong. But Orval is a CLI tool, it doesn't integrate directly with the project it's being used in. There are no changes to the output. So I don't understand what the concern is 😃 But I might have missed something.

The only breaking change, I'm aware of, are the user provided mutators and hooks must be ESM now.

@melloware
Copy link
Collaborator

yeah the mutators etc being ESM to me is a bigger change than one might think but I could be wrong.

People were mad about uprgading to Node 22 and that should have been harmless!

@snebjorn
Copy link
Contributor Author

snebjorn commented Oct 22, 2025

People were mad about uprgading to Node 22 and that should have been harmless!

to be fair that breaking change wasn't released as a major. I'd probably also get slightly upset if that happened to me 😄

@melloware
Copy link
Collaborator

Yep that was my fault! Also i think i just caused you a merge conflict

@melloware
Copy link
Collaborator

I will release 7.15.0 tomorrow and then merge this and the docs one as 8.0.0!

@melloware melloware merged commit 8eba703 into orval-labs:master Oct 25, 2025
2 checks passed
@snebjorn snebjorn deleted the esm branch October 25, 2025 12:52
zhu-hong pushed a commit to zhu-hong/orval that referenced this pull request Oct 29, 2025
* chore: update deps

* feat: orval is now pure ESM

* fixes error in test

* fixes odd path issue on CI

* fix outdated lock file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking change on upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants