fix for syntax regression in Meta Oculus Quest Browser #180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This is branched off of the branch for
That pull request can be merged first to fix the build, but the build for this branch also works (no build!). For convenience, here's the diff between the branches as the
Files changed
tab will not be as convenient.Description
For whatever reason, depending on the URL used to visit the app in Oculus Browser (f.e. a deployment using an HTTPS domain, vs running via localhost or an IP address), the return values of
.keys()
and.values()
methods forMap
,Set
, andArray
will cause a syntax error when spread into an array.For example, when Oculus Browser gets into this broken state, this code
will cause this error to be thrown:
Sometimes the problem does not happen, depending on how an app is accessed, but I'm not sure exactly what causes it.
Converting code like
[...set.keys()]
toArray.from(set.keys())
works around the issue in Oculus Browser.Related Issue #
N/A
Reviewer Testing Instructions
Try deploying the test example to some server, f.e. on nodechef.com, then hope that the issue happens in Oculus Browser in Oculus Quest Pro.
The following diff, in the project where I'm experimenting with this, shows the change to the
host.three.js
file that makes the app work (search for "this._states.values()" for example):015692de31d62d3cd9fb9c125f24f331d21d7b27..31071e142a1432fedc73758b3dd07f0b8a07ec10
That
host.three.js
file is the one I copied out of this repo after runningnpm run build
.After I made the chages seen here in this PR, I ran
npm run build
, then I copiedpackages/amazon-sumerian-hosts-three/dist/host.three.js
into that autonomys repo to fix the app.Submission Checklist
I confirm that I have...
I also manually tested
core.lex.html
using thestart-core
server, but that test is broken on mainline2.0 also with a 404 on a Lex URL. I suppose it has gone stale, and it doesn't really matter because both Babylon and Three tests/examples work.This contribution is licensed under the original MIT-0 license of the repository. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.