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

fix for syntax regression in Meta Oculus Quest Browser #180

Open
wants to merge 3 commits into
base: mainline2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
793 changes: 757 additions & 36 deletions package-lock.json

Large diffs are not rendered by default.

150 changes: 75 additions & 75 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
{
"name": "amazon-sumerian-hosts",
"license": "MIT",
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com",
"organization": true
},
"repository": {
"type": "git",
"url": "https://github.com/aws-samples/amazon-sumerian-hosts.git"
},
"workspaces": [
"./packages/amazon-sumerian-hosts-core",
"./packages/amazon-sumerian-hosts-babylon",
"./packages/demos-babylon",
"./packages/amazon-sumerian-hosts-three"
],
"scripts": {
"compile-ts": "tsc --build --verbose",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier *.js packages/**/*.js --write",
"test": "node ./node_modules/karma/bin/karma start karma.conf.js",
"build": "npm run format && npm run lint:fix && npm run compile-ts && webpack",
"build-test": "npm run build && npm run test",
"release": "cross-env NODE_ENV=production npm run build",
"docs": "jsdoc -c jsdoc.conf.json",
"start": "cross-env NODE_ENV=development webpack-dev-server",
"start-core": "cross-env ENGINE=core NODE_ENV=development webpack-dev-server",
"start-three": "cross-env ENGINE=three NODE_ENV=development webpack-dev-server",
"start-babylon": "cross-env ENGINE=babylon NODE_ENV=development webpack-dev-server"
},
"devDependencies": {
"cross-env": "^7.0.3",
"eslint": "^8.8.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^6.10.0",
"eslint-import-resolver-webpack": "^0.12.1",
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jasmine": "^4.1.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.1.2",
"file-loader": "^6.2.0",
"jsdoc": "^3.6.10",
"karma": "^6.3.12",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "4.0.1",
"karma-sourcemap-loader": "^0.3.8",
"karma-spec-reporter": "0.0.33",
"karma-webpack": "^5.0.0",
"prettier": "^1.19.1",
"regenerator-runtime": "^0.13.5",
"terser-webpack-plugin": "^5.3.1",
"typescript": "^4.6.3",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.3",
"webpack-merge": "^5.8.0"
},
"browserslist": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 ChromeAndroid versions",
"last 2 FirefoxAndroid versions",
"last 2 iOS versions"
],
"version": "2.0.6",
"overrides": {
"xml2js": "^0.5.0"
}
}
{
"name": "amazon-sumerian-hosts",
"license": "MIT",
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com",
"organization": true
},
"repository": {
"type": "git",
"url": "https://github.com/aws-samples/amazon-sumerian-hosts.git"
},
"workspaces": [
"./packages/amazon-sumerian-hosts-core",
"./packages/amazon-sumerian-hosts-babylon",
"./packages/demos-babylon",
"./packages/amazon-sumerian-hosts-three"
],
"scripts": {
"compile-ts": "tsc --build --verbose",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier *.js packages/**/*.js --write",
"test": "node ./node_modules/karma/bin/karma start karma.conf.js",
"build": "npm run format && npm run lint:fix && npm run compile-ts && webpack",
"build-test": "npm run build && npm run test",
"release": "cross-env NODE_ENV=production npm run build",
"docs": "jsdoc -c jsdoc.conf.json",
"start": "cross-env NODE_ENV=development webpack-dev-server",
"start-core": "cross-env ENGINE=core NODE_ENV=development webpack-dev-server",
"start-three": "cross-env ENGINE=three NODE_ENV=development webpack-dev-server",
"start-babylon": "cross-env ENGINE=babylon NODE_ENV=development webpack-dev-server"
},
"devDependencies": {
"cross-env": "^7.0.3",
"eslint": "^8.8.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^6.10.0",
"eslint-import-resolver-webpack": "^0.12.1",
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jasmine": "^4.1.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.1.2",
"file-loader": "^6.2.0",
"jsdoc": "^3.6.10",
"karma": "^6.3.12",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "4.0.1",
"karma-sourcemap-loader": "^0.3.8",
"karma-spec-reporter": "0.0.33",
"karma-webpack": "^5.0.0",
"prettier": "^1.19.1",
"regenerator-runtime": "^0.13.5",
"terser-webpack-plugin": "5.3.1",
"typescript": "^4.6.3",
"webpack": "5.76.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.7.3",
"webpack-merge": "5.8.0"
},
"browserslist": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 ChromeAndroid versions",
"last 2 FirefoxAndroid versions",
"last 2 iOS versions"
],
"version": "2.0.6",
"overrides": {
"xml2js": "^0.5.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ const host = await HOST.HostUtils.createHost(scene, characterConfig, pollyConfig
* @returns {string[]} An array of characterId's that can be used with getCharacterConfig
*/
static getAvailableCharacters() {
return [...characterTypeMap.keys()];
return Array.from(characterTypeMap.keys());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class AnimationPlayerInterface {
// Blend to the new state over time
else {
// Make sure to transition out of any states with non-zero weight
const currentStates = [...this._states.values()].filter(
const currentStates = Array.from(this._states.values()).filter(
s => s !== targetState && (s.weight || s.weightPending)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Blend1dState extends AbstractBlendState {

// Initialize the thresholds map
this._thresholds = [];
[...this._states.values()].forEach((state, index) => {
Array.from(this._states.values()).forEach((state, index) => {
this._thresholds.push({
value: blendThresholds[index],
name: state.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Blend2dState extends AbstractBlendState {
};

this._thresholds = [];
[...this._states.values()].forEach((state, index) => {
Array.from(this._states.values()).forEach((state, index) => {
this._thresholds.push({
name: state.name,
phaseMatch: phaseMatches[index] || false,
Expand Down Expand Up @@ -179,7 +179,7 @@ class Blend2dState extends AbstractBlendState {
super.updateInternalWeight(factor);

if (this._phaseLeadState) {
[...this._states.values()].forEach((state, index) => {
Array.from(this._states.values()).forEach((state, index) => {
if (state.weight !== 0 && this._thresholds[index].phaseMatch) {
state.normalizedTime = this._phaseLeadState.normalizedTime;
}
Expand All @@ -198,7 +198,7 @@ class Blend2dState extends AbstractBlendState {
if (!this._vertices || this._vertices.length === 0) return;

if (this._vertices.length === 1) {
[...this._states.values()][0].weight = 1;
Array.from(this._states.values())[0].weight = 1;
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class QueueState extends AnimationPlayerInterface.Mixin(

// Signal the next animation is starting
if (typeof onNext === 'function') {
const lastName = [...this._states.keys()][this._states.size - 1];
const lastName = Array.from(this._states.keys())[this._states.size - 1];
const isQueueEnd = name === lastName;
onNext({
name,
Expand Down Expand Up @@ -148,7 +148,7 @@ class QueueState extends AnimationPlayerInterface.Mixin(
} else {
// Signal the next animation is starting
if (name !== this.currentAnimation && typeof onNext === 'function') {
const lastName = [...this._states.keys()][this._states.size - 1];
const lastName = Array.from(this._states.keys())[this._states.size - 1];
const isQueueEnd = name === lastName;
onNext({
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,23 @@ class StateContainerInterface {
}

getStateNames() {
return [...this._states.keys()];
return Array.from(this._states.keys());
}

addState(state) {
// Make sure the state is not already in this container
if ([...this._states.values()].includes(state)) {
if (Array.from(this._states.values()).includes(state)) {
console.warn(
`Cannot add animation to state ${this.name}. Animation was already added.`
);
return state.name;
}

// Make sure the state name is unique
const uniqueName = Utils.getUniqueName(state.name, [
...this._states.keys(),
]);
const uniqueName = Utils.getUniqueName(
state.name,
Array.from(this._states.keys())
);

if (state.name !== uniqueName) {
console.warn(
Expand Down Expand Up @@ -151,7 +152,7 @@ class StateContainerInterface {
// Make sure the name is unique
const uniqueName = Utils.getUniqueName(
newName,
[...this._states.keys()].filter(s => s.name !== currentName)
Array.from(this._states.keys()).filter(s => s.name !== currentName)
);

if (newName !== uniqueName) {
Expand Down