From 820a28c0570a91c214bef9f20b220879fb6809af Mon Sep 17 00:00:00 2001 From: mb21 Date: Mon, 23 Nov 2026 13:22:37 +0100 Subject: [PATCH 1/3] Add mastro-starter --- packages/docs/src/content/docs/methodology.md | 6 + packages/results/src/benchmark-types.ts | 2 + packages/results/src/frameworks-config.ts | 18 ++ packages/starter-mastro/.gitignore | 4 + .../starter-mastro/.vscode/extensions.json | 3 + packages/starter-mastro/.vscode/launch.json | 12 + packages/starter-mastro/AGENTS.md | 20 ++ packages/starter-mastro/README.md | 32 +++ packages/starter-mastro/components/Layout.ts | 21 ++ .../first-party-dependencies.json | 6 + packages/starter-mastro/package.json | 24 ++ packages/starter-mastro/pnpm-lock.yaml | 261 ++++++++++++++++++ packages/starter-mastro/pnpm-workspace.yaml | 4 + .../starter-mastro/routes/index.server.ts | 10 + packages/starter-mastro/routes/styles.css | 26 ++ packages/starter-mastro/server.ts | 9 + packages/starter-mastro/tsconfig.json | 17 ++ 17 files changed, 475 insertions(+) create mode 100644 packages/starter-mastro/.gitignore create mode 100644 packages/starter-mastro/.vscode/extensions.json create mode 100644 packages/starter-mastro/.vscode/launch.json create mode 100644 packages/starter-mastro/AGENTS.md create mode 100644 packages/starter-mastro/README.md create mode 100644 packages/starter-mastro/components/Layout.ts create mode 100644 packages/starter-mastro/first-party-dependencies.json create mode 100644 packages/starter-mastro/package.json create mode 100644 packages/starter-mastro/pnpm-lock.yaml create mode 100644 packages/starter-mastro/pnpm-workspace.yaml create mode 100644 packages/starter-mastro/routes/index.server.ts create mode 100644 packages/starter-mastro/routes/styles.css create mode 100644 packages/starter-mastro/server.ts create mode 100644 packages/starter-mastro/tsconfig.json diff --git a/packages/docs/src/content/docs/methodology.md b/packages/docs/src/content/docs/methodology.md index c15d8cfbd..ab8ed8c28 100644 --- a/packages/docs/src/content/docs/methodology.md +++ b/packages/docs/src/content/docs/methodology.md @@ -60,6 +60,7 @@ runtime configuration details are described in Framework Specific Notes. | Framework | UI library | Bundler / build tool | Adapter / server | | -------------- | ------------------------------------ | ---------------------------- | ------------------- | | Astro | Astro; React for client-only content | Vite (via Astro) | Node adapter | +| Mastro | Mastro HTML templates | No build step | Not benchmarked | | Next.js | React | Turbopack (via `next build`) | Next.js server | | Nuxt | Vue | Vite (via Nuxt) | Nitro | | Pracht | Preact | Vite | Node adapter | @@ -87,6 +88,7 @@ of a typical new project. Current pinned dependencies are listed in each project's `package.json`: - [Astro](https://github.com/e18e/framework-performance/blob/main/packages/starter-astro/package.json) +- [Mastro](https://github.com/e18e/framework-performance/blob/main/packages/starter-mastro/package.json) - [Next.js](https://github.com/e18e/framework-performance/blob/main/packages/starter-next-js/package.json) - [Nuxt](https://github.com/e18e/framework-performance/blob/main/packages/starter-nuxt/package.json) - [Pracht](https://github.com/e18e/framework-performance/blob/main/packages/starter-pracht/package.json) @@ -130,6 +132,10 @@ Turbopack is the default build tool. Tailwind CSS uses its native Turbopack load without a PostCSS configuration. The starter retains the template's Geist fonts, fetched through `next/font/google`, and its page and layout classes. +#### Mastro + +Default basic starter from `pnpm create @mastrojs/mastro@latest` + #### Nuxt The starter keeps Nuxt's default welcome screen, enables devtools, and uses the diff --git a/packages/results/src/benchmark-types.ts b/packages/results/src/benchmark-types.ts index c28d2137e..1f6a6bdd4 100644 --- a/packages/results/src/benchmark-types.ts +++ b/packages/results/src/benchmark-types.ts @@ -1,6 +1,7 @@ export const FrameworkOptions = [ 'baseline-html', 'astro', + 'mastro', 'next', 'nuxt', 'pracht', @@ -17,6 +18,7 @@ export const PackagePathOptions = [ 'packages/app-baseline-html', 'packages/starter-astro', 'packages/app-astro', + 'packages/starter-mastro', 'packages/starter-next-js', 'packages/app-next-js', 'packages/starter-nuxt', diff --git a/packages/results/src/frameworks-config.ts b/packages/results/src/frameworks-config.ts index d6e783ed8..5b779b96b 100644 --- a/packages/results/src/frameworks-config.ts +++ b/packages/results/src/frameworks-config.ts @@ -65,6 +65,24 @@ export const frameworksConfig = [ buildOutputDir: 'dist', }, }, + { + name: 'mastro', + displayName: 'Mastro', + frameworkPackage: '@mastrojs/mastro', + starter: { + package: 'starter-mastro', + buildScript: 'generate', + buildOutputDir: 'generated', + devServerPort: 3000, + measurements: [ + 'install', + 'build', + 'devServer', + 'dependencies', + 'browserBaseline', + ], + }, + }, { name: 'next', displayName: 'Next.js', diff --git a/packages/starter-mastro/.gitignore b/packages/starter-mastro/.gitignore new file mode 100644 index 000000000..8d04a108f --- /dev/null +++ b/packages/starter-mastro/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +node_modules/ +/generated/ +/generatedAssets.json diff --git a/packages/starter-mastro/.vscode/extensions.json b/packages/starter-mastro/.vscode/extensions.json new file mode 100644 index 000000000..74a66e8b7 --- /dev/null +++ b/packages/starter-mastro/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["ms-fast.fast-tagged-templates"] +} diff --git a/packages/starter-mastro/.vscode/launch.json b/packages/starter-mastro/.vscode/launch.json new file mode 100644 index 000000000..632de88f2 --- /dev/null +++ b/packages/starter-mastro/.vscode/launch.json @@ -0,0 +1,12 @@ +{ + // Run and debug config, see https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Start server", + "command": "pnpm run dev", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/packages/starter-mastro/AGENTS.md b/packages/starter-mastro/AGENTS.md new file mode 100644 index 000000000..215c2d5d3 --- /dev/null +++ b/packages/starter-mastro/AGENTS.md @@ -0,0 +1,20 @@ +We're using the Mastro web framework. + +- Use web search with `site:mastrojs.github.io` to look up Mastro docs. +- Use web search with `site:developer.mozilla.org` to look up web platform + features (or the [modern-web-guidance](https://developer.chrome.com/docs/modern-web-guidance) skills). + Use web APIs if they are "Baseline Widely available". +- Write semantic HTML. +- CSS + - Never add inline CSS + - Avoid adding classes if you can use HTML element selectors + - Use a [two-layer approach](https://theadminbar.com/semantics-and-primitives-color-system/) + for CSS variables (primitives like `--blue: #0000ff`, + and semantics like `--link-color: var(--blue)`). + - Ask the user whether they want to only have a single global + [styles.css](routes/styles.css) file (good for smaller projects), + or whether they want to colocate CSS files with their HTML + in [components](components/) and if so + [which approach they prefer](https://mastrojs.github.io/blog/2026-05-26-component-scoped-css-without-build-step/) +- Only use [client-side JavaScript](https://mastrojs.github.io/guide/interactivity-with-javascript-in-the-browser/) + if absolutely necessary. If so, use `