├── .gitignore ├── .prettierrc.json ├── README.md ├── apps ├── README.md └── components │ ├── .gitignore │ ├── README.md │ ├── mitosis.config.js │ ├── output │ ├── marko │ │ ├── dist │ │ └── marko.json │ └── vue │ │ └── nuxt.js │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── components │ │ ├── app-header.lite.tsx │ │ ├── dashboard.lite.tsx │ │ ├── dashboard │ │ │ ├── benchmarks.ts │ │ │ ├── framework-picker.lite.tsx │ │ │ ├── frameworks.ts │ │ │ ├── lighthouse-data.ts │ │ │ └── search.ts │ │ ├── general │ │ │ ├── accordion.lite.tsx │ │ │ ├── carousel.lite.tsx │ │ │ ├── chart.lite.tsx │ │ │ ├── code-viewer.lite.tsx │ │ │ ├── highlight.ts │ │ │ ├── lh-report-chart.lite.tsx │ │ │ ├── lh-report-table.lite.tsx │ │ │ ├── lite-picker.lite.tsx │ │ │ ├── lite-table.lite.tsx │ │ │ ├── lite-tooltip.lite.tsx │ │ │ ├── report-table.lits.tsx │ │ │ └── tabs.lite.tsx │ │ ├── hello-world.lite.tsx │ │ ├── todo-app.lite.tsx │ │ ├── todo-item.lite.tsx │ │ └── utils │ │ │ ├── generate-csv.ts │ │ │ └── sort.ts │ ├── index.ts │ ├── links.ts │ ├── reports │ │ ├── angular_simple.ts │ │ ├── astro_simple.ts │ │ ├── dashboard │ │ │ ├── angular_simple.ts │ │ │ ├── astro_simple.ts │ │ │ ├── fresh_simple.ts │ │ │ ├── gatsby_simple.ts │ │ │ ├── hydrogen_simple.ts │ │ │ ├── lit_simple.ts │ │ │ ├── marko_simple.ts │ │ │ ├── next-bun_simple.ts │ │ │ ├── next_simple.ts │ │ │ ├── nuxt2_simple.ts │ │ │ ├── nuxt3_simple.ts │ │ │ ├── qwik_simple.ts │ │ │ ├── react_simple.ts │ │ │ ├── remix_simple.ts │ │ │ ├── solid_simple.ts │ │ │ ├── svelte_simple.ts │ │ │ └── vue3_simple.ts │ │ ├── fresh_simple.ts │ │ ├── gatsby_simple.ts │ │ ├── hydrogen_simple.ts │ │ ├── lit_simple.ts │ │ ├── marko_simple.ts │ │ ├── next_simple.ts │ │ ├── nuxt2_simple.ts │ │ ├── nuxt3_simple.ts │ │ ├── qwik_simple.ts │ │ ├── react_simple.ts │ │ ├── remix_simple.ts │ │ ├── solid_simple.ts │ │ ├── svelte_simple.ts │ │ ├── todo │ │ │ ├── angular_simple.ts │ │ │ ├── astro_simple.ts │ │ │ ├── fresh_simple.ts │ │ │ ├── gatsby_simple.ts │ │ │ ├── hydrogen_simple.ts │ │ │ ├── lit_simple.ts │ │ │ ├── marko_simple.ts │ │ │ ├── next_simple.ts │ │ │ ├── nuxt2_simple.ts │ │ │ ├── nuxt3_simple.ts │ │ │ ├── qwik_simple.ts │ │ │ ├── react_simple.ts │ │ │ ├── solid_simple.ts │ │ │ ├── svelte_simple.ts │ │ │ └── vue3_simple.ts │ │ └── vue3_simple.ts │ ├── root-styles.ts │ └── utils │ │ └── map-keys.ts │ ├── tsconfig.json │ └── tsconfig.node.json ├── defaultConfig.json ├── frameworks ├── angular │ ├── .browserslistrc │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── karma.conf.js │ ├── package-lock.json │ ├── package.json │ ├── server.js │ ├── server.ts │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── app.server.module.ts │ │ │ └── typings.d.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.server.ts │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ └── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.server.json │ └── tsconfig.spec.json ├── astro │ ├── .gitignore │ ├── .npmrc │ ├── .vscode │ │ ├── extensions.json │ │ └── launch.json │ ├── README.md │ ├── astro.config.mjs │ ├── package-lock.json │ ├── package.json │ ├── public │ │ └── favicon.ico │ ├── server.mjs │ ├── src │ │ ├── layouts │ │ │ └── Layout.astro │ │ └── pages │ │ │ ├── dashboard.astro │ │ │ ├── index.astro │ │ │ └── todo.astro │ └── tsconfig.json ├── fresh │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ ├── README.md │ ├── components │ │ └── Button.tsx │ ├── deno.json │ ├── dev.ts │ ├── fresh.gen.ts │ ├── import_map.json │ ├── islands │ │ ├── Dashboard.tsx │ │ └── Todo.tsx │ ├── main.ts │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ ├── [name].tsx │ │ ├── api │ │ │ └── joke.ts │ │ ├── dashboard.tsx │ │ ├── index.tsx │ │ └── todo.tsx │ ├── static │ │ ├── favicon.ico │ │ └── logo.svg │ └── utils │ │ └── twind.ts ├── gatsby │ ├── .gitignore │ ├── README.md │ ├── gatsby-config.js │ ├── package-lock.json │ ├── package.json │ └── src │ │ └── pages │ │ ├── 404.js │ │ ├── dashboard-ssr.js │ │ ├── dashboard.js │ │ ├── index.js │ │ └── todo.js ├── hydrogen │ ├── .gitignore │ ├── README.md │ ├── hydrogen.config.js │ ├── index.html │ ├── jsconfig.json │ ├── mini-oxygen.config.json │ ├── package-lock.json │ ├── package.json │ ├── public │ │ └── .gitkeep │ ├── src │ │ ├── App.server.jsx │ │ ├── assets │ │ │ └── favicon.svg │ │ ├── components │ │ │ ├── dashboard.client.jsx │ │ │ └── todo-app.client.jsx │ │ ├── index.css │ │ └── routes │ │ │ ├── dashboard.server.jsx │ │ │ ├── index.server.jsx │ │ │ └── todo.server.jsx │ └── vite.config.js ├── lit │ ├── .eleventy.cjs │ ├── .eslintignore │ ├── .eslintrc.json │ ├── .gitignore │ ├── .prettierrc.json │ ├── .vscode │ │ └── extensions.json │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── dev │ │ ├── README.md │ │ └── index.html │ ├── docs-src │ │ ├── .eleventyignore │ │ ├── .nojekyll │ │ ├── _README.md │ │ ├── _data │ │ │ └── api.11tydata.js │ │ ├── _includes │ │ │ ├── page.11ty.cjs │ │ │ └── relative-path.cjs │ │ ├── api.11ty.cjs │ │ ├── dashboard.md │ │ ├── docs.css │ │ ├── index.md │ │ ├── install.md │ │ ├── package.json │ │ └── todo.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── rollup.config.js │ ├── server.js │ ├── sever.js │ ├── src │ │ └── typings.d.ts │ ├── tsconfig.json │ ├── web-dev-server.config.js │ └── web-test-runner.config.js ├── marko │ ├── .gitignore │ ├── README.md │ ├── dist │ ├── package-lock.json │ ├── package.json │ └── src │ │ ├── components │ │ └── app-layout │ │ │ ├── favicon.png │ │ │ └── index.marko │ │ └── pages │ │ ├── dashboard.marko │ │ ├── index.marko │ │ └── todo.marko ├── next │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── next-env.d.ts │ ├── next.config.js │ ├── package-lock.json │ ├── package.json │ ├── pages │ │ ├── _app.js │ │ ├── api │ │ │ └── hello.js │ │ ├── dashboard-ssr.js │ │ ├── dashboard.js │ │ ├── index.js │ │ └── todo.js │ ├── public │ │ ├── favicon.ico │ │ └── vercel.svg │ └── styles │ │ ├── Home.module.css │ │ └── globals.css ├── nuxt2 │ ├── .editorconfig │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc │ ├── README.md │ ├── components │ │ ├── NuxtLogo.vue │ │ └── Tutorial.vue │ ├── layouts │ │ └── default.vue │ ├── nuxt.config.js │ ├── package-lock.json │ ├── package.json │ ├── pages │ │ ├── dashboard.vue │ │ ├── index.vue │ │ └── todo.vue │ ├── static │ │ └── favicon.ico │ ├── store │ │ └── README.md │ └── tsconfig.json ├── nuxt3 │ ├── .gitignore │ ├── README.md │ ├── layouts │ │ └── default.vue │ ├── nuxt.config.ts │ ├── package-lock.json │ ├── package.json │ ├── pages │ │ ├── dashboard-ssr.vue │ │ ├── dashboard.vue │ │ ├── index.vue │ │ └── todo.vue │ └── tsconfig.json ├── preact-ssr-node │ ├── .gitignore │ ├── http.jsx │ ├── package-lock.json │ ├── package.json │ └── tsconfig.json ├── qwik │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── .prettierignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── _headers │ │ ├── favicon.ico │ │ ├── favicons │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-256x256.png │ │ │ ├── apple-touch-icon.png │ │ │ └── favicon.svg │ │ └── logos │ │ │ ├── qwik-logo.svg │ │ │ └── qwik.svg │ ├── src │ │ ├── components │ │ │ └── head │ │ │ │ └── head.tsx │ │ ├── entry.dev.tsx │ │ ├── entry.express.tsx │ │ ├── entry.http.tsx │ │ ├── entry.ssr.tsx │ │ ├── global.css │ │ ├── root.tsx │ │ ├── routes │ │ │ ├── dashboard │ │ │ │ └── index.tsx │ │ │ ├── index.tsx │ │ │ ├── layout.tsx │ │ │ └── todo │ │ │ │ └── index.tsx │ │ └── typings.d.ts │ ├── tsconfig.json │ └── vite.config.ts ├── react-ssr-bun │ ├── bun.lockb │ ├── http.js │ ├── package.json │ └── react-dom.bun.js ├── react-ssr-deno │ ├── deno.json │ ├── http.jsx │ ├── import_map.json │ └── package.json ├── react-ssr-node │ ├── .gitignore │ ├── http.jsx │ ├── package-lock.json │ ├── package.json │ └── tsconfig.json ├── react │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ ├── server.js │ └── src │ │ ├── App.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── reportWebVitals.js │ │ └── setupTests.js ├── remix │ ├── .eslintrc │ ├── .gitignore │ ├── README.md │ ├── app │ │ ├── entry.client.jsx │ │ ├── entry.server.jsx │ │ ├── root.jsx │ │ └── routes │ │ │ ├── dashboard.jsx │ │ │ ├── index.jsx │ │ │ └── todo.jsx │ ├── jsconfig.json │ ├── package-lock.json │ ├── package.json │ ├── public │ │ └── favicon.ico │ └── remix.config.js ├── solid-ssr-node │ ├── .gitignore │ ├── http.jsx │ ├── package-lock.json │ ├── package.json │ └── rollup.config.js ├── solid-start │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ └── favicon.ico │ ├── src │ │ ├── entry-client.tsx │ │ ├── entry-server.tsx │ │ ├── root.css │ │ ├── root.tsx │ │ └── routes │ │ │ ├── [...404].tsx │ │ │ ├── dashboard.tsx │ │ │ ├── index.tsx │ │ │ └── todo.tsx │ ├── tsconfig.json │ ├── vite.config.ts │ └── vite.config.ts.timestamp-1660787794719.mjs ├── svelte │ ├── .gitignore │ ├── .npmrc │ ├── .prettierignore │ ├── .prettierrc │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app.html │ │ └── routes │ │ │ ├── dashboard.svelte │ │ │ ├── index.svelte │ │ │ └── todo.svelte │ ├── static │ │ └── favicon.png │ ├── svelte.config.js │ └── vite.config.js └── vue3 │ ├── .gitignore │ ├── .vscode │ └── extensions.json │ ├── README.md │ ├── env.d.ts │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── public │ └── favicon.ico │ ├── src │ ├── App.vue │ ├── main.ts │ ├── router │ │ └── index.ts │ └── views │ │ ├── AboutView.vue │ │ └── HomeView.vue │ └── vite.config.ts ├── lh-config.json ├── package-lock.json ├── package.json ├── src ├── helpers │ ├── build.ts │ ├── get-frameworks.ts │ ├── get-js-size.ts │ ├── get-lighthouse-report.ts │ ├── get-port.ts │ ├── get-simple-report.ts │ ├── get-table.ts │ ├── install.ts │ ├── kill-process.ts │ ├── lh-config.ts │ ├── lighthouse.d.ts │ ├── preview.ts │ ├── range.ts │ └── sort-by.ts ├── scripts │ ├── build.ts │ ├── clean.ts │ ├── copy.ts │ ├── dev.ts │ ├── gen-simple-reports.ts │ ├── install.ts │ ├── kill.ts │ ├── measure-flow.ts │ ├── measure-navigation.ts │ ├── measure-ssr.ts │ ├── measure-throughput.ts │ ├── measure.ts │ └── serve.ts └── typings.d.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | debug.json 4 | report.json 5 | report.js 6 | **/generated-components/** 7 | 8 | flow.report.json 9 | flow.report.html -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /apps/README.md: -------------------------------------------------------------------------------- 1 | # Apps 2 | 3 | Small apps written in [Mitosis](https://github.com/builderio/mitosis) that get compiled and copied to the various output frameworks 4 | -------------------------------------------------------------------------------- /apps/components/.gitignore: -------------------------------------------------------------------------------- 1 | output/**/src 2 | **/reports/*.json 3 | **/reports/*.js 4 | **/reports/*.ts 5 | !**/reports/*_simple.ts 6 | **/reports/*/*.json 7 | **/reports/*/*.js 8 | **/reports/*/*.ts 9 | !**/reports/*/*_simple.ts 10 | -------------------------------------------------------------------------------- /apps/components/README.md: -------------------------------------------------------------------------------- 1 | # Components 2 | 3 | Example components written in [Mitosis](https://github.com/builderio/mitosis) to compile across frameworks to measure performance. 4 | -------------------------------------------------------------------------------- /apps/components/output/marko/dist: -------------------------------------------------------------------------------- 1 | src -------------------------------------------------------------------------------- /apps/components/output/marko/marko.json: -------------------------------------------------------------------------------- 1 | { 2 | "tags-dir": "./src/components" 3 | } 4 | -------------------------------------------------------------------------------- /apps/components/output/vue/nuxt.js: -------------------------------------------------------------------------------- 1 | import { join } from 'path'; 2 | 3 | export default function () { 4 | // Make sure components is enabled 5 | if (!this.nuxt.options.components) { 6 | throw new Error( 7 | 'Please set `components: true` inside `nuxt.config` and ensure using `nuxt >= 2.13.0`' 8 | ); 9 | } 10 | 11 | this.nuxt.hook('components:dirs', (dirs) => { 12 | // Add ./components dir to the list 13 | dirs.push({ 14 | path: join(__dirname, 'vue2/src/components'), 15 | prefix: 'builder', 16 | }); 17 | // Add ./blocks dir to the list 18 | dirs.push({ 19 | path: join(__dirname, 'vue2/src/blocks'), 20 | prefix: 'builder', 21 | pattern: '**/index.*', 22 | }); 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /apps/components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@builder.io/components", 3 | "private": true, 4 | "version": "0.0.1", 5 | "scripts": { 6 | "build": "mitosis build", 7 | "copy": "cd ../../ && npm run copy", 8 | "postbuild": "npm run copy", 9 | "start": "watch 'npm run build' ./src" 10 | }, 11 | "dependencies": { 12 | "@builder.io/mitosis": "^0.0.56-105", 13 | "@builder.io/mitosis-cli": "^0.0.17-96", 14 | "@popperjs/core": "^2.11.6", 15 | "fuse.js": "^6.6.2", 16 | "highlight.js": "^11.6.0", 17 | "lighthouse": "^9.6.5", 18 | "lodash": "^4.17.21", 19 | "shiki": "^0.11.0", 20 | "traverse": "^0.6.6", 21 | "watch": "^1.0.2" 22 | }, 23 | "devDependencies": { 24 | "@builder.io/qwik": "0.0.38", 25 | "concurrently": "^7.3.0", 26 | "react": "^18.2.0", 27 | "react-dom": "^18.2.0", 28 | "solid-js": "^1.4.5", 29 | "solid-styled-components": "^0.28.4", 30 | "sync-directory": "^5.1.7", 31 | "ts-node": "^10.9.1", 32 | "typescript": "^4.7.4", 33 | "vue": "~2.6" 34 | }, 35 | "peerDependencies": { 36 | "@builder.io/qwik": "0.0.38", 37 | "react": "^18.2.0", 38 | "react-dom": "^18.2.0", 39 | "solid-js": "^1.4.5", 40 | "solid-styled-components": "^0.28.4", 41 | "vue": "^2.6.12" 42 | }, 43 | "exports": { 44 | "./vue/nuxt": "./output/vue/nuxt.js", 45 | "./vue2": "./output/vue/vue2/src/index.js", 46 | "./vue3": "./output/vue/vue3/src/index.js", 47 | "./react": "./output/react/src/index.js", 48 | "./qwik": "./output/qwik/src/index.js", 49 | "./solid": "./output/solid/src/index.js", 50 | "./svelte": "./output/svelte/src/index.js", 51 | "./angular": "./output/angular/src/index.js", 52 | "./*": "./output/*/src/index.js" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /apps/components/src/components/dashboard.lite.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@builder.io/mitosis'; 2 | import { 3 | dashboardDataList, 4 | todoDataList, 5 | helloWorldDataList, 6 | } from './dashboard/lighthouse-data.js'; 7 | import LhReportTable from './general/lh-report-table.lite'; 8 | 9 | export default function Dashboard() { 10 | const state = useStore({}); 11 | 12 | return ( 13 |
18 | 23 | 28 | 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /apps/components/src/components/dashboard/benchmarks.ts: -------------------------------------------------------------------------------- 1 | export type Benchmark = 'todo' | 'hello world' | 'dashboard'; 2 | 3 | export const benchmarks: Benchmark[] = ['todo', 'hello world', 'dashboard']; 4 | -------------------------------------------------------------------------------- /apps/components/src/components/dashboard/framework-picker.lite.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@builder.io/mitosis'; 2 | import { Framework } from './frameworks'; 3 | import { fuse } from './search'; 4 | 5 | export interface FrameworkPickerProps { 6 | value: Framework; 7 | onChange: (framework: Framework) => void; 8 | } 9 | 10 | export default function FrameworkPicker(props: FrameworkPickerProps) { 11 | const state = useStore({ 12 | searchString: '', 13 | openDropdown: false, 14 | getFilteredResults() { 15 | return fuse.search(state.searchString); 16 | }, 17 | }); 18 | return ( 19 |
20 |
(state.openDropdown = !state.openDropdown)}> 21 | {props.value} 22 |
23 | {state.openDropdown && ( 24 |
25 | (state.searchString = event.target.value)} 28 | /> 29 | {state.getFilteredResults().map((result) => ( 30 | 40 | ))} 41 |
42 | )} 43 |
44 | ); 45 | } 46 | -------------------------------------------------------------------------------- /apps/components/src/components/dashboard/frameworks.ts: -------------------------------------------------------------------------------- 1 | export type Framework = 2 | | 'angular' 3 | | 'astro' 4 | | 'fresh' 5 | | 'gatsby' 6 | | 'hydrogen' 7 | | 'lit' 8 | | 'marko' 9 | | 'next' 10 | | 'nuxt2' 11 | | 'nuxt3' 12 | | 'qwik' 13 | | 'solid-start' 14 | | 'svelte'; 15 | 16 | export const frameworks: Framework[] = [ 17 | 'angular', 18 | 'astro', 19 | 'fresh', 20 | 'gatsby', 21 | 'hydrogen', 22 | 'lit', 23 | 'marko', 24 | 'next', 25 | 'nuxt2', 26 | 'nuxt3', 27 | 'qwik', 28 | 'solid-start', 29 | 'svelte', 30 | ]; 31 | -------------------------------------------------------------------------------- /apps/components/src/components/dashboard/search.ts: -------------------------------------------------------------------------------- 1 | import Fuse from 'fuse.js'; 2 | import { frameworks } from './frameworks'; 3 | 4 | export const fuse = new Fuse(frameworks); 5 | -------------------------------------------------------------------------------- /apps/components/src/components/general/accordion.lite.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@builder.io/mitosis'; 2 | 3 | export type AccordionProps = {}; 4 | 5 | export default function Accordion(props: AccordionProps) { 6 | const state = useStore({ 7 | activeTab: 0, 8 | }); 9 | 10 | return
{/* TODO */}
; 11 | } 12 | -------------------------------------------------------------------------------- /apps/components/src/components/general/carousel.lite.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@builder.io/mitosis'; 2 | 3 | export type CarouselProps = {}; 4 | 5 | export default function Carousel(props: CarouselProps) { 6 | const state = useStore({ 7 | activeSlide: 0, 8 | nextSlide() { 9 | state.activeSlide = state.activeSlide + 1; 10 | }, 11 | prevSlide() { 12 | state.activeSlide = state.activeSlide - 1; 13 | }, 14 | onScroll(event: UIEvent) {}, 15 | }); 16 | 17 | return ( 18 |
state.onScroll(event)} 20 | css={{ 21 | overflow: 'auto', 22 | scrollSnapType: 'x mandatory', 23 | scrollSnapAlign: 'center', 24 | }} 25 | > 26 | 33 | {/* TODO: stuff inside */} 34 | 41 |
42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /apps/components/src/components/general/chart.lite.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@builder.io/mitosis'; 2 | 3 | export interface ChartProps { 4 | data: any[]; 5 | } 6 | 7 | export default function Chart(props: ChartProps) { 8 | const state = useStore({}); 9 | return
; 10 | } 11 | -------------------------------------------------------------------------------- /apps/components/src/components/general/code-viewer.lite.tsx: -------------------------------------------------------------------------------- 1 | import { hljs } from './highlight.js'; 2 | 3 | export type CodeViewerProps = { 4 | code: string; 5 | language: 'json' | 'javascript' | 'typescript'; 6 | style?: any; 7 | }; 8 | 9 | export default function CodeViewer(props: CodeViewerProps) { 10 | return ( 11 |
34 |   );
35 | }
36 | 


