Skip to content

server side rendering? #217

Description

@jantimon

does fre provide ssr and hydration like preact and react?

Activity

  1. yisar commented on Jan 8, 2021

    @yisar
    Member

    I do have a good idea to do SSR, but it's not easy

    Do you know react server component? It has no states and events and does not need hydration.

    In the past, SSR traverses vdom to generate html strings, which has poor performance in the server.

    But if we compile JSX into bytecodes, there will be a great performance improvement.

    This is feasible on the premise that the component is the same as the server component and has no state.

    In other words, we can do ssr of server component at the same time, which has four advantages:

    1. Efficient bytecode

    2. Because the server component has no state, it doesn't need to hydration.

    3. Smaller bundle size.

    4. If we can learn from angular ivy, we can do more tree shaking.

    https://github.com/trueadm/react-compiler/blob/master/browser-sandbox/build/compiled-bundle.js

    @trueadm has done similar work, and I'd like to try it. Maybe it's a good idea.

  2. yisar commented on Apr 19, 2021

    @yisar
    Member

    @jantimon I am paying close attention to react fizz. Its implementation is very interesting and suitable for fre.
    https://github.com/facebook/react/tree/master/packages/react-server

  3. jantimon commented on Apr 19, 2021

    @jantimon
    Author

    cool :) looking forward on your findings

  4. tomByrer commented on May 28, 2021

    @tomByrer

    Any new ideas yet?

  5. yisar commented on May 28, 2021

    @yisar
    Member

    @tomByrer I do have a lot of ideas here, but it takes time and I may need a summer vacation.

    1. Streaming rendering, which is the most important, enables SSR to support suspend interaction.

    react/react#20970

    1. ESR, Deploying in cloudflare worker, and developing in labor

    I'm a little busy recently, so the progress will be slow. If someone helps me, that would be great. Thank you.

  6. snakeUni commented on Jun 1, 2021

    @snakeUni

    In the past, SSR traverses vdom to generate html strings, which has poor performance in the server.

    are there some poor performance examples about renderToString?

  7. yisar commented on Jul 24, 2025

    @yisar
    Member

    Halo everyone, I'm back. I disappeared for four years for my studies. I have roughly supported hydration now, and the next step is to implement fre server component, which is more suitable for fre's context than imagined.
    If you are more interested in SSR, I think recoverable hydration would be better. asta is just a half-finished product, which is not easy to achieve in fre.

    https://github.com/yisar/asta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions