Skip to content

Conversation

@sumanthratna
Copy link
Member

@sumanthratna sumanthratna commented Mar 10, 2021

will save us many kb

I considered using vite or wmr but neither supports prerendering out of the box so I went with preact-cli

closes #9

TODO:

@sumanthratna sumanthratna added the enhancement New feature or request label Mar 10, 2021
@sumanthratna sumanthratna self-assigned this Mar 10, 2021
@rschristian
Copy link

rschristian commented Mar 10, 2021

Just came from the linked Preact issue (sorry, was just taking a peek) but WMR does in fact come with prerendering right out of the box: https://github.com/preactjs/wmr/blob/91bc136e5c4a47c3ee3613e4d65183f4160ebe8e/packages/create-wmr/tpl/package.json#L2-L6

Linked is the pkg.json of the template that all new projects are created with. Prerendering is a flag but one we ship with.

@sumanthratna
Copy link
Member Author

sumanthratna commented Mar 10, 2021

Just came from the linked Preact issue (sorry, was just taking a peek) but WMR does in fact come with prerendering right out of the box: https://github.com/preactjs/wmr/blob/91bc136e5c4a47c3ee3613e4d65183f4160ebe8e/packages/create-wmr/tpl/package.json#L2-L6

Linked is the pkg.json of the template that all new projects are created with. Prerendering is a flag but one we ship with.

Thanks for taking a look @rschristian! :)

I read the npm README and it suggested using preact-iso instead of Preact.render so I assumed there was no out-of-the-box way to pretender Preact apps with wmr. It might help others if the --prerender flag is mentioned somewhere in the README. Thanks for letting me know though; I'll take another look at wmr.

@rschristian
Copy link

@sumanthratna

Ah, yeah. If you look that section has the header "Manual Installation and Setup". If you initialize with our template it is "out of the box" but I can see what you mean, the prerender functionality technically doesn't come with WMR itself.

I guess it's a bit of a different setup, but preact-iso was basically created to be a set of tools for WMR: prerendering, lazy loading, router, etc. WMR itself has the flag to prerender but the functionality does come from elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Bootstrap

3 participants