sveltejs / sveltejs/kit

Support for pre-rendering individual svelte components (partial pre-rendering)

Open
#11,089 1 comment 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

size:large
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

Currently, how the rendering works is on page level, not on component level specific!
Sometimes, components such as Header, Footer or Sidebar are just needed to get re-rendered once during the time of build and never again!

Describe the proposed solution

With RSC we have cache, something similar to that maybe we can have

<script>
// from component file
export const prerender = true;
</script>
<header></header>
Alternatives considered

Alternative in front of me is to utilise the pre-render option at the page level

Importance

nice to have

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining how prerendering currently works at the page level and how component files are handled. Compare the proposed component-level prerender = true and the mentioned cache-like approach, then define behavior for components such as headers, footers, and sidebars. Done should include a documented, tested design for partial prerendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.