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

Removed staticMarkup option from docs. #722

Closed
ehtb opened this issue Jan 10, 2017 · 7 comments
Closed

Removed staticMarkup option from docs. #722

ehtb opened this issue Jan 10, 2017 · 7 comments

Comments

@ehtb
Copy link

ehtb commented Jan 10, 2017

684cc25 reverted the documented feature to render static HTML (staticMarkup) without any additional info.

Does this mean it will be deprecated in the future? The reason I am asking is because I want to render an AMP page and this could be the right direction. Although this is a setting that can better be handled on the page level: app.renderToHTML(req, res, pagePath, queryParams, {staticMarkup:true}).

Perhaps if not, this could be added as an example (happy to do that), just because the setting is a bit hidden.

@arunoda
Copy link
Contributor

arunoda commented Jan 10, 2017

@ehtb for the AMP page, I assume you could use our custom document support as well.
See: https://github.com/zeit/next.js#custom-document

ehtb added a commit to ehtb/next.js that referenced this issue Jan 10, 2017
See vercel#722 as well, but I can imagine more use cases.
@ehtb
Copy link
Author

ehtb commented Jan 10, 2017

@arunoda Thanks for the tip, that sounds very interesting as well!
I am looking for a hybrid solution where both the regular as well as the amp pages are served from the same app, since they are still tightly coupled.

I've created a pr which allows overriding the default render options per render request (renderToHTML).

This allows for instance:

server.get('/blog-amp/:id', (req, res) => {
  app.renderToHTML(req, res, '/blog-amp', {}, { staticMarkup: true })
})

server.get('/blog/:id', (req, res) => {
  app.renderToHTML(req, res, '/blog', {})
})

@arunoda
Copy link
Contributor

arunoda commented Jan 11, 2017

I'm not sure about the state of the staticMarkup option.
Let's ask from @nkzawa or @rauchg

@nkzawa
Copy link
Contributor

nkzawa commented Jan 11, 2017

I added staticMarkup just for testing and it's a private option. I'm not sure other use cases like AMP.

@timneutkens
Copy link
Member

@ehtb could you have a look at #793 since it involves AMP 👍

@timneutkens
Copy link
Member

timneutkens commented Feb 7, 2017

Closing in favor of the AMP example. Please re-open if needed ❤️

@attapurposevc
Copy link

I would like to reopen this. Here is my pull request #3589

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants