Skip to content

Is this library compatible with Servant? #8

@Jarzka

Description

@Jarzka

Hi

I tried to use this library along with Servant. Servant makes it possible to easily use web workers or threads in ClojureScript, a very important feature in game programming. It compiles all code in to one single JS file, which helps to share context, but it has some difficulties to work with phzr, since both the main UI thread and web workers are started from the same file.

As soon as I require phzr in to my main.cljs file I cannot run it as a web worker using Servant because "document is not defined". I think this is caused by the fact that whenever I include phzr, it runs some initialisation code which calls the document object. Since this object is not defined in web worker context, I cannot include phzr in my project.

Do you have any plans to make this library "Servant compatible"? I think it should be possible to achieve by modifying the code in a way that it does nothing until some initialisation function is called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions