-
-
Notifications
You must be signed in to change notification settings - Fork 463
feat!: migrate runtime to Vite 8 and native Rolldown optimizer options (#320) #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thedavidweng
wants to merge
6
commits into
1weiho:main
Choose a base branch
from
thedavidweng:vite-8-migration-21be
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5a7c9d1
feat!: align core, demo, and CLI template on React 19
cursoragent 84567be
fix(web): narrow MDX ImageZoom src for React 19 img types
cursoragent 61227b6
chore: regenerate pnpm-lock.yaml against current main after React 19 …
thedavidweng 42e3270
feat!: migrate runtime to Vite 8 and native Rolldown optimizer options
cursoragent aa2258e
chore: regenerate pnpm-lock.yaml for Vite 8 against current main
thedavidweng d9c08c7
chore(template): bump @open-slide/core placeholder to ^1.0.0 per Code…
thedavidweng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@open-slide/core": major | ||
| "@open-slide/cli": major | ||
| --- | ||
|
|
||
| Require React 19 for the runtime and generated workspaces. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@open-slide/core": major | ||
| "@open-slide/cli": major | ||
| --- | ||
|
|
||
| Migrate the runtime and generated workspaces to Vite 8 with native Rolldown optimizer options. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import fs from 'node:fs/promises'; | ||
| import os from 'node:os'; | ||
| import path from 'node:path'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { createViteConfig } from './config.ts'; | ||
|
|
||
| type VirtualExternalsPlugin = { | ||
| name: string; | ||
| resolveId?: (id: string) => { id: string; external: true } | undefined; | ||
| }; | ||
|
|
||
| describe('createViteConfig', () => { | ||
| it('uses native optimizeDeps.rolldownOptions and excludes virtual modules', async () => { | ||
| const root = await fs.mkdtemp(path.join(os.tmpdir(), 'open-slide-vite-config-')); | ||
| try { | ||
| await fs.mkdir(path.join(root, 'slides'), { recursive: true }); | ||
| const config = await createViteConfig({ userCwd: root }); | ||
| const optimizeDeps = config.optimizeDeps; | ||
|
|
||
| expect(optimizeDeps).toBeDefined(); | ||
| expect(optimizeDeps).not.toHaveProperty('esbuildOptions'); | ||
|
|
||
| const plugins = optimizeDeps?.rolldownOptions?.plugins; | ||
| expect(Array.isArray(plugins)).toBe(true); | ||
|
|
||
| const plugin = (plugins as VirtualExternalsPlugin[]).find( | ||
| (entry) => entry?.name === 'open-slide:virtual-externals', | ||
| ); | ||
| expect(plugin).toBeDefined(); | ||
| expect(plugin?.resolveId?.('virtual:open-slide/slides')).toEqual({ | ||
| id: 'virtual:open-slide/slides', | ||
| external: true, | ||
| }); | ||
| expect(plugin?.resolveId?.('virtual:open-slide/config')).toEqual({ | ||
| id: 'virtual:open-slide/config', | ||
| external: true, | ||
| }); | ||
| expect(plugin?.resolveId?.('react')).toBeUndefined(); | ||
| } finally { | ||
| await fs.rm(root, { recursive: true, force: true }); | ||
| } | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: 1weiho/open-slide
Length of output: 5810
Move template package versioning out of direct edits.
packages/cli/template/package.jsonis covered by the rule prohibiting direct changes topackages/cli/template/**/{package.json,open-slide.config.ts}. Drop these direct edits and update the template via the approved source-of-truth/generation flow, or update that prohibition if it is obsolete.🤖 Prompt for AI Agents
Source: Path instructions
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: 1weiho/open-slide
Length of output: 289
🏁 Script executed:
Repository: 1weiho/open-slide
Length of output: 246
🏁 Script executed:
Repository: 1weiho/open-slide
Length of output: 2409
Publish and update the core major version in the template.
.changeset/react-19-alignment.mdand.changeset/vite-8-migration.mdboth schedule a major@open-slide/corerelease, butpackages/cli/template/package.jsonstill depends on^0.0.6whilepackages/core/package.jsonis at1.17.1. Generated workspaces will resolve the old compatibility core against the React 19/Vite 8 template; update this range to the released major built by the changesets.🤖 Prompt for AI Agents