Git Product home page Git Product logo

Comments (7)

cvan avatar cvan commented on May 11, 2024 1

à la es6-promise, this is what I'd recommend:

// es6 import
import { WebVRPolyfill } from 'webvr-polyfill';
WebVRPolyfill.polyfill();

// require
const WebVRPolyfill = require('webvr-polyfill');
WebVRPolyfill.polyfill();

from webvr-polyfill.

cvan avatar cvan commented on May 11, 2024

This isn't fixed. Why is this closed?

from webvr-polyfill.

borismus avatar borismus commented on May 11, 2024

I thought I had fixed it, but you're right!

from webvr-polyfill.

jsantell avatar jsantell commented on May 11, 2024

Currently you can access the WebVRPolyfill object in built environments (browserify, webpack, etc.) via

// es6 import
import { WebVRPolyfill } from 'webvr-polyfill/src/webvr-polyfill';
// require
const WebVRPolyfill = require('webvr-polyfill/src/webvr-polyfill').WebVRPolyfill;

The use case of dropping in the script file should just seemlessly polyfill the API (which is what bundling from src/main.js does), and any custom configuration (beyond the WebVRConfig values) where you'd want to access the polyfill constructor directly can be done by accessing the constructor via require/es6 imports. Is there a common use case inbetween these two scenarios?

from webvr-polyfill.

cvan avatar cvan commented on May 11, 2024

I started a local branch on this. Is there interest in it? (I've been modelling it after es6-promise.)

from webvr-polyfill.

jsantell avatar jsantell commented on May 11, 2024

I'd just be hesitant to do any big architectural changes without first having some solid testing, and that the script in build/ still just auto-polyfills without further interaction, and if the imports work from #47 (comment), I'd be curious what is missing (in lieu of larger changes)

from webvr-polyfill.

jsantell avatar jsantell commented on May 11, 2024

Fixed in 0.10.0

from webvr-polyfill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.