-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Example files that still need to be converted to modules #16688
Comments
Since the node materials files are already modules, they should probably be moved out of the js/ folder and into the jsm/ folder. Then we just need to create typescript files for them. |
Yes, I was thinking we'd have to do that, unfortunately. It's just a standard zip inflate function I think so that shouldn't be too hard. EDIT: Perhaps this one? https://github.com/zprodev/zlib.es Someone mentioned that they got it working with the |
We can define Edit: Of course this does only work that easy if the interface of the module version of the lib is similar to the normal version^^. |
I will try to start converting js files. The ones I authored will be easier for me ( So I'll start by moving |
#16054 is in progress for |
@yomboprime Sounds great!^^ |
I'm working on https://threejs.org/examples/webgl_animation_cloth.html |
Should we convert the deprecated files, or not? -- loaders/deprecated/
-- vr/deprecated/
|
I would convert them at the end when everything else is done.
Let's keep the example since it demonstrates cloth animation without a physics engine. |
I assign to myself the Edit: I did those two and marked them in the list. Next is LDrawLoader. |
/ping @sunag would you be able to convert the SEA3D loader and related files? |
@looeee of course. I will do this with NodeMaterialLoader too. |
BTW: We can remove |
Not yet please. There are a lot of encoding and decoding possibilities and multiple workflows to support. This is not trivial. The new method is not yet documented. |
I've just meant to remove it from the todo list, not the file^^ |
Since the amount of open tasks gets smaller and smaller, I think it's better if you assign your name to a file if you want to convert it. In this way, we avoid that two more devs work at the same thing. @looeee I've added you to the CTMLoader files since it seems you are already working on it. |
I actually won't have time in the next couple of days, so it's fine if someone else does that. I'll take my name off for now. |
We can remove the worker scripts from the list since these files are not imported in user applications like the other classes. Besides, they do not export a class or a namespace so |
Removing the Draco and Basis libs from the list for now, see #16754 (comment) |
I've converted most of the HTML examples in the last days. The following list shows the open tasks:
The node material examples can be solved as soon as #16054 is ready |
@Mugen87 I will open a PR until Sunday that brings back OBJLoader2 + Worker (jsm and standard workers supported). |
TBH, I think two examples for |
Ok, the non-module |
Here are a few remaining files to add to the list. Some of these may not necessarily make sense as es6 modules per se but once we make the move to convert all /jsm files to /js I think it will make sense to keep all of the maintained, editable versions of the examples in one directory ( /vr
/offscreen
/loaders
/renderers
|
see #16688 (comment). The worker files can just moved to the I would not change the other two VR files for now. Like the name implies, |
WebVR.js probably doesn't even need a non-module version. Will work on it this cycle. |
I'm tempted of removing the CTM loader. Seems too complicated to deal with and I'm not sure there is enough files out there that makes it worth it? Also, at the time it was a good option, but GLTF should be used instead now. |
@Mugen87 I agree that a lot of the files don't need to be "module-ified" but they should at least all be moved (eventually) into the same folder if only for consistency. I think it will be a bit confusing to have a mix of modules that are generated and hand-edited in the same folders. It's also still valid to load a script using import even if it doesn't export anything, as would be the case with the polyfill: import './examples/jsm/vr/HelioWebXRPolyfill.js'; Regarding the namespace for files like |
The conversion is now mainly done. We can now move the remaining, non-module files (see #16688 (comment)) to the JSM directory. I would also do this for the remaining external libs (see #16688 (comment)). |
Changed my mind. I think it's better to have only modules in the JSM directory. The remaining libs and worker files can stay in |
I think the issue can be closed. It's not necessary to convert all libs and worker scripts to modules now. We can change this over time e.g. when a lib vendor provides an ES6 version. We should now focus on the UMD generation so the modules become the canonical code base. |
Thanks to the work of @Mugen87 over the last while most of the examples have been made available as modules in the jsm/ folder.
Here's a list of all the examples that are still not available in the jsm/ folder. I've included everything for completeness, but we may not have to convert all of them (e.g. files in the lib/ folder).
Each file needs to be converted to a module and put in the corresponding directory in the
examples/jsm/
folder. If possible, conversion should be done via the modularize.js script (the example may need to be refactored for this to work). Modules also need a Typescript definition file to be added in the jsm/folder alongside them.
-- libs/
MMDPhysics
, physics examplesCTMLoader
)3MFLoader
,AMFLoader
,KMZLoader
,webgl2_materials_texture2darray.html
CTMLoader
)TTFLoader
TimeLineController
The text was updated successfully, but these errors were encountered: