Skip to content

Improve SSR by removing Webpack dependency #115

@ipc103

Description

@ipc103

@ajhenry were investigating some issues with Server Side Rendering in the Next App. We noted that the entire page seemed to be client-side rendered, and static content wasn't preserved/cached between refreshes. It seems like there were a couple of issues:

  1. Add documentation page and banner to new users #113 added documentation by parsing markdown files at runtime. Part of this involved adding a webpack config option to the Next config to be able to read in the .md files. This appears to be causing issues with server side rendering.
  2. We also noticed that the Primer theme only ever hydrates client-side, causing certain colors to flicker on page change.

I'm proposing we do a couple things to address this:

  • Try to remove our webpack dependency. We could potentially move the Markdown -> HTML generation out of the runtime generation and into the initial compile step instead. This should improve our SSR capabilities
  • For the theme issue, look for a corresponding issue in https://github.com/primer/react/issues and open one if it doesn't exist
  • For Bonus Points: open a PR to fix the issue in Primer and update our primer/react version when accepted

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