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 removeWindowInitialProps & fix warning in autoprefixer #5513

Merged
merged 11 commits into from
Oct 9, 2020

Conversation

ycjcl868
Copy link
Contributor

@ycjcl868 ycjcl868 commented Oct 9, 2020

增加一个配置 ssr: { removeWindowInitialProps: true },可用来隐藏 window.g_initialProps

Close #5509

Close #4734, ref 3cfc8c6

image

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

View rendered docs/config/README.md
View rendered docs/config/README.zh-CN.md

@ycjcl868 ycjcl868 changed the title feat: ssr hide initData feat: ssr hide initData & fix warning in autoprefixer Oct 9, 2020
@ycjcl868 ycjcl868 changed the title feat: ssr hide initData & fix warning in autoprefixer feat: SSR removeWindowInitialProps & fix warning in autoprefixer Oct 9, 2020
@sorrycc sorrycc merged commit 7682cf8 into master Oct 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the feat-ssr-hide-initData branch October 9, 2020 09:25
ysyzqq pushed a commit to ysyzqq/umi that referenced this pull request Oct 11, 2020
…js#5513)

* chore: upgrade serialize-javascript to 4.0

* feat: add `ssr.removeWindowInitialProps`

* fix: warning in ssr style

* chore: test use waitFor

* chore: g_useSSR

* chore: test case

* chore: test case

* chore: global window

* chore: azure

* chore: ci

* chore: cache
@feehc
Copy link

feehc commented Nov 7, 2020

添加了removeWindowInitialProps配置后,window.g_initialProps确实没有了,但是页面在客户端渲染时通过connect获取不到数据(服务端页面渲染正常),配置removeWindowInitialProps是否意味着需要单独写一个useEffect请求getInitialProps中的接口获取数据?这样的话与配置forceInitial又一样了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants