Giter VIP home page Giter VIP logo

tornis's People

Contributors

dependabot[bot] avatar jonpearse avatar olets avatar robb0wen avatar taverasmisael avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tornis's Issues

Error with SSR

Hello,
Thanks for the great work on tornis ! ๐Ÿ‘

I encounter an error using tornis with a server-side rendering app.
Indeed, tornis use the window object in his contructor but in ssr mode the window object is not defined.
I make a workaround with a bridge which give me noop function in server side and tornis in client side.

const isServer = typeof window === 'undefined'; let tornis = { watchViewport: _.noop, unwatchViewport: _.noop }; if (!isServer) { tornis = require('tornis'); } const { watchViewport, unwatchViewport } = tornis;

It will be great to add a security/condition in the constructor to avoid this kind of problem.
Do you want me to open a PR to fix this issue ?

Latency and performance

Based on this descriptor... "Rather than bind directly to native events, Tornis throttles them and captures only the bare minimum - the updated values. An optimised render loop with the requestAnimationFrame api updates the store and provides the new state to any subscribed functions. This means that your code only runs when the store has changed, and when the browser is ready to render." is the rAF itself the 'throttle' (meaning conceptually throttle) or it is using vanillaJS throttle?

I am wondering on a few of the demo examples there is >1 second latency on some variables updating most notably the velocity measurements. I stop touch/mouse movement and more than a second later it finishes updating. This could be huge in touch events. Is that due to how the velocity is calculated? Any ideas on added performance overhead using this abstraction in something like scroll usin rAF? Ever used in conjunction with a batch read/write lib like FastDOM?

Thanks so much, super interesting library.

Add Type Definitions

Hello and thanks for the great work on Tornis! ๐Ÿ‘

I would love if this project had Type Definitions in order to include it in projects using TypeScript, but I don't know your thoughts on the topic, so please let me know. I have a fork of the project and I would love to contribute with that if its something you would like and add value to the library of course.

Invoking multiple times

Hi there, I'm excited to use this super handy tool.

I was just wondering how it would perform if the package was invoked several times across components in a Gatsby/Next/Nuxt kind of SPA. Would these create performance issues at all?

Or is there a better way to handle this?

Update Babel and its presets

I noticed in package.json that Babel's version is rather obsolete. The same is about:

...
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
...

Is it possible update them without breaking library itself?

Upgrade to Babel 7

Document height not correctly detected if used in Wordpress (and a workaround)

First of all, thanks for this library, it is what I need for a little project :)

I'm integrating Tornis in Wordpress, and for testing I've imported the entire demo page in Elementor.
All is working fine, except for document height, that's not correctly detected on first load of page (value = 0).
It will be detected ONLY if you resize the window after loading, or zoom in/out.
I've tried to disable all the non essential js on Wordpress, but nothing changes.

The only workaround I've found is to modify the code and use jQuery ( document ).height(); to pass the correct value.
It's not a big problem and I don't know if it's related to how Wordpress renders the page, but maybe is a little thing that can be fixed :)

Expose the ES5 build in the package.json file

Hello,
Is it possible to add the key module in the package.json file to expose the es5 build ?
It will allow us to build our app in es5 mode.
Example : "module": "dist/tornis.es5.js",

Thanks,
Florent.

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.