-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
JSM to JS #20529
JSM to JS #20529
Conversation
Thanks for the PR! Note that there is some parallel discussion going on in #20527, I would be curious about pros/cons of using |
@donmccurdy Hey happy to help. So the script does the following things:
If we are going to compare the two methods I'd start by saying both will probably do the job - but for something like this I would choose the solution that offers the most amount of flexibility and long term support. I say flexibility is important because as I've discovered through this poc we will probably need to make some one offs to the build for certain types of files containing shader code, libs and other little got-yas. Dealing with one offs in custom build tools is usually cleaner then riding the fringe of a vendors config block that almost always leads to really ugly middleware. For long term support it depends. Whether its custom or vendor, the needs of the solution will continue to evolve with time. With custom build tools that evolution will have a higher maintenance tax than a vendor for the "day to day" or short to medium term. But for long term support custom build tools will always have less overall maintenance tax then that of a vendor. This is because vendor build tools like Rollup go through major API updates that sometimes completely break your implementation or drop support for features your implementation relies on. I've also seen vendor build tools no longer able to support the needs of a project because the evolution of codebase and adoption of a popular coding style outgrew them. |
Hey @gigablox, Could you remove the changes your script makes to the I would like to have a look over just your script doing the conversion as oppose to scrolling through the 350 odd output files. |
@DefinitelyMaybe No problem done. |
many thanks 👍 |
Closing in favor of #21584. |
Related issues:
#20455
Description:
This is a poc custom build script that converts all JSM modules into JS global namespaced modules in about 30 seconds.
Compiled JS examples in:
Script Path:
To run locally:
Had pretty good success with this method. Needs more testing but tried a few of the more complex modules like the GLTFLoader in a hello world and it was fine.
A success here just means there were no transpilation errors and the output file has good integrity. Some of these failures seem to do with shader code and file minification affecting RegExp parsing used in file transformation during the conversion process.
I'm sure there's a few more edge cases but think this is a method worth investigating more. Could use some help getting the files erroring out stable or improvements to any of the RegExp.