How to deal with ECMA script 6?

serettig's picture
Forums: 

I want to port over an advanced "fill the gaps" exercise module I've written for another platform to the H5P platform in summer. I've looked at h5p-boilerplate for this and seen that it is written in ECMA Script 6. As it's still impossible to run ECMA Script 6 in the wild, how does the h5p team deal with transpiling it? 

My module is written in TypeScript and statically typed. Has it any chance of being accepted as a h5p module or would it make more sense to port it to ECMA Script 6?

Sebastian

tomaj's picture

Hi Sebastian,

Awesome that you are creating (porting) a content type! :)

As a Content Type creator, you are free to choose whichever language you want. Be that TypeScript or ES6 or another one. The H5P core team aims to support IE11, and the last two versions of the major browsers, so yes, we use Babel to transpile the ES2015+ code to ES5.

For a new content type to be accepted on the Hub, and be displayed on the examples page, the core team will review the user experience, to ensure that it feels like quality.

If you link to a Github account with your code, the community can probably provide you with some feedback too.

- Tom

tomaj's picture

Forgot to mention that we use npm and webpack for our building and bundeling needs. But you can see that in the boilerplate repo.

Also, the core team will generally not "adopt" code created by others, so the original content type creator gets access to do updates on their content types on the hub themselves.

- Tom