@lucidweb/retro-webxr

2.0.0 • Public • Published

@lucidweb/retro-webxr

Why?

It is not always possible to upgrade to the latest version without breaking changes. Handling breaking changes requires time and careful planning. This package aims to maintain a certain level of compatibility for past projects using previous versions of A-Frame.

What?

This package is bundled as an UMD bundle and expose one function, useRetroWebXR which takes an Object toggling compatibility flags.

Semantic versioning is used to make sure nothing breaks if there is a module API change.

Current flags

  • browser.requestDevice: Alias navigator.xr.requestDevice to navigator.xr.requestSession. Only for Chrome 79+
  • aframe.assetItemGLBAsArrayBuffer: Set response-type="arraybuffer" on a-asset-item when their src ends with .glb

How?

Install

npm install --save @lucidweb/retro-webxr

Use

CJS

const { useRetroWebXR } = require('@lucidweb/retro-webxr');

useRetroWebXR({
    browser: {
        requestDevice: true
    },
    aframe: {
        assetItemGLBAsArrayBuffer: true
    }
});

ES2015

import { useRetroWebXR } from '@lucidweb/retro-webxr';

useRetroWebXR({
    browser: {
        requestDevice: true
    },
    aframe: {
        assetItemGLBAsArrayBuffer: true
    }
});

window.RetroWebXR

<script type="text/javascript" src="https://unpkg.com/@lucidweb/retro-webxr@^2/dist/index.js"></script>
window.RetroWebXR.useRetroWebXR({
    browser: {
        requestDevice: true
    },
    aframe: {
        assetItemGLBAsArrayBuffer: true
    }
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.00
1.0.10
0.1.00

Package Sidebar

Install

npm i @lucidweb/retro-webxr

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

9.03 kB

Total Files

4

Last publish

Collaborators

  • lucidweb