Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add SSR Support #40

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)

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

Successfully merging this pull request may close these issues.

None yet

3 participants