This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Restore getDataFromTree(rootElement, rootContext) API.#2586
Merged
Conversation
In [email protected], the rootContext parameter was replaced by the custom renderFunction parameter, which was a breaking change: #2533 (comment) This commit restores the previous API, while providing an alternative API that is more flexible and more accurately named: getMarkupFromTree. If you want to specify a custom rendering function, you should now use getMarkupFromTree instead of getDataFromTree: import { getMarkupFromTree } from "react-apollo"; import { renderToString } from "react-dom/server"; getMarkupFromTree({ tree: <App/>, // optional; defaults to {} context: { ... }, // optional; defaults to renderToStaticMarkup renderFunction: renderToString, }).then(markup => { // Use the markup returned by the final rendering... }); Hopefully, since [email protected] was never assigned the `latest` tag on npm, we can push this change without another minor version bump. cc @evenchange4 @hwillson
|
Hi @benjamn - thanks for your hard work on the SSR support. Are you publishing this version soon to |
Member
Author
|
@csantos1113 It's published now as version 2.3.1, though it's still using the |
|
@benjamn - thank you! Just FYI, seems that you also pointed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
[email protected], therootContextparameter was replaced by the customrenderFunctionparameter, which was a breaking change: #2533 (comment)This commit restores the previous API, while providing an alternative API that is more flexible and more accurately named:
getMarkupFromTreeIf you want to specify a custom rendering function, you should now use
getMarkupFromTreeinstead ofgetDataFromTree:Hopefully, since
[email protected]was never assigned thelatesttag on npm, we can push this change without another minor version bump (likely 2.3.1).cc @evenchange4 @hwillson