Skip to content

feat!: migrate from Next.js to Vite - #363

Merged
jbottigliero merged 3 commits into
globus:mainfrom
tobeoj:feat/vite-migration
Jul 31, 2026
Merged

feat!: migrate from Next.js to Vite#363
jbottigliero merged 3 commits into
globus:mainfrom
tobeoj:feat/vite-migration

Conversation

@tobeoj

@tobeoj tobeoj commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates Flows IDE off Next.js onto a plain React + Vite build. This swaps only the build/routing/config layer — all runtime dependencies (Mantine, Monaco, reactflow, @globus/*) and the app's behavior are unchanged.

Why a multi-page build (no router dependency)

The app has exactly two routes: / (the IDE) and /authenticate (the OAuth2 redirect handler). Rather than pull in a client router, this uses a Vite multi-page build with two HTML entries — index.html and authenticate.html. This mirrors the former static export: GitHub Pages serves authenticate.html at /authenticate, so the existing redirect URI keeps working. The only navigations in the app were router.replace/push for full-page redirects and query-param cleanup, which map directly to history.replaceState / location.assign / location.replace.

Changes

Build & tooling

  • Removed next + eslint-config-next; added vite + @vitejs/plugin-react.
  • Scripts: devvite, buildtsc -b && vite build, added preview, linteslint ..
  • New ESLint flat config (typescript-eslint + react-hooks + react-refresh), with rule leniency matching the previous next/core-web-vitals behavior (loose any, @ts-ignore, _-prefixed unused vars, empty catch).
  • Split tsconfig into the standard Vite tsconfig.app.json / tsconfig.node.json project references; jsxreact-jsx.
  • Removed next.config.mjs, next-env.d.ts, globals.d.ts, .eslintrc.json.

Source

  • pages/_app.tsxsrc/Providers.tsx (shared providers + one-time SDK setup).
  • pages/index.tsxsrc/App.tsx; pages/authenticate.tsxsrc/AuthenticateRoute.tsx; pages/_document.tsx dropped (its markup lives in the HTML entries). Added src/main.tsx / src/authenticate.tsx entry points.
  • FlowDefinition moved from pages/index to src/flow.ts.
  • Removed "use client" directives (Next-only).

Config / env / deploy

  • Env vars renamed NEXT_PUBLIC_*VITE_*. Base path is now Vite's base (from VITE_BASE_PATH); asset URLs and the redirect URI use import.meta.env.BASE_URL.
  • SST StaticSite: output outdist, env VITE_BASE_PATH: "/".
  • GitHub Pages workflow nextjs.ymlpages.yml (builds with Vite, uploads dist); release-please.yml reference and dependabot.yml groups updated.

Verification

  • npm run build (tsc -b && vite build) — emits dist/index.html + dist/authenticate.html, assets correctly prefixed with the /flows-ide/ base, and public/ (incl. .nojekyll + schemas) copied through.
  • npm run lint — 0 errors.
  • ✅ Dev server — both routes return 200 under the /flows-ide base path.

Note: Vite warns that the Monaco chunk is >500 kB. This is pre-existing bundle weight (Monaco), not a regression; left as-is to keep this PR scoped to the migration.

🤖 Generated with Claude Code

@jbottigliero
jbottigliero force-pushed the feat/vite-migration branch from d57c5b2 to f11b62e Compare July 22, 2026 14:50
@jbottigliero jbottigliero changed the title feat: migrate from Next.js to Vite feat!: migrate from Next.js to Vite Jul 22, 2026
claude and others added 3 commits July 31, 2026 07:06
Replaces the Next.js Pages Router + static-export toolchain with a plain
React + Vite build. Runtime dependencies (Mantine, Monaco, reactflow, the
Globus SDK/components) are unchanged; only the build/routing/config layer
is swapped.

Build & tooling
- Remove `next` and `eslint-config-next`; add `vite`, `@vitejs/plugin-react`.
- Scripts: `dev` -> `vite`, `build` -> `tsc -b && vite build`, add `preview`,
  `lint` -> `eslint .` (flat config with typescript-eslint + react-hooks +
  react-refresh). Rule leniency mirrors the old `next/core-web-vitals`.
- Split tsconfig into the standard Vite `tsconfig.app.json` /
  `tsconfig.node.json` project references; `jsx` -> `react-jsx`.
- `next.config.mjs`, `next-env.d.ts`, `globals.d.ts`, `.eslintrc.json` removed.

Routing (multi-page build, no router dependency)
- Two HTML entries — `index.html` and `authenticate.html` — mirror the former
  static export. GitHub Pages serves `authenticate.html` at `/authenticate`,
  keeping the OAuth2 redirect URI working.
- `src/pages/_app.tsx` -> `src/Providers.tsx` (shared providers + one-time SDK
  setup); `pages/index.tsx` -> `App.tsx`; `pages/authenticate.tsx` ->
  `AuthenticateRoute.tsx`; `pages/_document.tsx` dropped (markup now in HTML).
- `FlowDefinition` moved to `src/flow.ts` (was exported from `pages/index`).
- `next/router` / `next/navigation` usages replaced with `history.replaceState`
  / `location.assign` / `location.replace`. `next/head` metadata moved into the
  HTML entries.

Config / env
- Env vars renamed `NEXT_PUBLIC_*` -> `VITE_*`; base path is now Vite's `base`
  (from `VITE_BASE_PATH`), and code uses `import.meta.env.BASE_URL` for assets
  and the redirect URI.
- SST `StaticSite` output `out` -> `dist`, env `VITE_BASE_PATH: "/"`.
- GitHub Pages workflow `nextjs.yml` -> `pages.yml` (Vite build, uploads
  `dist`); `release-please.yml` and `dependabot.yml` updated accordingly.

Verified: `npm run build`, `npm run lint`, and the dev server (both routes
serve 200 under the `/flows-ide` base path) all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jbottigliero
jbottigliero force-pushed the feat/vite-migration branch from f11b62e to 6441d9c Compare July 31, 2026 12:07
@jbottigliero
jbottigliero merged commit 17b4c0e into globus:main Jul 31, 2026
1 check passed
jbottigliero pushed a commit that referenced this pull request Jul 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.0.0](flows-ide-v2.1.1...flows-ide-v3.0.0)
(2026-07-31)


### ⚠ BREAKING CHANGES

* migrate from Next.js to Vite
([#363](#363))

### Features

* Improved Definition Diagram Rendering
([#373](#373))
([46fae60](46fae60))
* migrate from Next.js to Vite
([#363](#363))
([17b4c0e](17b4c0e))
* Update to latest/stable Flows Input Schema UI renderer
([#371](#371))
([b611b0d](b611b0d))


### Bug Fixes

* add flowId prop to Input Schema UI preview
([cc595ff](cc595ff))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants