Skip to content

Problems with SSR #16

@nikcorg

Description

@nikcorg

Discussion in Slack:

[22m] joona https://gist.github.com/joona/c6e6f31f40363adbdeee43393ed76f35 -- here's a code snippet which points out the problem on SSR with NO:DOM
[20m] joona also, added the output
[19m] pakastin Ping @nikcorg 😉
[19m] joona I also tried to hack with this to get it working with tools like rewrite.
[18m] joona so I initialized window and document seprately and injected them view rewrite to the included RE:DOM module. I also tried to do reset method to reset the dom after every render, but any of those did not quite work
[17m] pakastin :redom: Do you have ideas how we could fix the issue..?
[16m] pakastin They’re globals in client-side as well, so it’s a bit tricky..
[16m] pakastin :redom: But of course it’s possible to test if window is around or not..
[15m] pakastin ..but what to do if not?
[15m] joona I guess the easiest would be to wrap redom into factory function and inject runtime values for document and window. I don't see that this can be fixed with only changing NO:DOM though...
[14m] pakastin That might work
[14m] pakastin :redom: Maybe NO:DOM could provide a factory?
[12m] joona yeah, that as well. NO:DOM also currently "leaks" previous state on the next it's "initialized". Which is of course result of the nodejs module caching
[12m] joona so I guess both would need a way to initialized them from factory
[10m] pakastin Yeah it’s a bit broken atm
[5m] joona yeah, which is understandable, because it's written for running tests and there this doesn't necessarily bite you
[<1m] nikcorg I’ll make make this into an issue and have a look later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions