-
-
Notifications
You must be signed in to change notification settings - Fork 434
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
ES Modules. Decouple ThreeJS. Switch to Vite. Offline compiler #311
Conversation
…for future extensibility.
…ui.js as ui.cjs for plugin compatibility. Removed window.MINDAR.THREE since it is external now. Regenerated dist/ bundles
…ndled on the web.
…fresh to aframe register to solve blank page issue. Aframe.js now imports controller/ui directly
…s. updated examples accordingly
…d dist/ both get included in npm packages
@jmschrack I have briefly went through your changes once. It's amazing! This can definitely help us move forward! Since it's a huge PR and an very important update, I'll do some more testings before I merge it and push a new release. For now, I have a few quick questions / feedback.
I saw that there are difference between the build config of
I saw you added custom tfjs in an earlier commit: 60eb03b which was later removed from the vite config. I guess we are not using the custom tfjs anymore, right?
Can you refactor the This way, we can basically keep the |
|
…ns. Updated examples accordingly.
@hiukim Found a solution for the CSS3DRenderer concern! Vite can apparently take a function for the external so we can use some string functions to dynamically determine what should and shouldn't be marked as external. This fixed the issue of ThreeJS getting accidentally bundled in. I've also added a resolve alias for (By experimenting with writing out what files are getting passed in, it looks like ThreeJS Addons tend to get resolved to a full file system path, which is why it doesn't get caught the normal way!) |
@jmschrack Looks great! Thanks for the hard work! Just merged your PR. I'll tidy up some code and create a new release! :) |
It's nice to see 2 months of work pay off! :) |
FYI, I found some memory leak in some webgl kernals. If you run Can you confirm we can use inline worker for compiler as well? e33de6f There was a path resolve error for the compiler worker and looks like it fixed that. Also, I saw you were using inline worker for Controller. |
|
@hiukim I wonder, is there still a aframe/threejs independent library that works on the web? It looks like mindar-image.prod.js is now for node environments only and doesn't work in Wonderland Engine 🤔 |
@Squareys It should still works on the web. You can still install with HTML script tag. |
Ideally, I would use the ES Modules, but when I tried importing, it would give me errors about |
Main Changes
mindar-image
,mindar-face
,mindar-image-three
,mindar-face-three
are bundled as module libraries.mindar-image-aframe
andmindar-face-aframe
are bundled as IIFE libraries.examples\nodejs\createImageTargetLibrary.js
Minor Changes
node-canvas
was added to the Compiler.js class, this has no change for the web compiler, but allows for offline compilersMaintainer Notes for @hiukim
npm run watch
command won't auto-rebuild the aframe libraries. This is a limitation on Vite for now. I've addednpm run build-dev
to assist.dist/
from git history"files": ["dist/","src/"]
to package.json, this ensures that the dist/ and src/ folders still get included when the npm package is created.