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

[WIP] Experimental prerenderer #1501

Closed
wants to merge 11 commits into from
Closed

[WIP] Experimental prerenderer #1501

wants to merge 11 commits into from

Conversation

prateekbh
Copy link
Member

@prateekbh prateekbh commented Dec 14, 2020

Fixes #1482

What kind of change does this PR introduce?

Feature request.

Did you add tests for your changes?

Yes

Summary

Implements an experimental pre-renderer with a set of API for the data.

Does this PR introduce a breaking change?

No

Other information

There is some effort to keep the current templates non-breaking but the API will eventually need to be updated and can onlhy land as stable in v4.0

API
The template.html will have access to the following API

{
  options: {
    url,
    manifest,
    ssr: () => {},
    CLI_DATA: { url, ...routeData },
    webpack: {publicPath: '', asset: ['all generated assets']},
    
  }
}

@prateekbh prateekbh requested a review from a team as a code owner December 14, 2020 01:19
@changeset-bot
Copy link

changeset-bot bot commented Dec 14, 2020

⚠️ No Changeset found

Latest commit: 0b746e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@prateekbh prateekbh changed the title [WIP] Experimental prerenderer Experimental prerenderer Dec 14, 2020
@@ -0,0 +1,25 @@
const { cpus } = require('os');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put copyright here

CLI_DATA: { url, ...routeData },
webpack,
};
const htmlWebpackPlugin = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain this

@prateekbh prateekbh changed the title Experimental prerenderer [WIP] Experimental prerenderer Dec 15, 2020
@psabharwal123
Copy link
Contributor

@prateekbh can we also upgrade to html-webpack-plugin 4? https://dev.to/jantimon/html-webpack-plugin-4-has-been-released-125d

who can help review this change? would really like to try it out, our build with 100 pages takes a long time currently

@prateekbh prateekbh closed this Jun 16, 2021
@psabharwal123
Copy link
Contributor

@prateekbh why was this closed? What is the solution for builds that take a very long time?

@rschristian
Copy link
Member

@psabharwal123 Your best bet would be to move over to WMR likely. We don't have infinite resources to develop everything in parallel, and WMR has a lot more momentum as well as advantages.

@psabharwal123
Copy link
Contributor

Is there a guide to migrating from preact cli to WMR? Where can I see the advantages of it over preact-cli so I can convince our team to look into this?

@rschristian
Copy link
Member

There is no guide at the moment, nor is there a list of advantages. WMR wasn't necessarily meant to be a successor to Preact-CLI, though that's now where more effort is being spent these days. Because of that no one's really taken time to try to sell WMR as an upgraded CLI, though maybe that's something that should be done. I'll see how people feel about that.

The upgrade might be quite a bit of work, as WMR is not Webpack-based, but Rollup-based. Any plugins you've added in your preact.config.js will need to find Rollup equivalents, or you could of course write your own.

@LionsAd
Copy link

LionsAd commented Apr 10, 2022

@psabharwal123

Unfortunately the experimental renderer never did make it in, but if someone still needs a fast prerender.js script:

#1684 (comment)

@psabharwal123
Copy link
Contributor

Thanks! I ll look into it

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.

RFC: Experimental Fast renderer
4 participants