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

feat(ssr): server-side rendering and client hydration #18334 #18381

Merged
merged 13 commits into from
Nov 16, 2023
Merged

Conversation

Ovilia
Copy link
Contributor

@Ovilia Ovilia commented Mar 14, 2023

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

See RFC at #18334 and demo.

Fixed issues

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

Related test cases or examples to use the new APIs

test/ssr.html

Others

Merging options

  • Please squash the commits into a single one when merging.

Other information

@echarts-bot
Copy link

echarts-bot bot commented Mar 14, 2023

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.

@echarts-bot echarts-bot bot added the PR: awaiting doc Document changes is required for this PR. label Mar 14, 2023
@echarts-bot
Copy link

echarts-bot bot commented Mar 14, 2023

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Mar 31, 2023
@Ovilia Ovilia changed the title WIP(ssr): add meta-data and test case #18334 feat(ssr): server-side rendering and client hydration #18334 Mar 31, 2023
@Ovilia Ovilia marked this pull request as ready for review March 31, 2023 07:54
src/util/innerStore.ts Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 26, 2023
@Ovilia Ovilia marked this pull request as ready for review June 27, 2023 06:21
@Ovilia Ovilia added this to the 5.5.0 milestone Jun 27, 2023
zrender.registerSSRDataGetter(el => {
const ecData = getECData(el);
const hashMap = createHashMap();
hashMap.set('series_index', ecData.seriesIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

I will suggest returning an object in this method to ensure it will be typesafe. To avoid the situation that we change the key here and forget to change where reads it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean we should define the type in ZRender? But ZRender should not know the structures like seriesIndex.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can use generic type

zrender. registerSSRDataGetter<Data>(el => ...)

Just like what getECData do

ssr/client/src/index.ts Show resolved Hide resolved
100pah
100pah previously approved these changes Nov 6, 2023
Copy link
Member

@100pah 100pah left a comment

Choose a reason for hiding this comment

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

LGTM

100pah
100pah previously approved these changes Nov 16, 2023
Copy link
Contributor

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-18381@badfd0f

@Ovilia Ovilia merged commit b07ce79 into master Nov 16, 2023
2 checks passed
@Ovilia Ovilia deleted the ssr branch November 16, 2023 08:46
Copy link

echarts-bot bot commented Nov 16, 2023

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: author is committer PR: awaiting doc Document changes is required for this PR. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants