-
Notifications
You must be signed in to change notification settings - Fork 940
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
Webpack Build for AR.js (follow-up) #116
Conversation
published new npm beta package |
- see commit cb0b755
@nickw1 i applied the changes for location-based from 3.3.3 https://github.com/AR-js-org/AR.js/releases/tag/3.3.3 but when i try the examples i get errors like this:
Maybe i missed something? I think we are very close to a conclusion... |
I have a fix for this issue, i will apply this evening.🙂 |
with commit 57928db i published a new npm beta package |
There some issues with mobile devices, it depends which example you test but i think it's time to merge into dev, fix them when merged and eventually make other changes to improve the code. |
@kalwalt glad you have fixed this. Sorry, I have been ill the past few days, sorry I missed your original message! |
@nickw1 no problem, if we find other issues we can fix them when merged. |
Thank you to all AR.js friends @MikiDi @nickw1 @nicolocarpignoli @andypotato and others that had contributed to this PR/feature, this is possible because your help! |
ℹ️ This is a follow-up PR for #86 . Whereas #86 serves more as a discussion-board, discussing broad context, this PR features the right source & target branch, allowing for technical review to make the PR merge-ready.
What kind of change does this PR introduce?
Webpack build-system instead of "
cat
build-system" 😉 , module-based code, usage of andypotato'sartoolkit5-js
Related issues
Summary
In order to comfortably integrate this great library in a modern web application (React, Angular, Ember.js, ...) it would be nice to have AR.js provided as a ES6 module (while keeping support for browser
<script>
usage). Refactoring the library to also use import/export internally, has the additional (and arguably most important) advantage of improved maintainability.In order to achieve the above, I refactored the library to use imports/exports instead of relying on globals and introduced a build configuration for webpack. Since the jsartoolkit5 library is somewhat flawed when it comes to ES6 support, this PR depends on the work done by @andypotato in artoolkit5-js to make the library ES6-compatible.
Does this PR introduce a breaking change?
No. Functionality-wise, the end-result of this PR should do exactly the same as the current master build.
How can we test it?
pattern-marker build
Aframe: Host the basic example and use the
aframe-ar.js
build from the PR branch.Threejs: default example and use the
ar-threex.js
build.NFT-build
Host the nft t-rex example and use the
aframe-ar-nft.js
build from the PR branch.Making changes and rebuilding
Device used for tests, version of OS and version of Browser
Desktop (webcam):
Android device:
Codebase changes
We don't want to introduce breaking changes, At this time you should use the same classes, methods and properties. The namespaces THREEx and ARjs are bundled in separate build now. We would create a doc section on this.
THREEx namespace classes
THREEx.ArBaseControls
THREEx.ARClickability
THREEx.ArMarkerCloak
THREEx.ArMarkerControls
THREEx.ArMarkerHelper
THREEx.ArSmoothedControls
THREEx.ArToolkitContext
THREEx.ArToolkitProfile
THREEx.ArToolkitSource
THREEx.ArVideoInWebgl
THREEx.HitTestingPlane
ARjs namespace classes
ARjs.MarkerControls
ARjs.Context
ARjs.Profile
ARjs.Source
TODO's
Error while intizalizing arController No canvas available
-> partial fix switched to a previuos artoolkit5-js versionremoving multiple instances of Three.js warning, see the log message:This will be fixed in another PR.three.module.js:49640 WARNING: Multiple instances of Three.js being imported.
restore master branch in aframe nft examples instead of ES6 branch.this should be done when merged in masterremoving double ARtoolkit.js printing from artoolkit5-js package(this is normal because we instantiate two artoolkit instance) anyway not a real issue...Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.
This was caused because different baseUrl! see commit 283cc06 and comments Webpack Build for AR.js (follow-up) #116 (comment) Webpack Build for AR.js (follow-up) #116 (comment)0.127.00.132.2 version in package.json and in the examplesTHREE.Matrix4: .getInverse()
in arjs-markercontrols.js arjs-markercontrols-nft.js because is deprecated and replaced with.matrix.copy(modelViewMatrix).invert()