--------------------------------------------------------------------------------
/apps/components/src/components/general/highlight.ts:
--------------------------------------------------------------------------------
 1 | import hljs from 'highlight.js/lib/core';
 2 | import json from 'highlight.js/lib/languages/json';
 3 | import javascript from 'highlight.js/lib/languages/javascript';
 4 | import typescript from 'highlight.js/lib/languages/typescript';
 5 | 
 6 | hljs.registerLanguage('json', json);
 7 | hljs.registerLanguage('javascript', javascript);
 8 | hljs.registerLanguage('javascript', typescript);
 9 | 
10 | export { hljs };
11 | 


--------------------------------------------------------------------------------
/apps/components/src/components/general/lh-report-chart.lite.tsx:
--------------------------------------------------------------------------------
 1 | import { useStore } from '@builder.io/mitosis';
 2 | import { LighthouseDataWithName } from '../dashboard/lighthouse-data.js';
 3 | 
 4 | export interface LhReportChartProps {
 5 |   data: LighthouseDataWithName[];
 6 | }
 7 | 
 8 | export default function LhReportChart(props: LhReportChartProps) {
 9 |   const state = useStore({
10 |     displayCols: ['ttiNumber', 'tbtNumber', 'fcpNumber'],
11 |     maxHeight: 500,
12 |     getMaxValue() {
13 |       return props.data.reduce((memo, row) => {
14 |         const ttiNumber = row.ttiNumber!;
15 |         const tbtNumber = row.tbtNumber!;
16 |         const fcpNumber = row.fcpNumber!;
17 |         return Math.max(memo, ttiNumber, tbtNumber, fcpNumber);
18 |       }, 0);
19 |     },
20 |   });
21 | 
22 |   return (
23 |     <>
24 |       
25 |
26 | {props.data.map((row) => ( 27 |
{/* Bars */}
28 | ))} 29 |
30 |
{/* Labels */}
31 |
32 | 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /apps/components/src/components/general/lite-tooltip.lite.tsx: -------------------------------------------------------------------------------- 1 | import { onUpdate, useRef, useStore } from '@builder.io/mitosis'; 2 | import { createPopper, Placement, Options } from '@popperjs/core'; 3 | 4 | export type TooltipProps = { 5 | text: string; 6 | tooltipText: string; 7 | placement?: Placement; 8 | options?: Options; 9 | }; 10 | 11 | export default function LiteTooltip(props: TooltipProps) { 12 | const state = useStore({ 13 | open: false, 14 | }); 15 | 16 | const containerRef = useRef(); 17 | const popperRef = useRef(); 18 | 19 | onUpdate(() => { 20 | if (state.open) { 21 | createPopper(containerRef, popperRef, { 22 | placement: props.placement || 'auto', 23 | ...props.options, 24 | }); 25 | } 26 | }, [state.open]); 27 | 28 | return ( 29 | (state.open = true)} 32 | onMouseLeave={() => (state.open = false)} 33 | css={{ 34 | position: 'relative', 35 | }} 36 | > 37 | {props.text} 38 | {state.open && ( 39 |
51 | {props.tooltipText} 52 |
53 | )} 54 |
55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /apps/components/src/components/general/report-table.lits.tsx: -------------------------------------------------------------------------------- 1 | export default function ReportTable() { 2 | return
; 3 | } 4 | -------------------------------------------------------------------------------- /apps/components/src/components/general/tabs.lite.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@builder.io/mitosis'; 2 | 3 | export type TabsProps = {}; 4 | 5 | export default function Tabs(props: TabsProps) { 6 | const state = useStore({ 7 | activeTab: 0, 8 | }); 9 | 10 | return
{/* TODO */}
; 11 | } 12 | -------------------------------------------------------------------------------- /apps/components/src/components/hello-world.lite.tsx: -------------------------------------------------------------------------------- 1 | export default function HelloWorld(props: { name?: string }) { 2 | return ( 3 |

9 | Hello {props.name || 'world'} 10 |

11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /apps/components/src/components/todo-item.lite.tsx: -------------------------------------------------------------------------------- 1 | import type { Todo } from './todo-app.lite'; 2 | 3 | export type TodoItemProps = { 4 | item: Todo; 5 | index: number; 6 | }; 7 | 8 | export default function TodoItem(props: TodoItemProps) { 9 | return ( 10 |
  • 20 | { 27 | props.item.completed = event.target.checked; 28 | }} 29 | /> 30 | { 36 | props.item.text = event.target.value; 37 | }} 38 | /> 39 |
  • 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /apps/components/src/components/utils/generate-csv.ts: -------------------------------------------------------------------------------- 1 | export function downloadFile(name: string, contents: string) { 2 | const link = document.createElement('a'); 3 | link.setAttribute('download', name); 4 | link.href = URL.createObjectURL( 5 | new Blob([contents], { 6 | type: 'text/csv', 7 | }) 8 | ); 9 | document.body.appendChild(link); 10 | link.click(); 11 | link.remove(); 12 | } 13 | 14 | function escapeQuote(str: string) { 15 | return String(str).replace(/"/g, '""'); 16 | } 17 | 18 | export function downloadCsv(data: any[], name = 'results.csv') { 19 | const rows = data; 20 | const keys = Object.keys(rows[0] || {}); 21 | const csv = [ 22 | keys.map((key) => `"${escapeQuote(key)}"`).join(','), 23 | ...rows.map((obj: any) => { 24 | return keys.map((key) => `"${escapeQuote(obj[key])}"`).join(','); 25 | }), 26 | ]; 27 | downloadFile(name, csv.join('\n')); 28 | } 29 | -------------------------------------------------------------------------------- /apps/components/src/components/utils/sort.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Usage: array.sort(sortBy('key')) 3 | */ 4 | export const sortBy = (key: any) => { 5 | return (a: any, b: any) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0); 6 | }; 7 | 8 | export const sortByNumeric = (key: any) => { 9 | return (a: any, b: any) => { 10 | let aVal = parseFloat(a[key]); 11 | let bVal = parseFloat(b[key]); 12 | 13 | if (isNaN(aVal)) { 14 | aVal = a[key]; 15 | } 16 | if (isNaN(bVal)) { 17 | bVal = b[key]; 18 | } 19 | 20 | return aVal > bVal ? 1 : bVal > aVal ? -1 : 0; 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /apps/components/src/index.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | export { default as ToDoApp } from './components/todo-app.lite'; 4 | export { default as HelloWorld } from './components/hello-world.lite'; 5 | export { default as AppHeader } from './components/app-header.lite'; 6 | -------------------------------------------------------------------------------- /apps/components/src/reports/angular_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 72, 3 | "totalKb": 74, 4 | "fcpDisplay": "1.5 s", 5 | "fcpNumber": 1523.7797, 6 | "tbtDisplay": "150 ms", 7 | "tbtNumber": 148.80869999999993, 8 | "ttiDisplay": "1.7 s", 9 | "ttiNumber": 1732.7797, 10 | "lcpDisplay": "1.5 s", 11 | "lcpNumber": 1523.7797, 12 | "score": 98 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/astro_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 0, 3 | "totalKb": 9, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 659.3279, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.7 s", 9 | "ttiNumber": 659.3279, 10 | "lcpDisplay": "0.7 s", 11 | "lcpNumber": 659.3279, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/angular_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 272, 3 | "totalKb": 299, 4 | "fcpDisplay": "2.6 s", 5 | "fcpNumber": 2573.346925, 6 | "tbtDisplay": "210 ms", 7 | "tbtNumber": 210, 8 | "ttiDisplay": "2.8 s", 9 | "ttiNumber": 2843.35275, 10 | "lcpDisplay": "2.6 s", 11 | "lcpNumber": 2573.346925, 12 | "score": 89 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/astro_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 3, 3 | "totalKb": 37, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 795.9838, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.9 s", 9 | "ttiNumber": 925.9676, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1130.9514, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/fresh_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 17, 3 | "totalKb": 46, 4 | "fcpDisplay": "1.1 s", 5 | "fcpNumber": 1054.1068500000001, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "1.1 s", 9 | "ttiNumber": 1054.1068500000001, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1054.1068500000001, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/gatsby_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 83, 3 | "totalKb": 88, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 759.2629999999999, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 5.5, 8 | "ttiDisplay": "1.2 s", 9 | "ttiNumber": 1191.7102499999999, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1134.2102499999999, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/hydrogen_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 44, 3 | "totalKb": 68, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 768.11625, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 792.61625, 10 | "lcpDisplay": "1.3 s", 11 | "lcpNumber": 1297.2325, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/lit_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 23, 3 | "totalKb": 25, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 752.5255999999999, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 763.0255999999999, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1129.4198, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/marko_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 24, 3 | "totalKb": 38, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 755.6697999999999, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 12.5, 8 | "ttiDisplay": "1.0 s", 9 | "ttiNumber": 1022.42215, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1133.5047, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/next-bun_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 91, 3 | "totalKb": 104, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 655.32395, 6 | "tbtDisplay": "30 ms", 7 | "tbtNumber": 31, 8 | "ttiDisplay": "2.2 s", 9 | "ttiNumber": 2215.605675, 10 | "lcpDisplay": "2.1 s", 11 | "lcpNumber": 2137.9437, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/next_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 92, 3 | "totalKb": 104, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 667.1722, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 10.5, 8 | "ttiDisplay": "1.7 s", 9 | "ttiNumber": 1678.0331999999999, 10 | "lcpDisplay": "1.2 s", 11 | "lcpNumber": 1215.4305, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/nuxt2_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 107, 3 | "totalKb": 118, 4 | "fcpDisplay": "1.4 s", 5 | "fcpNumber": 1377.138225, 6 | "tbtDisplay": "190 ms", 7 | "tbtNumber": 189, 8 | "ttiDisplay": "1.9 s", 9 | "ttiNumber": 1879.274175, 10 | "lcpDisplay": "1.4 s", 11 | "lcpNumber": 1377.138225, 12 | "score": 97 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/nuxt3_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 3784, 3 | "totalKb": 3801, 4 | "fcpDisplay": "20.8 s", 5 | "fcpNumber": 20793.972499999996, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 1, 8 | "ttiDisplay": "20.8 s", 9 | "ttiNumber": 20793.972499999996, 10 | "lcpDisplay": "21.0 s", 11 | "lcpNumber": 21011.367, 12 | "score": 45 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/qwik_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 2, 3 | "totalKb": 38, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 635.10875, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.6 s", 9 | "ttiNumber": 646.10875, 10 | "lcpDisplay": "1.5 s", 11 | "lcpNumber": 1483.9893749999997, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/react_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 187, 3 | "totalKb": 199, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 752.2442000000001, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0.5, 8 | "ttiDisplay": "2.0 s", 9 | "ttiNumber": 2025.9884000000002, 10 | "lcpDisplay": "2.4 s", 11 | "lcpNumber": 2423.17155, 12 | "score": 98 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/remix_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 71, 3 | "totalKb": 77, 4 | "fcpDisplay": "1.8 s", 5 | "fcpNumber": 1769.4123249999998, 6 | "tbtDisplay": "30 ms", 7 | "tbtNumber": 34, 8 | "ttiDisplay": "1.9 s", 9 | "ttiNumber": 1933.3054749999997, 10 | "lcpDisplay": "1.8 s", 11 | "lcpNumber": 1769.4123249999998, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/solid_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 24, 3 | "totalKb": 29, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 634.52195, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 9.5, 8 | "ttiDisplay": "0.9 s", 9 | "ttiNumber": 872.304875, 10 | "lcpDisplay": "1.3 s", 11 | "lcpNumber": 1262.60975, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/svelte_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 29, 3 | "totalKb": 35, 4 | "fcpDisplay": "1.5 s", 5 | "fcpNumber": 1542.0183499999998, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 4.5, 8 | "ttiDisplay": "1.5 s", 9 | "ttiNumber": 1542.0183499999998, 10 | "lcpDisplay": "1.5 s", 11 | "lcpNumber": 1542.0183499999998, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/dashboard/vue3_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 41, 3 | "totalKb": 50, 4 | "fcpDisplay": "1.2 s", 5 | "fcpNumber": 1206.6862, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 7.5, 8 | "ttiDisplay": "1.8 s", 9 | "ttiNumber": 1768.3650750000002, 10 | "lcpDisplay": "2.1 s", 11 | "lcpNumber": 2146.708175, 12 | "score": 94 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/fresh_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 0, 3 | "totalKb": 27, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 753.7646, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 753.7646, 10 | "lcpDisplay": "0.8 s", 11 | "lcpNumber": 753.7646, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/gatsby_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 69, 3 | "totalKb": 73, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 635.98915, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 3, 8 | "ttiDisplay": "1.4 s", 9 | "ttiNumber": 1414.96745, 10 | "lcpDisplay": "1.0 s", 11 | "lcpNumber": 982.472875, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/hydrogen_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 160, 3 | "totalKb": 172, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 641.10705, 6 | "tbtDisplay": "30 ms", 7 | "tbtNumber": 34.5, 8 | "ttiDisplay": "1.8 s", 9 | "ttiNumber": 1790.2141, 10 | "lcpDisplay": "1.6 s", 11 | "lcpNumber": 1581.2141000000001, 12 | "score": 91 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/lit_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 15, 3 | "totalKb": 16, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 639.52875, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 8.5, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 820.5574999999999, 10 | "lcpDisplay": "0.9 s", 11 | "lcpNumber": 928.8218749999999, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/marko_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 15, 3 | "totalKb": 21, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 770.1965, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 770.1965, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1090.393, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/next_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 82, 3 | "totalKb": 93, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 652.89135, 6 | "tbtDisplay": "40 ms", 7 | "tbtNumber": 43, 8 | "ttiDisplay": "2.1 s", 9 | "ttiNumber": 2067.9024249999998, 10 | "lcpDisplay": "0.8 s", 11 | "lcpNumber": 824.7827, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/nuxt2_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 93, 3 | "totalKb": 103, 4 | "fcpDisplay": "0.9 s", 5 | "fcpNumber": 916.9411249999999, 6 | "tbtDisplay": "120 ms", 7 | "tbtNumber": 119, 8 | "ttiDisplay": "1.5 s", 9 | "ttiNumber": 1546.1058, 10 | "lcpDisplay": "0.9 s", 11 | "lcpNumber": 916.9411249999999, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/nuxt3_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 122, 3 | "totalKb": 130, 4 | "fcpDisplay": "2.0 s", 5 | "fcpNumber": 2006.986875, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 12.5, 8 | "ttiDisplay": "2.0 s", 9 | "ttiNumber": 2006.986875, 10 | "lcpDisplay": "2.2 s", 11 | "lcpNumber": 2169.650625, 12 | "score": 97 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/qwik_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 0, 3 | "totalKb": 4, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 654.4676, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.7 s", 9 | "ttiNumber": 654.4676, 10 | "lcpDisplay": "0.7 s", 11 | "lcpNumber": 654.4676, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/react_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 154, 3 | "totalKb": 166, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 753.4726, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 753.4726, 10 | "lcpDisplay": "2.2 s", 11 | "lcpNumber": 2229.6815, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/remix_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 358, 3 | "totalKb": 363, 4 | "fcpDisplay": "1.3 s", 5 | "fcpNumber": 1300.179675, 6 | "tbtDisplay": "240 ms", 7 | "tbtNumber": 242, 8 | "ttiDisplay": "3.6 s", 9 | "ttiNumber": 3628.353775, 10 | "lcpDisplay": "1.3 s", 11 | "lcpNumber": 1300.179675, 12 | "score": 94 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/solid_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 16, 3 | "totalKb": 18, 4 | "fcpDisplay": "0.9 s", 5 | "fcpNumber": 866.5088750000001, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.9 s", 9 | "ttiNumber": 866.5088750000001, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1101.1124250000003, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/svelte_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 18, 3 | "totalKb": 22, 4 | "fcpDisplay": "1.5 s", 5 | "fcpNumber": 1453.37625, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "1.5 s", 9 | "ttiNumber": 1453.37625, 10 | "lcpDisplay": "1.5 s", 11 | "lcpNumber": 1453.37625, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/angular_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 72, 3 | "totalKb": 74, 4 | "fcpDisplay": "1.5 s", 5 | "fcpNumber": 1535.190575, 6 | "tbtDisplay": "30 ms", 7 | "tbtNumber": 33.91832499999998, 8 | "ttiDisplay": "1.6 s", 9 | "ttiNumber": 1634.190575, 10 | "lcpDisplay": "1.6 s", 11 | "lcpNumber": 1584.690575, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/astro_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 20, 3 | "totalKb": 32, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 642.60405, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.6 s", 9 | "ttiNumber": 642.60405, 10 | "lcpDisplay": "0.6 s", 11 | "lcpNumber": 642.60405, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/fresh_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 9, 3 | "totalKb": 37, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 754.8344999999999, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 754.8344999999999, 10 | "lcpDisplay": "0.9 s", 11 | "lcpNumber": 906.0431249999999, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/gatsby_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 70, 3 | "totalKb": 75, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 801.5748000000001, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 4, 8 | "ttiDisplay": "1.6 s", 9 | "ttiNumber": 1583.1496, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1147.0059, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/hydrogen_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 163, 3 | "totalKb": 178, 4 | "fcpDisplay": "0.6 s", 5 | "fcpNumber": 638.73715, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.6 s", 9 | "ttiNumber": 638.73715, 10 | "lcpDisplay": "1.6 s", 11 | "lcpNumber": 1582.4742999999999, 12 | "score": 91 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/lit_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 16, 3 | "totalKb": 18, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 759.2055, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 759.2055, 10 | "lcpDisplay": "1.1 s", 11 | "lcpNumber": 1066.109625, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/marko_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 17, 3 | "totalKb": 23, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 778.1565, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 8, 8 | "ttiDisplay": "1.1 s", 9 | "ttiNumber": 1057.273875, 10 | "lcpDisplay": "0.9 s", 11 | "lcpNumber": 942.2347500000001, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/next_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 83, 3 | "totalKb": 94, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 676.1899, 6 | "tbtDisplay": "110 ms", 7 | "tbtNumber": 110, 8 | "ttiDisplay": "2.2 s", 9 | "ttiNumber": 2169.0444499999994, 10 | "lcpDisplay": "0.8 s", 11 | "lcpNumber": 845.3797999999999, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/nuxt2_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 95, 3 | "totalKb": 106, 4 | "fcpDisplay": "1.0 s", 5 | "fcpNumber": 997.0992, 6 | "tbtDisplay": "40 ms", 7 | "tbtNumber": 41, 8 | "ttiDisplay": "1.6 s", 9 | "ttiNumber": 1613.0992, 10 | "lcpDisplay": "1.0 s", 11 | "lcpNumber": 997.0992, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/nuxt3_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 122, 3 | "totalKb": 131, 4 | "fcpDisplay": "2.2 s", 5 | "fcpNumber": 2166.76525, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 8.5, 8 | "ttiDisplay": "2.2 s", 9 | "ttiNumber": 2166.76525, 10 | "lcpDisplay": "2.3 s", 11 | "lcpNumber": 2260.9917750000004, 12 | "score": 96 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/qwik_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 2, 3 | "totalKb": 25, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 650.44375, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.7 s", 9 | "ttiNumber": 650.44375, 10 | "lcpDisplay": "1.2 s", 11 | "lcpNumber": 1219.053125, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/react_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 159, 3 | "totalKb": 171, 4 | "fcpDisplay": "0.8 s", 5 | "fcpNumber": 753.8594, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "0.8 s", 9 | "ttiNumber": 753.8594, 10 | "lcpDisplay": "2.2 s", 11 | "lcpNumber": 2225.6485000000002, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/solid_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 17, 3 | "totalKb": 19, 4 | "fcpDisplay": "0.7 s", 5 | "fcpNumber": 673.5325, 6 | "tbtDisplay": "40 ms", 7 | "tbtNumber": 39, 8 | "ttiDisplay": "1.0 s", 9 | "ttiNumber": 1047.3312500000002, 10 | "lcpDisplay": "1.3 s", 11 | "lcpNumber": 1316.6625000000001, 12 | "score": 86 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/svelte_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 19, 3 | "totalKb": 24, 4 | "fcpDisplay": "1.5 s", 5 | "fcpNumber": 1467.396, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 0, 8 | "ttiDisplay": "1.5 s", 9 | "ttiNumber": 1467.396, 10 | "lcpDisplay": "1.5 s", 11 | "lcpNumber": 1467.396, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/todo/vue3_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 33, 3 | "totalKb": 41, 4 | "fcpDisplay": "1.2 s", 5 | "fcpNumber": 1207.7398, 6 | "tbtDisplay": "10 ms", 7 | "tbtNumber": 8.5, 8 | "ttiDisplay": "1.2 s", 9 | "ttiNumber": 1241.2398, 10 | "lcpDisplay": "1.8 s", 11 | "lcpNumber": 1815.4796000000003, 12 | "score": 99 13 | } -------------------------------------------------------------------------------- /apps/components/src/reports/vue3_simple.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "jsKb": 31, 3 | "totalKb": 38, 4 | "fcpDisplay": "1.2 s", 5 | "fcpNumber": 1206.7486, 6 | "tbtDisplay": "0 ms", 7 | "tbtNumber": 4, 8 | "ttiDisplay": "1.2 s", 9 | "ttiNumber": 1235.7486, 10 | "lcpDisplay": "1.5 s", 11 | "lcpNumber": 1510.1228999999998, 12 | "score": 100 13 | } -------------------------------------------------------------------------------- /apps/components/src/root-styles.ts: -------------------------------------------------------------------------------- 1 | export const rootStyles = ` 2 | :root { 3 | /* Space */ 4 | --s1: 5px; 5 | --s2: calc(var(--s1) * 2); 6 | --s3: calc(var(--s1) * 4); 7 | --gray-1: #eee; 8 | --gray-2: #bbb; 9 | --gray-3: #999; 10 | --gray-4: #666; 11 | --gray-5: #333; 12 | --border-gray: 1px solid var(--gray-2); 13 | --shadow: 0 1px 5px rgba(0, 0, 0, 0.1); 14 | --shadow-2: 0 1px 10px rgba(0, 0, 0, 0.1); 15 | --round: 4px; 16 | --primary: rgb(26, 115, 232); 17 | --mobile: 640px; 18 | --font-medium: 400; 19 | } 20 | 21 | ul, ol { 22 | list-style-type: none; 23 | margin: 0; 24 | padding: 0; 25 | } 26 | 27 | body { 28 | margin: 0; 29 | font-family: Avenir, Helvetica, sans-serif; 30 | } 31 | 32 | a { 33 | text-decoration: none; 34 | } 35 | `; 36 | 37 | export const rootStylesTag = ``; 38 | -------------------------------------------------------------------------------- /apps/components/src/utils/map-keys.ts: -------------------------------------------------------------------------------- 1 | export function mapValues( 2 | obj: { [key: string]: T }, 3 | fn: (value: T, key: string) => U 4 | ): { [key: string]: U } { 5 | return Object.keys(obj).reduce((result, key) => { 6 | result[key] = fn(obj[key], key); 7 | return result; 8 | }, {} as { [key: string]: U }); 9 | } 10 | -------------------------------------------------------------------------------- /apps/components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "strict": true, 5 | "jsx": "preserve", 6 | "module": "ES2022", 7 | "moduleResolution": "node", 8 | "resolveJsonModule": true, 9 | "jsxImportSource": "@builder.io/mitosis" 10 | }, 11 | "include": ["src", "cases", "reports"], 12 | "references": [{ "path": "./tsconfig.node.json" }] 13 | } 14 | -------------------------------------------------------------------------------- /apps/components/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "CommonJS", 5 | "moduleResolution": "node", 6 | "esModuleInterop": true 7 | }, 8 | "include": ["e2e.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /frameworks/angular/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | -------------------------------------------------------------------------------- /frameworks/angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /frameworks/angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /frameworks/angular/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /frameworks/angular/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "pwa-chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /frameworks/angular/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /frameworks/angular/README.md: -------------------------------------------------------------------------------- 1 | # Angular 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.1.1. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /frameworks/angular/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/angular'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /frameworks/angular/server.js: -------------------------------------------------------------------------------- 1 | const http = require('http'); 2 | const express = require('express'); 3 | const compression = require('compression'); 4 | const path = require('path'); 5 | 6 | const app = express(); 7 | 8 | app.use(compression()); 9 | app.use(express.json()); 10 | app.use(express.static('dist/angular')); 11 | 12 | app.use('/', function (req, res) { 13 | res.sendFile(path.join(__dirname + '/dist/angular/index.html')); 14 | }); 15 | 16 | const server = http.createServer(app); 17 | const port = Number(process.env.PORT || 4200); 18 | server.listen(port); 19 | console.debug('Server is running... http://localhost:' + port); 20 | -------------------------------------------------------------------------------- /frameworks/angular/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { 6 | path: '', 7 | loadComponent: async () => 8 | (await import('./generated-components/components/hello-world')).default, 9 | }, 10 | { 11 | path: 'todo', 12 | loadComponent: async () => 13 | (await import('./generated-components/components/todo-app')).default, 14 | }, 15 | { 16 | path: 'dashboard', 17 | loadComponent: async () => 18 | (await import('./generated-components/components/dashboard')).default, 19 | }, 20 | ]; 21 | 22 | @NgModule({ 23 | imports: [ 24 | RouterModule.forRoot(routes, { 25 | initialNavigation: 'enabledBlocking', 26 | }), 27 | ], 28 | exports: [RouterModule], 29 | }) 30 | export class AppRoutingModule {} 31 | -------------------------------------------------------------------------------- /frameworks/angular/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/framework-benchmarks/1f4f42e745684e97790d3bed2f449df8da2a638e/frameworks/angular/src/app/app.component.css -------------------------------------------------------------------------------- /frameworks/angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /frameworks/angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Inject } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.css'], 8 | }) 9 | export class AppComponent { 10 | constructor(public router: Router) {} 11 | } 12 | -------------------------------------------------------------------------------- /frameworks/angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import AppHeader from './generated-components/components/app-header'; 7 | 8 | @NgModule({ 9 | declarations: [AppComponent], 10 | imports: [BrowserModule.withServerTransition({ appId: 'serverApp' }), AppRoutingModule, AppHeader], 11 | providers: [], 12 | bootstrap: [AppComponent], 13 | }) 14 | export class AppModule {} 15 | -------------------------------------------------------------------------------- /frameworks/angular/src/app/app.server.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ServerModule } from '@angular/platform-server'; 3 | 4 | import { AppModule } from './app.module'; 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | AppModule, 10 | ServerModule, 11 | ], 12 | bootstrap: [AppComponent], 13 | }) 14 | export class AppServerModule {} 15 | -------------------------------------------------------------------------------- /frameworks/angular/src/app/typings.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/framework-benchmarks/1f4f42e745684e97790d3bed2f449df8da2a638e/frameworks/angular/src/app/typings.d.ts -------------------------------------------------------------------------------- /frameworks/angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/framework-benchmarks/1f4f42e745684e97790d3bed2f449df8da2a638e/frameworks/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /frameworks/angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /frameworks/angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /frameworks/angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/framework-benchmarks/1f4f42e745684e97790d3bed2f449df8da2a638e/frameworks/angular/src/favicon.ico -------------------------------------------------------------------------------- /frameworks/angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /frameworks/angular/src/main.server.ts: -------------------------------------------------------------------------------- 1 | /*************************************************************************************************** 2 | * Initialize the server environment - for example, adding DOM built-in types to the global scope. 3 | * 4 | * NOTE: 5 | * This import must come before any imports (direct or transitive) that rely on DOM built-ins being 6 | * available, such as `@angular/elements`. 7 | */ 8 | import '@angular/platform-server/init'; 9 | 10 | import { enableProdMode } from '@angular/core'; 11 | 12 | import { environment } from './environments/environment'; 13 | 14 | if (environment.production) { 15 | enableProdMode(); 16 | } 17 | 18 | export { AppServerModule } from './app/app.server.module'; 19 | export { renderModule } from '@angular/platform-server'; 20 | -------------------------------------------------------------------------------- /frameworks/angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | function bootstrap() { 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | }; 15 | 16 | 17 | if (document.readyState === 'complete') { 18 | bootstrap(); 19 | } else { 20 | document.addEventListener('DOMContentLoaded', bootstrap); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /frameworks/angular/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /frameworks/angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | (id: string): T; 13 | keys(): string[]; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | ); 22 | 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().forEach(context); 27 | -------------------------------------------------------------------------------- /frameworks/angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app" 6 | }, 7 | "files": ["src/main.ts", "src/polyfills.ts"], 8 | "include": ["src/**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /frameworks/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": false, 9 | "noFallthroughCasesInSwitch": true, 10 | "sourceMap": true, 11 | "declaration": false, 12 | "downlevelIteration": true, 13 | "experimentalDecorators": true, 14 | "moduleResolution": "node", 15 | "importHelpers": true, 16 | "target": "es2020", 17 | "module": "es2020", 18 | "types": ["node"], 19 | "lib": ["es2020", "dom"], 20 | "paths": { 21 | "@angular/*": ["./node_modules/@angular/*"] 22 | } 23 | }, 24 | "angularCompilerOptions": { 25 | "enableI18nLegacyMessageIdFormat": false, 26 | "strictInjectionParameters": false, 27 | "strictInputAccessModifiers": false, 28 | "strictTemplates": false 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /frameworks/angular/tsconfig.server.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.app.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/server", 6 | "target": "es2019", 7 | "types": [ 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "src/main.server.ts", 13 | "server.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /frameworks/angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /frameworks/astro/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | .output/ 4 | 5 | # dependencies 6 | node_modules/ 7 | 8 | # logs 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | pnpm-debug.log* 13 | 14 | 15 | # environment variables 16 | .env 17 | .env.production 18 | 19 | # macOS-specific files 20 | .DS_Store 21 | -------------------------------------------------------------------------------- /frameworks/astro/.npmrc: -------------------------------------------------------------------------------- 1 | # Expose Astro dependencies for `pnpm` users 2 | shamefully-hoist=true 3 | -------------------------------------------------------------------------------- /frameworks/astro/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /frameworks/astro/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /frameworks/astro/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to [Astro](https://astro.build) 2 | 3 | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) 4 | 5 | > 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! 6 | 7 | ## 🚀 Project Structure 8 | 9 | Inside of your Astro project, you'll see the following folders and files: 10 | 11 | ``` 12 | / 13 | ├── public/ 14 | │ └── favicon.ico 15 | ├── src/ 16 | │ ├── components/ 17 | │ │ └── Layout.astro 18 | │ └── pages/ 19 | │ └── index.astro 20 | └── package.json 21 | ``` 22 | 23 | Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. 24 | 25 | There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components or layouts. 26 | 27 | Any static assets, like images, can be placed in the `public/` directory. 28 | 29 | ## 🧞 Commands 30 | 31 | All commands are run from the root of the project, from a terminal: 32 | 33 | | Command | Action | 34 | | :---------------- | :------------------------------------------- | 35 | | `npm install` | Installs dependencies | 36 | | `npm run dev` | Starts local dev server at `localhost:3000` | 37 | | `npm run build` | Build your production site to `./dist/` | 38 | | `npm run preview` | Preview your build locally, before deploying | 39 | 40 | ## 👀 Want to learn more? 41 | 42 | Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). 43 | -------------------------------------------------------------------------------- /frameworks/astro/astro.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'astro/config'; 2 | import solid from '@astrojs/solid-js'; 3 | import viteCompress from 'vite-plugin-compress'; 4 | import node from '@astrojs/node'; 5 | // This throws an error: 6 | // Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'node_modules/astro-compress/dist/options' 7 | // import compress from 'astro-compress'; 8 | 9 | // https://astro.build/config 10 | export default defineConfig({ 11 | server: { 12 | port: 6001, 13 | }, 14 | vite: { 15 | plugins: [viteCompress.default()], 16 | }, 17 | integrations: [solid()], 18 | adapter: node(), 19 | output: 'server', 20 | }); 21 | -------------------------------------------------------------------------------- /frameworks/astro/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/basics", 3 | "version": "0.0.1", 4 | "private": true, 5 | "port": 6001, 6 | "type": "module", 7 | "scripts": { 8 | "dev": "astro dev", 9 | "start": "astro dev", 10 | "build": "astro build", 11 | "ssg:preview": "astro preview", 12 | "preview": "node server.mjs", 13 | "bun:preview": "bun server.mjs" 14 | }, 15 | "dependencies": { 16 | "@astrojs/node": "^1.0.0", 17 | "@popperjs/core": "^2.11.6", 18 | "express": "^4.18.1", 19 | "fuse.js": "^6.6.2", 20 | "highlight.js": "^11.6.0", 21 | "vite-plugin-compress": "^2.1.1" 22 | }, 23 | "devDependencies": { 24 | "@astrojs/solid-js": "^1.0.0", 25 | "astro": "^1.0.6", 26 | "astro-compress": "^1.0.1", 27 | "solid-js": "^1.4.8" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /frameworks/astro/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/framework-benchmarks/1f4f42e745684e97790d3bed2f449df8da2a638e/frameworks/astro/public/favicon.ico -------------------------------------------------------------------------------- /frameworks/astro/server.mjs: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { handler as ssrHandler } from './dist/server/entry.mjs'; 3 | 4 | const app = express(); 5 | app.use(ssrHandler); 6 | 7 | const port = Number(process.env.PORT || 6001); 8 | app.listen(port); 9 | 10 | console.log(`Listening on http://localhost:${port}`); 11 | -------------------------------------------------------------------------------- /frameworks/astro/src/layouts/Layout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { AppHeader } from '../generated-components'; 3 | 4 | export interface Props { 5 | title?: string; 6 | } 7 | 8 | const { title } = Astro.props as Props; 9 | --- 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {title || 'Hello Astro'} 19 | 20 | 21 | 22 | {title} 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /frameworks/astro/src/pages/dashboard.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from '../layouts/Layout.astro'; 3 | import Dashboard from '../generated-components/components/dashboard.jsx'; 4 | --- 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /frameworks/astro/src/pages/index.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from '../layouts/Layout.astro'; 3 | import HelloWorld from '../generated-components/components/hello-world.jsx'; 4 | --- 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /frameworks/astro/src/pages/todo.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from '../layouts/Layout.astro'; 3 | import ToDoApp from '../generated-components/components/todo-app.jsx'; 4 | --- 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /frameworks/astro/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // Enable top-level await, and other modern ESM features. 4 | "target": "ESNext", 5 | "module": "ESNext", 6 | // Enable node-style module resolution, for things like npm package imports. 7 | "moduleResolution": "node", 8 | // Enable JSON imports. 9 | "resolveJsonModule": true, 10 | // Enable stricter transpilation for better output. 11 | "isolatedModules": true, 12 | // Add type definitions for our Astro runtime. 13 | "types": ["astro/client"] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /frameworks/fresh/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "denoland.vscode-deno" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /frameworks/fresh/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": true, 3 | "deno.lint": true, 4 | "editor.defaultFormatter": "denoland.vscode-deno" 5 | } 6 | -------------------------------------------------------------------------------- /frameworks/fresh/README.md: -------------------------------------------------------------------------------- 1 | # fresh project 2 | 3 | ### Usage 4 | 5 | Start the project: 6 | 7 | ``` 8 | deno task start 9 | ``` 10 | 11 | This will watch the project directory and restart as necessary. 12 | -------------------------------------------------------------------------------- /frameworks/fresh/components/Button.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx h */ 2 | import { h } from "preact"; 3 | import { IS_BROWSER } from "$fresh/runtime.ts"; 4 | import { tw } from "@twind"; 5 | 6 | export function Button(props: h.JSX.HTMLAttributes) { 7 | return ( 8 |