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

RFC: 015 Migrate API to ESM #6881

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

hdiniz
Copy link

@hdiniz hdiniz commented Jul 21, 2023

@hdiniz hdiniz added api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) RFC Request for comments labels Jul 21, 2023
@hdiniz hdiniz self-assigned this Jul 21, 2023
@hdiniz hdiniz requested a review from a team July 21, 2023 14:06
Copy link
Member

@Betree Betree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RFC looks good to me. It's painful, but it sounds like moving to ESM is the way to go.

Thanks for documenting this.


## Alternatives

Don't migrate to ESM. It would still be possible to use ESM modules and keep up to date with the ecosystem by making use of async imports.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it will be easier to migrate later on when more libraries/tooling will move to ESM, or is it mature already and there would be no difference if we delay the decision?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its safe to progressively migrate now. The tooling required is moving from babel-loader/babel to ts-node/tsc, and we can make it without changing the project module type. After we have progressed on these changes which are compatible with both ESM/CommonJS we can see about flipping the switch finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) RFC Request for comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants