-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bad362d
Showing
17 changed files
with
5,609 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Metric and Commit Results | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Runs at 00:00 UTC every day | ||
workflow_dispatch: # Allows manual triggering of the workflow | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.10.5 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' # Specify the Node.js version you need | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pnpm install -r | ||
- name: Run benchmarks | ||
run: | | ||
pnpm build | ||
node scripts/index.mjs # Replace with your script name | ||
- name: Commit benchmark results | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add metric.json | ||
git commit -m "Update benchmark results" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules/ | ||
test.* | ||
|
||
packages/**/*-dist | ||
.parcel-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{"case":"basic","metric":"production build size","timestamp":1719159755626,"commit":"","unit":"byte","records":{"parcel":108014,"esbuild":56420,"rolldown":54640,"webpack":101987}} | ||
{"case":"basic","metric":"production build size","timestamp":1719159759103,"commit":"","unit":"byte","records":{"parcel":108014,"esbuild":56420,"rolldown":54640,"webpack":101987}} | ||
{"case":"basic","metric":"production build size","timestamp":1719159802052,"commit":"","unit":"byte","records":{"parcel":108014,"esbuild":56420,"rolldown":54640,"webpack":101987}} | ||
{"case":"basic","metric":"production build size","timestamp":1719159817008,"commit":"","unit":"byte","records":{"parcel":108546,"esbuild":56675,"rolldown":54901,"webpack":102545}} | ||
{"case":"basic","metric":"production build size","timestamp":1719163440149,"commit":"","unit":"byte","records":{"parcel":108546,"esbuild":56675,"rolldown":54901,"webpack":102545}} | ||
{"case":"basic","metric":"production build size","timestamp":1719164457189,"commit":"","unit":"byte","records":{"parcel":108546,"esbuild":56675,"rolldown":54901,"webpack":102545}} | ||
{"case":"basic","metric":"production build size","timestamp":1719164758794,"commit":"","unit":"byte","records":{"parcel":108546,"esbuild":56675,"rolldown":54901,"webpack":102545}} | ||
{"case":"basic","metric":"production build size","timestamp":1719168038940,"commit":"","unit":"byte","records":{"parcel":108546,"esbuild":56675,"rolldown":54901,"webpack":102545}} | ||
{"case":"basic","metric":"production build size","timestamp":1719168239360,"commit":"","unit":"byte","records":{"parcel":108546,"esbuild":56675,"rolldown":54901,"webpack":102545}} | ||
{"case":"react-fluent-hydration","metric":"production build size","timestamp":1719168239360,"commit":"","unit":"byte","records":{"parcel":590683,"esbuild":1289079,"rolldown":1248111,"webpack":336271}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"devDependencies": { | ||
"esbuild": "^0.21.5", | ||
"glob": "^10.4.2", | ||
"parcel": "^2.12.0", | ||
"rolldown": "0.10.4-snapshot-0d15f0e-20240620002606", | ||
"vite": "^5.3.1", | ||
"webpack": "^5.92.1", | ||
"webpack-cli": "^5.1.4" | ||
}, | ||
"scripts": { | ||
"build": "pnpm run -r build" | ||
}, | ||
"packageManager": "[email protected]+sha1.4370a069f21873a0ad83c785b8048ed8caf6e6e9" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"scripts": { | ||
"build:webpack": "webpack", | ||
"build:esbuild": "esbuild src/index.js --bundle --outfile=esbuild-dist/index.js", | ||
"build:parcel": "parcel build src/index.js --dist-dir parcel-dist --no-source-maps --no-cache --no-optimize", | ||
"build:rolldown": "rolldown --config ./rolldown.config.mjs", | ||
"build": "pnpm run /build:.*/" | ||
}, | ||
"dependencies": { | ||
"lodash-es": "^4.17.21" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'rolldown' | ||
|
||
export default defineConfig({ | ||
input: './src/index.js', | ||
resolve: { | ||
// This needs to be explicitly set for now because oxc resolver doesn't | ||
// assume default exports conditions. Rolldown will ship with a default that | ||
// aligns with Vite in the future. | ||
conditionNames: ['import'], | ||
}, | ||
output: { | ||
dir: "rolldown-dist" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { groupBy, last } from "lodash-es"; | ||
|
||
const list = [ | ||
{ | ||
name: "jack", | ||
age: 20 | ||
}, | ||
{ | ||
name: "a", | ||
age: 30 | ||
}, | ||
{ | ||
name: "b", | ||
age: 30 | ||
} | ||
] | ||
|
||
groupBy(list, (item) => { | ||
last(); | ||
return item.age | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const path = require('path') | ||
/**@type {import("webpack").Configuration}*/ | ||
module.exports = { | ||
mode: "production", | ||
entry: { | ||
"main": "./src/index.js" | ||
}, | ||
optimization: { | ||
minimize: false, | ||
mangleExports: false | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, "webpack-dist") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>React Fluent</title> | ||
</head> | ||
<body> | ||
<example-app></example-app> | ||
<script type="module" src="react-fluent.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"scripts": { | ||
"build:esbuild": "esbuild src/index.jsx --bundle --outfile=esbuild-dist/index.js", | ||
"build:parcel": "parcel build src/index.jsx --dist-dir parcel-dist --no-source-maps --no-cache --no-optimize", | ||
"build:rolldown": "rolldown --config ./rolldown.config.mjs", | ||
"build:webpack": "webpack", | ||
"build": "pnpm run /build:.*/" | ||
}, | ||
"dependencies": { | ||
"@fluentui/react-components": "^9.54.2", | ||
"lodash-es": "^4.17.21", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@swc/core": "^1.6.5", | ||
"swc-loader": "^0.2.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'rolldown' | ||
|
||
export default defineConfig({ | ||
input: './src/index.jsx', | ||
resolve: { | ||
// This needs to be explicitly set for now because oxc resolver doesn't | ||
// assume default exports conditions. Rolldown will ship with a default that | ||
// aligns with Vite in the future. | ||
conditionNames: ['import'], | ||
}, | ||
output: { | ||
dir: "rolldown-dist" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react' | ||
import { hydrateRoot} from 'react-dom/client' | ||
import { FluentProvider, teamsLightTheme, Button } from '@fluentui/react-components' | ||
|
||
function ExampleApp() { | ||
return <FluentProvider theme={teamsLightTheme}> | ||
<Button>Fluent React</Button> | ||
</FluentProvider> | ||
} | ||
|
||
const container = document.querySelector('example-app') | ||
hydrateRoot(container, <ExampleApp />) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const path = require("path"); | ||
/**@type {import("webpack").Configuration}*/ | ||
module.exports = { | ||
mode: "production", | ||
entry: { | ||
main: "./src/index.jsx", | ||
}, | ||
optimization: { | ||
minimize: false, | ||
mangleExports: false, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.jsx$/, | ||
exclude: /(node_modules|bower_components)/, | ||
use: { | ||
// Use `.swcrc` to configure swc | ||
loader: "swc-loader", | ||
options: { | ||
// This makes swc-loader invoke swc synchronously. | ||
sync: true, | ||
jsc: { | ||
parser: { | ||
jsx: true | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, "webpack-dist"), | ||
}, | ||
}; |
Oops, something went wrong.