Skip to content

Add SSR Support #40

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add SSR Support #40

wants to merge 1 commit into from

Conversation

Saeris
Copy link

@Saeris Saeris commented Apr 3, 2020

Added jsdom as a dependency.

In parser-markup.js, document is accessed to create a frame to render HTML in. Since document doesn't exist in Node, this causes SSR builds to throw a reference error. With this change, we check for the existence of document and polyfill it using jsdom if it doesn't exist.

Added `jsdom` as a dependency.

In parser-markup.js, `document` is accessed to create a frame to render HTML in. Since `document` doesn't exist in Node, this causes SSR builds to throw a reference error. With this change, we check for the existence of `document` and polyfill it using `jsdom` if it doesn't exist.
@developit
Copy link
Owner

This is going to inline jsdom in all bundlers.

I think we'll need to provide a separate entry module for web/node in order to do the polyfilling.

@danielweck
Copy link

There are several PR proposals (plus one that was closed without resolution), so I wrote a quick heads-up: #6 (comment)
(Preact WMR uses JSDOM in its Mardown render code)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants