jsb icon indicating copy to clipboard operation
jsb copied to clipboard

ES module

Open larslaade opened this issue 2 years ago • 4 comments

Hi, would you like to re-structure jsb as an ES module? I have currently a branch with half the work done. But some questions are still open:

  • In a world of bundlers, do jsb still need requirejs support? requirejs do not support ESM out of the box, that might be a problem. Maybe finding another hook/callback/event/whatever to init unknown modules by the user themself.
  • Would you like to have a build process (rollup would be good fit) to include more formats (esm, umd, cjs)?
  • Code in TypeScript?

What do you think?

larslaade avatar Jul 26 '22 10:07 larslaade

Hello!

Thanks a lot for your contribution!

I think for next jsb major version 4.x those suggestions are great.

So a native ES module is really appreciated. If you link in the readme to the old branch (we create one for people who need old support called release/3.x) that would be great.

About rollup or other formats: good idea!

About typescript: let's keep it non-typescript in terms of .js file. But if possible add a definitions file for ts to make integration for typescript users easier.

What do you think?

DracoBlue avatar Jul 26 '22 17:07 DracoBlue

Ok, glad you like the ideas.

Linking to a previous release is a good idea. Rollup: i will add this. Typescript definitions are a good compromise.

So happy coding for me i think :)

larslaade avatar Jul 27 '22 17:07 larslaade

Have fun!

DracoBlue avatar Jul 27 '22 18:07 DracoBlue

I will in your branch (when back from holidays) add github actions (feel free to add them on your own) for npm release logic. We need to get rid of travis-ci

DracoBlue avatar Jul 28 '22 14:07 DracoBlue