Hi all, Some of you might have seen the basic widget that Finaps released last week, using Webpack & React. Although this is a nice PoC, including React in custom widgets is not advised. There has already been some discussion around it, which boils down to this: R&D is working on Plugin Widgets, which use React and will eventually replace all the current components (like Buttons etc). We will be able to create our own plugin widgets at some point, but that's still uncertain when. In the meantime, Custom Widgets will not be able to use React. Sad, but true. Including React is a bad practice, as the widgets.js file will include multiple versions of React (the same problem as with jQuery). Anyway, the Webpack setup that Finaps created inspired me to create my own version of it. You can find it here: https://github.com/JelteMX/widget-base This widget setup will create minified code that works in any production environment. Furthermore, it will make the code much smaller (initial tests on ChartJS reduce the size with approx. 50%). Writing ES6 code is prettier, in my humble opinion. Also, this setup will make it possible to start writing code in Typescript (not supported at the moment). Combining it with Gulp to improve the workflow. I would love to see some feedback on it. Pull Requests & Issues please :-). If it is deemed stable (it works perfectly for me on a Mac, but need further testing on Windows), I will release it under the Mendix organization, write documentation (the README is small as of now, but covers the important points) and add it to the widget generator. Happy coding!
Great to see that we have inspired you! We love to see this movement towards more reactive applications, and better support for developing widgets!
I just had a peek at your code, and great to see that you actually touched the styling aspect. I had it left open in our boilerplate at https://github.com/Finaps/boilerplate-mendix-react-widget/ , and was planning to write a small post about using it in combination with scss and less. It's nice to see that you have included also some initial thoughts within this boilerplate.
Could you please elaborate more on the plugin widgets? I'm really curious on how they will work, when we can see them, and just anything. They seem interesting :)