JSX instead of h (createElement) function in widgets and other places

And did that work? You were able to add jsx and everything was fine?

Now the other questions you had about why babel is configured the way it is - Discourse is built on Rails using the asset pipeline, and webpack support was only added into Rails in version 6. Discourse’s code base is 8 years old! So over time we’ve added stuff to it but we’ve outgrown its limitations.

One of the big projects this year is migrating to Ember CLI - if you look at our commits you’ll see work towards this goal going into Discourse, but it’s a long road.

Once that is in place, you will be able to use a lot more Javascript build features that currently do not work unless you run them from within Ruby, which is cumbersome. In the meantime, I can’t see us devoting time to reading package.json and having that go in the Rails pipeline automatically.