nuxt / nuxt/bridge

Serve modern format with bridge and vite

Open
#15 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bridge discussion vite
Dominant language
TypeScript
Stars
285
Forks
33
Avg merge
22h 38m
Merged PRs (30d)
3

Description

Currently the vite implementation in Bridge diverges somewhat from within Nuxt 3. This is a problem for a couple of different reasons.

  1. it increases the maintenance burden and doubles potential bug-surface
  2. it is misleading for people migrating to nuxt 3, because the experience and compatibility is subtly different

One example is using @vitejs/plugin-legacy. The context for using it is the need for native ES module support in browsers. Otherwise, adopting vite for Nuxt 2 would mean unsupporting browsers that historically Nuxt 2 has supported. See browser support table on MDN.

I propose we align the implementations of vite in both Bridge & Nuxt 3, including (where possible) either removing use of @vitejs/plugin-legacy or porting it to the Nuxt 3 vite implementation.


Related issues with @vitejs/plugin-legacy

  • it will be tricky to add support for dynamic base urls - seen whilst tackling nuxt/bridge#89
  • the polyfill is loaded async which means it may not have been executed before entry, leading to a fatal error: nuxt/bridge#129 - solution in separate PR

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 comparing the Vite implementations in Bridge and Nuxt 3, then review the @vitejs/plugin-legacy context and the related issues nuxt/bridge#89 and nuxt/bridge#129. Done means the implementations are aligned where possible and the listed dynamic-base-URL and asynchronous-polyfill concerns are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript, vite
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.