Code Monkey home page Code Monkey logo

via.js's People

Contributors

ashleyscirra avatar guest271314 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

via.js's Issues

Limitation: event.preventDefault()

Hi there!

I thought about outsourcing rendering of React components into web workers a lot last year, and there was one issue I couldn't really solve. It might help you to know about this limitation when accessing the DOM from within web workers :)

event.preventDefault()

If the click handler resides in the web worker, then it will be invoked asynchronously. Unfortunately, due to its very nature, event.preventDefault() and event.stopPropagation() have to be called synchronously in order to work.

event.stopPropagation() might be worked around by using event delegation, but I don't see a good solution for event.preventDefault(). You could only highlight the DOM node / the event listener to always prevent default behavior, so the call happens immediately in the main thread. But a conditional preventDefault() is then not possible.

Hope you can make some use of that!

Btw, keep me posted if you have a good idea how to approach this issue ๐Ÿ˜Š

'via' is not defined

I am using via.js in a React (CRA) context in order to do some DOM manipulation in web workers. In the docs we can see this example:

const document = via.document;
const button = document.createElement("button");

However, I cannot instance nor access any via object with which to work. I am importing the four source files (receiver, controller, object, property). Probs I am missing something :)

Thanks!

WeakMap and WeakSet are now a thing!

Hi !
I just stumbled upon your project, it looks cool. Never something I'll be allowed to use at work but definitely something I'd love to play with. Do you have any plans on updating it to use the new WeakMap and WeakSet objects? I see that you already reserved the space for it in WeakFactory and it doesn't seem too out there to implement!
Cheers

How to display DOM in browser window?

Do you have an example of how to load a blob of html/js/css into a virtual dom running in a web worker, but to then display the virtual DOM in the browser?

I assume this could be done by syncronising the virtual dom with a real DOM element?

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.