Server mode allows only one client framework per project

Open
#660 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, react, vite

Research direction

This is design work across the compiler, the Vite build and the server renderer, so it is not a first task. Start with how useFF picks a single framework and how the compiler reports the framework of each imported island, then read docs/rendering/islands.md and the tests/perf/ budgets. Done means a .nexy page with a React and a Svelte island hydrates both, a page without islands ships no framework bundle, and the manifest lists each island's framework.

Written by the indexing model from the issue text.

Description

area:frontend difficulty:advanced enhancement priority:2

Problem

useFF must configure exactly one frontend framework. A server page can hold an island, but every island of a project must use React, or Vue, or Svelte, or Solid, or Preact. Astro lets one page hydrate a React island and a Svelte island side by side.

This is feasible with the current stack. The compiler already knows the framework of each imported component, and Vite can emit one client entry per framework.

Proposal

  • Keep one default framework in useFF for pages and simple projects.
  • Read the framework of an island from its file extension or an explicit directive on the import.
  • Generate one client entry and one SSR worker per framework present in the project.
  • Load only the frameworks used by the page, so a text page still ships no client bundle.
  • Reject two frameworks on the same island and keep the current error for a framework route in server mode.

Acceptance

  • A .nexy page imports a React island and a Svelte island, and both hydrate with their server HTML.
  • A page with no island ships no framework bundle.
  • The generated manifest names the framework of every island.
  • Client and server hydration tests run for each adapter.
  • The startup and first page budgets of tests/perf/ do not regress.
  • docs/rendering/islands.md and the framework pages describe the rule.

Out of scope

Mixing frameworks inside a client routed page, and adding a sixth framework.

Dominant language
Python
Stars
11
Forks
6
Avg merge
2h 14m
Merged PRs (30d)
265

Getting set up

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.

More from NexyPy/nexy

All issues in NexyPy/nexy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.