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

Prepare for ES Modules #1379

Closed
AlCalzone opened this issue Jun 15, 2021 · 4 comments
Closed

Prepare for ES Modules #1379

AlCalzone opened this issue Jun 15, 2021 · 4 comments

Comments

@AlCalzone
Copy link
Collaborator

AlCalzone commented Jun 15, 2021

Node 12.16+ supports the new EcmaScript modules and more and more packages are migrating. Currently all of them are also offering a CommonJS export, but that could change with time. At some point we will have to deal with that - meaning a migration of JS-Controller to ESM.

Helpful resources:

@Jey-Cee
Copy link

Jey-Cee commented Jan 13, 2022

As there is actual no decision to do this now*, here are arguments:

Pro:

  • we don't have to worry that we suddenly have to implement it if a large number of modules just provide ESM
  • we do not lose functionality while CJS could still be used
  • we have a lot of time for transition

Contra:

  • a lot of work to do
  • now means starting with planning and prepare as soon as possible

@foxriver76
Copy link
Collaborator

I think, now that we have everything running through a TS compile step, it would now be easy to provide ESM for the packages of this monorepo.

Not sure, if this should be a priority for next controller @AlCalzone @Apollon77 @GermanBluefox

https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html

@Apollon77
Copy link
Collaborator

In fact just building it will not bring us any step further. We need to find out how to make our adapter approach ESM compatible, what this means for adapter-core, how we handle compact mode :-) (and such - and I did not started with javascript adapter and esm deps gg) ... So yes if starting with this it makes sense to also build ESM :-) but I think this is just the beginning fo the story

@foxriver76
Copy link
Collaborator

I think internally it should be fine now. Compact mode is covered in #1667 and the general Adapter approach needs to be done in adapter-core. So could this be closed or anything in the context of this ticket open?

For adapter-core we have a start at ioBroker/adapter-core#576

@foxriver76 foxriver76 self-assigned this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants