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

Webpack Build for AR.js #86

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5c8c643
relative imports for threex sources, split of ar sources in sep. files
MikiDi Apr 4, 2020
5ea4ec8
Make threex methods aliases of arjs ones
MikiDi Apr 5, 2020
1d638d0
Make threex alias of arjs one
MikiDi Apr 5, 2020
5bbf37e
Relative imports for markers-area, split of threex files in to aliases
MikiDi Apr 5, 2020
12e5e8c
Relative imports for new-api
MikiDi Apr 5, 2020
c1b8c88
utils import + todo's
MikiDi Apr 5, 2020
db3b36b
added todo's for toolkit api imports
MikiDi Apr 5, 2020
0aaad00
Relative imports + TODO's for aframe components
MikiDi Apr 5, 2020
a35d88f
added necessary dependencies to package.json
MikiDi Apr 5, 2020
2407434
Made markercontrols-nft in to 1 file with dependencies
MikiDi Apr 7, 2020
c48e8a5
artoolkit imports
MikiDi Apr 7, 2020
04c9c37
Import order
MikiDi Apr 7, 2020
4889b4c
Entrypoints
MikiDi Apr 7, 2020
19c1907
Temporarily fix usage of global context imports for non nft build
MikiDi Apr 7, 2020
f4a8b5c
Renamed (typo) file
MikiDi Apr 7, 2020
8368625
Initial webpack config + entrypoint
MikiDi Apr 7, 2020
59f88cb
Fixed import paths
MikiDi Apr 7, 2020
d2d1daa
Make another threex an alias of markercontrols
MikiDi Apr 8, 2020
b3d474b
removed resolved todos
MikiDi Apr 8, 2020
997da1d
Change order of imports
MikiDi Apr 8, 2020
2537375
Adapt to using ES6 jsartoolkit by @andypotato
MikiDi Apr 16, 2020
5c3c901
improved build config, separate dev build for source maps
MikiDi Apr 16, 2020
191ab9d
Fixed some imports
MikiDi Apr 16, 2020
1dd0eaa
Original import order
MikiDi Apr 16, 2020
39700ff
Minor clarifications while debugging
MikiDi Apr 16, 2020
7f47f26
Fix webpack env config
MikiDi Apr 19, 2020
0a69d36
Latest dev build
MikiDi Apr 19, 2020
c52d16b
Debugging help comment
MikiDi Apr 26, 2020
1bf73f2
Entrypoint for nft build
MikiDi Apr 26, 2020
ff3a1fd
Extra projection no longer necessary after changes in jsartoolkit
MikiDi Apr 26, 2020
d190d2a
Sync build
MikiDi Apr 26, 2020
756095e
Merge branch 'dev' into ES6
MikiDi Apr 26, 2020
83e030d
Configure nft-build
MikiDi May 17, 2020
14d7235
Configure alias for conditional nft importing
MikiDi May 17, 2020
e1ce9a9
Configure for new artoolkit5 library
MikiDi May 17, 2020
41b37d5
Fix definitions
MikiDi May 17, 2020
05fc900
Split webworker into separate file + configure build
MikiDi May 17, 2020
a66ec1f
Temporarily use custom artoolkit build
MikiDi May 17, 2020
5883c1f
build commands
MikiDi May 17, 2020
561a18c
build
MikiDi May 21, 2020
45a3cff
upgrading packages, rebuilding libs
kalwalt Feb 10, 2021
e6f55b5
Add a comment regarding the alias used for dynamic importing
MikiDi Feb 14, 2021
e1fcb86
Add index files for exporting THREEx & ARjs API
MikiDi Mar 20, 2021
4ee5478
fix typos in imports
MikiDi Mar 20, 2021
3ef5f36
Rename aframe nft-build for clarity
MikiDi Mar 20, 2021
7f7a7f8
always specify build mode for new webpack version
MikiDi Mar 20, 2021
97c5b56
remove threex-armarkercontrols alias & references
MikiDi Mar 20, 2021
8c9fc2c
remove threex-artoolkit alias & references
MikiDi Mar 20, 2021
834a299
CommonJS exports
MikiDi Mar 20, 2021
003800c
Adapt default example to new build path
MikiDi Mar 20, 2021
7e2bb96
Sync builds
MikiDi Mar 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 217 additions & 0 deletions aframe/build/4c5b01f2ae5a357fc234.worker.js

Large diffs are not rendered by default.

5,233 changes: 2 additions & 5,231 deletions aframe/build/aframe-ar-nft.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions aframe/build/aframe-ar-nft.worker.js

Large diffs are not rendered by default.

6,585 changes: 2 additions & 6,583 deletions aframe/build/aframe-ar.js

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions aframe/src/component-anchor-nft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//////////////////////////////////////////////////////////////////////////////
import * as AFRAME from 'aframe';
import Anchor from '../../three.js/src/new-api/arjs-anchor';
import { AnchorDebugUI } from '../../three.js/src/new-api/arjs-debugui';
import ArToolkitContext from '../../three.js/src/threex/arjs-context-nft';

////////////////////////////////////////////////////////////////////////////////
// arjs-anchor
//////////////////////////////////////////////////////////////////////////////
AFRAME.registerComponent('arjs-anchor', {
Expand Down Expand Up @@ -95,11 +100,11 @@ AFRAME.registerComponent('arjs-anchor', {

if (_this.data.preset === 'hiro') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'kanji') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'area') {
markerParameters.type = 'barcode'
Expand Down Expand Up @@ -132,7 +137,7 @@ AFRAME.registerComponent('arjs-anchor', {
//////////////////////////////////////////////////////////////////////////////

var arSession = arjsSystem._arSession
var arAnchor = _this._arAnchor = new ARjs.Anchor(arSession, markerParameters)
var arAnchor = _this._arAnchor = new Anchor(arSession, markerParameters)

// it is now considered isReady
_this.isReady = true
Expand All @@ -150,7 +155,7 @@ AFRAME.registerComponent('arjs-anchor', {
document.body.appendChild(containerElement)
}
// create anchorDebugUI
var anchorDebugUI = new ARjs.AnchorDebugUI(arAnchor)
var anchorDebugUI = new AnchorDebugUI(arAnchor)
containerElement.appendChild(anchorDebugUI.domElement)
}
}, 1000 / 60)
Expand Down
15 changes: 10 additions & 5 deletions aframe/src/component-anchor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//////////////////////////////////////////////////////////////////////////////
import * as AFRAME from 'aframe';
import Anchor from '../../three.js/src/new-api/arjs-anchor';
import { AnchorDebugUI } from '../../three.js/src/new-api/arjs-debugui';
import ArToolkitContext from '../../three.js/src/threex/arjs-context';

// //////////////////////////////////////////////////////////////////////////////
// arjs-anchor
//////////////////////////////////////////////////////////////////////////////
AFRAME.registerComponent('arjs-anchor', {
Expand Down Expand Up @@ -92,11 +97,11 @@ AFRAME.registerComponent('arjs-anchor', {

if (_this.data.preset === 'hiro') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'kanji') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'area') {
markerParameters.type = 'barcode'
Expand Down Expand Up @@ -125,7 +130,7 @@ AFRAME.registerComponent('arjs-anchor', {
//////////////////////////////////////////////////////////////////////////////

var arSession = arjsSystem._arSession
var arAnchor = _this._arAnchor = new ARjs.Anchor(arSession, markerParameters)
var arAnchor = _this._arAnchor = new Anchor(arSession, markerParameters)

// it is now considered isReady
_this.isReady = true
Expand All @@ -143,7 +148,7 @@ AFRAME.registerComponent('arjs-anchor', {
document.body.appendChild(containerElement)
}
// create anchorDebugUI
var anchorDebugUI = new ARjs.AnchorDebugUI(arAnchor)
var anchorDebugUI = new AnchorDebugUI(arAnchor)
containerElement.appendChild(anchorDebugUI.domElement)
}
}, 1000 / 60)
Expand Down
7 changes: 5 additions & 2 deletions aframe/src/component-hit-testing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
import * as AFRAME from 'aframe';
import HitTesting from '../../three.js/src/new-api/arjs-hittesting';

// //////////////////////////////////////////////////////////////////////////////
// arjs-hit-testing
//////////////////////////////////////////////////////////////////////////////
AFRAME.registerComponent('arjs-hit-testing', {
Expand Down Expand Up @@ -40,7 +43,7 @@ AFRAME.registerComponent('arjs-hit-testing', {
var arSession = arjsSystem._arSession
var renderer = arSession.parameters.renderer

var hitTesting = _this._arHitTesting = new ARjs.HitTesting(arSession)
var hitTesting = _this._arHitTesting = new HitTesting(arSession)
hitTesting.enabled = _this.data.enabled

_this.isReady = true
Expand Down
10 changes: 10 additions & 0 deletions aframe/src/index-nft.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Components
import './component-anchor-nft';
import './component-hit-testing';

// Location-based components
import './location-based/gps-camera';
import './location-based/gps-entity-place';

// System
import './system-arjs';
10 changes: 10 additions & 0 deletions aframe/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Components
import './component-anchor';
import './component-hit-testing';

// Location-based components
import './location-based/gps-camera';
import './location-based/gps-entity-place';

// System
import './system-arjs';
3 changes: 3 additions & 0 deletions aframe/src/location-based/gps-camera.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as AFRAME from 'aframe';
import * as THREE from 'three';

AFRAME.registerComponent('gps-camera', {
_watchPositionId: null,
originCoords: null,
Expand Down
2 changes: 2 additions & 0 deletions aframe/src/location-based/gps-entity-place.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as AFRAME from 'aframe';

AFRAME.registerComponent('gps-entity-place', {
_cameraGps: null,
schema: {
Expand Down
11 changes: 8 additions & 3 deletions aframe/src/system-arjs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import * as AFRAME from 'aframe';
import Profile from '../../three.js/src/threex/arjs-profile';
import Session from '../../three.js/src/new-api/arjs-session';
import { SessionDebugUI } from '../../three.js/src/new-api/arjs-debugui';

AFRAME.registerSystem('arjs', {
schema: {
trackingMethod: {
Expand Down Expand Up @@ -94,7 +99,7 @@ AFRAME.registerSystem('arjs', {
// setup arProfile
//////////////////////////////////////////////////////////////////////////////

var arProfile = this._arProfile = new ARjs.Profile()
var arProfile = this._arProfile = new Profile()
.trackingMethod(this.data.trackingMethod)
.performance(this.data.performanceProfile)
.defaultMarker()
Expand Down Expand Up @@ -142,7 +147,7 @@ AFRAME.registerSystem('arjs', {
//////////////////////////////////////////////////////////////////////////////
// build ARjs.Session
//////////////////////////////////////////////////////////////////////////////
var arSession = _this._arSession = new ARjs.Session({
var arSession = _this._arSession = new Session({
scene: scene,
renderer: renderer,
camera: camera,
Expand Down Expand Up @@ -191,7 +196,7 @@ AFRAME.registerSystem('arjs', {
}

// create sessionDebugUI
var sessionDebugUI = new ARjs.SessionDebugUI(arSession)
var sessionDebugUI = new SessionDebugUI(arSession)
containerElement.appendChild(sessionDebugUI.domElement)
}
})
Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "./aframe/build/aframe-ar.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "make build"
"build": "./node_modules/.bin/webpack --mode=production",
"build:dev": "./node_modules/.bin/webpack --mode=development"
},
"files": [
"three.js/build",
Expand Down Expand Up @@ -47,5 +48,15 @@
"bugs": {
"url": "https://github.com/AR-js-org/AR.js/issues"
},
"homepage": "https://github.com/AR-js-org/AR.js/"
"homepage": "https://github.com/AR-js-org/AR.js/",
"devDependencies": {
"webpack": "^5.1.3",
"webpack-cli": "^4.0.0",
"worker-loader": "^3.0.4"
},
"dependencies": {
"aframe": "^1.0.4",
"artoolkit5-js": "^0.0.4",
"three": "^0.125.0"
}
}
3,589 changes: 2 additions & 3,587 deletions three.js/build/ar-nft.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions three.js/build/ar-nft.worker.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions three.js/build/ar-threex-nft.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions three.js/build/ar-threex-nft.worker.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions three.js/build/ar-threex.js

Large diffs are not rendered by default.

4,970 changes: 2 additions & 4,968 deletions three.js/build/ar.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions three.js/build/ar.worker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion three.js/examples/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script src='vendor/three.js/build/three.js'></script>
<script src='vendor/three.js/examples/js/libs/stats.min.js'></script>
<!-- ar.js -->
<script src="../build/ar.js"></script>
<script src="../build/ar-threex.js"></script>
<script>THREEx.ArToolkitContext.baseURL = '../'</script>

<!-- Bind window error for error handling -->
Expand Down
20 changes: 20 additions & 0 deletions three.js/src/index-arjs-nft.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Anchor from './new-api/arjs-anchor';
import HitTesting from './new-api/arjs-hittesting';
import { AnchorDebugUI, SessionDebugUI } from './new-api/arjs-debugui';
import Session from './new-api/arjs-session';
import Utils from './new-api/arjs-utils';
import Context from './threex/arjs-context-nft'; // nft-specific
import Profile from './threex/arjs-profile';
import Source from './threex/arjs-source';

export {
Anchor,
HitTesting,
AnchorDebugUI,
SessionDebugUI,
Session,
Utils,
Context,
Profile,
Source
};
20 changes: 20 additions & 0 deletions three.js/src/index-arjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Anchor from './new-api/arjs-anchor';
import HitTesting from './new-api/arjs-hittesting';
import { AnchorDebugUI, SessionDebugUI } from './new-api/arjs-debugui';
import Session from './new-api/arjs-session';
import Utils from './new-api/arjs-utils';
import Context from './threex/arjs-context';
import Profile from './threex/arjs-profile';
import Source from './threex/arjs-source';

export {
Anchor,
HitTesting,
AnchorDebugUI,
SessionDebugUI,
Session,
Utils,
Context,
Profile,
Source
};
19 changes: 19 additions & 0 deletions three.js/src/index-threex-nft.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import ArMarkerControls from './threex/arjs-markercontrols-nft'; // nft-specific
import ArMarkerHelper from './threex/threex-armarkerhelper';
import ArSmoothedControls from './threex/threex-arsmoothedcontrols';
import ArToolkitContext from './threex/arjs-context-nft'; // nft-specific
import ArToolkitProfile from './threex/arjs-profile';
import ArToolkitSource from './threex/arjs-source';
import ArMultiMarkerControls from './markers-area/threex-armultimarkercontrols';
import ArMultiMakersLearning from './markers-area/threex-armultimarkerlearning'; // typo is spread over codebase

export {
ArMarkerControls,
ArMarkerHelper,
ArSmoothedControls,
ArToolkitContext,
ArToolkitProfile,
ArToolkitSource,
ArMultiMarkerControls,
ArMultiMakersLearning
};
19 changes: 19 additions & 0 deletions three.js/src/index-threex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import ArMarkerControls from './threex/arjs-markercontrols';
import ArMarkerHelper from './threex/threex-armarkerhelper';
import ArSmoothedControls from './threex/threex-arsmoothedcontrols';
import ArToolkitContext from './threex/arjs-context';
import ArToolkitProfile from './threex/arjs-profile';
import ArToolkitSource from './threex/arjs-source';
import ArMultiMarkerControls from './markers-area/threex-armultimarkercontrols';
import ArMultiMakersLearning from './markers-area/threex-armultimarkerlearning'; // typo is spread over codebase

export {
ArMarkerControls,
ArMarkerHelper,
ArSmoothedControls,
ArToolkitContext,
ArToolkitProfile,
ArToolkitSource,
ArMultiMarkerControls,
ArMultiMakersLearning
};
Loading