Skip to content
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

Remove webpack, use vanilla ES Modules to simplify the project. #182

Open
trusktr opened this issue Sep 1, 2023 · 2 comments · May be fixed by #183
Open

Remove webpack, use vanilla ES Modules to simplify the project. #182

trusktr opened this issue Sep 1, 2023 · 2 comments · May be fixed by #183

Comments

@trusktr
Copy link

trusktr commented Sep 1, 2023

Webpack already caused a break (see #181) and generally speaking there's quite a bit of build magic happening that I think detracts from the simplicity of managing the code.

I've got a branch that converted everything to vanilla ES Modules, and it ends up being really simple that way:

To do this, I had to update Babylon because Babylon 4 source code is not ESM. However, updating to Babylon 5 caused animations to break, and one model has a deformed jaw line (like those long-time chewing tobacco users). That's tracked here:

The Three.js host works perfect on the latest version after a small tweak of one line of code due to a renamed API (*BufferGeometry -> *Geometry).

Apart from Babylon breakage, everything is working nice on vanilla ESM, and all that you need to do to run anything is simply start a static web server; very easy.

I believe this is more ideal for this type of lib (app authors can choose which bundlers and tools they want to optimize their app with, but otherwise having to manage dependencies and build configs makes it all have a higher learning curve and maintenance cost)

@trusktr
Copy link
Author

trusktr commented Sep 6, 2023

Sidenote: Three.js's global script for loading a global THREE variable containing all Three.js APIs is deprecated and will be removed on release 0.160 (which isn't far off). At that point, the Three.js library will ship only JavaScript modules.

@trusktr trusktr linked a pull request Sep 6, 2023 that will close this issue
12 tasks
@trusktr
Copy link
Author

trusktr commented Sep 6, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant