Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"
cache: "npm"

- name: Install Node Packages
run: npm ci

- name: Build Workloads
run: npm run build:all -- --check
14 changes: 5 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Test

on:
push:
Expand All @@ -12,7 +12,7 @@ on:
jobs:
linters:
name: Linters
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,17 +60,13 @@ jobs:
- name: Run Node Unit Tests
run: npm test

build:
name: Build
test:
name: Test
runs-on: macos-latest
strategy:
matrix:
browser: [chrome, firefox, safari]
browser: [chrome, firefox]
steps:
- name: Install Firefox
if: ${{ matrix.browser == 'firefox' }}
run: brew install --cask firefox

- name: Checkout Branch
uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"pretty:fix": "prettier --write ./",
"format": "node tests/format.mjs",
"format:all": "node tests/format.mjs --all",
"build": "node tests/build.mjs",
"build:all": "node tests/build.mjs --all",
"test:chrome": "node tests/run-unittests.mjs --browser chrome",
"test:firefox": "node tests/run-unittests.mjs --browser firefox",
"test:safari": "node tests/run-unittests.mjs --browser safari",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ export function forceLayout(body, layoutMode = "getBoundingRectAndElementFromPoi
throw Error(`Invalid layoutMode: ${layoutMode}`);
}
}

export function skipInShell(context) {
if (typeof window === "undefined" || typeof document === "undefined")
// Skip in non-browser environments
context.skip();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export class Params {
// "generate": generate a random seed
// <integer>: use the provided integer as a seed
shuffleSeed = "off";
// Param to tweak the relative complexity of all suites.
// The default is 1.0, and for suites supporting this param, the duration
// roughly scales with the complexity.
complexity = 1.0;
// Choices: "getBoundingClientRect" or "getBoundingRectAndElementFromPoint"
layoutMode = LAYOUT_MODES[0];
// Measure more workload prepare time.
Expand All @@ -49,8 +53,17 @@ export class Params {
}
}

_parseInt(value, errorMessage) {
_parseNumber(value, errorMessage, minValue = 0) {
const number = Number(value);
if (!Number.isFinite(number) && errorMessage)
throw new Error(`Invalid ${errorMessage} param: '${value}', expected Number.`);
if (number < minValue)
throw new Error(`Invalid ${errorMessage} param: '${value}', value must be >= ${minValue}.`);
return number;
}

_parseInt(value, errorMessage, minValue = 0) {
const number = this._parseNumber(value, errorMessage, minValue);
if (!Number.isInteger(number) && errorMessage)
throw new Error(`Invalid ${errorMessage} param: '${value}', expected int.`);
return parseInt(number);
Expand All @@ -71,6 +84,7 @@ export class Params {
this.warmupBeforeSync = this._parseIntParam(searchParams, "warmupBeforeSync", 0);
this.measurementMethod = this._parseEnumParam(searchParams, "measurementMethod", ["raf"]);
this.shuffleSeed = this._parseShuffleSeed(searchParams);
this.complexity = this._parserNumberParam(searchParams, "complexity", 0);
this.layoutMode = this._parseEnumParam(searchParams, "layoutMode", LAYOUT_MODES);
this.measurePrepare = this._parseBooleanParam(searchParams, "measurePrepare");
this.config = this._parseConfig(searchParams);
Expand All @@ -89,13 +103,18 @@ export class Params {
return true;
}

_parseIntParam(searchParams, paramKey, minValue) {
_parserNumberParam(searchParams, paramKey, minValue) {
if (!searchParams.has(paramKey))
return defaultParams[paramKey];
const parsedValue = this._parseNumber(searchParams.get(paramKey), "waitBeforeSync", minValue);
searchParams.delete(paramKey);
return parsedValue;
}

const parsedValue = this._parseInt(searchParams.get(paramKey), "waitBeforeSync");
if (parsedValue < minValue)
throw new Error(`Invalid ${paramKey} param: '${parsedValue}', value must be >= ${minValue}.`);
_parseIntParam(searchParams, paramKey, minValue) {
if (!searchParams.has(paramKey))
return defaultParams[paramKey];
const parsedValue = this._parseInt(searchParams.get(paramKey), "waitBeforeSync", minValue);
searchParams.delete(paramKey);
return parsedValue;
}
Expand Down Expand Up @@ -211,6 +230,10 @@ export class Params {
toSearchParams() {
return this.toSearchParamsObject().toString();
}

isDefault() {
return this === defaultParams;
}
}

function isValidJsonUrl(url) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
export const numberOfItemsToAdd = 100;
import { params } from "./params.mjs";

export const defaultNumberOfItemsToAdd = 100;
export let numberOfItemsToAdd = defaultNumberOfItemsToAdd;

export function getNumberOfItemsToAdd() {
return numberOfItemsToAdd;
}

export function handleComplexityChange() {
numberOfItemsToAdd = Math.round(defaultNumberOfItemsToAdd * params.complexity);
}
39 changes: 0 additions & 39 deletions suites-experimental/responsive-design/dist/resources.txt

This file was deleted.

1 change: 0 additions & 1 deletion suites/charts/dist/assets/chartjs-7fd89fd7.js.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions suites/charts/dist/assets/chartjs.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion suites/charts/dist/assets/developer-4ed993c7.js.map

This file was deleted.

1 change: 1 addition & 0 deletions suites/charts/dist/assets/developer.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion suites/charts/dist/assets/flights-airports-9a9e6422.js.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions suites/charts/dist/assets/flights-airports.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion suites/charts/dist/assets/index-4ed993c7.js.map

This file was deleted.

1 change: 1 addition & 0 deletions suites/charts/dist/assets/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion suites/charts/dist/assets/plot-562fbdb6.js.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions suites/charts/dist/assets/plot.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions suites/charts/dist/chartjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
align-items: center;
}
</style>
<script type="module" crossorigin src="./assets/chartjs-7fd89fd7.js"></script>
<link rel="modulepreload" crossorigin href="./assets/flights-airports-9a9e6422.js">
<script type="module" crossorigin src="./assets/chartjs.js"></script>
<link rel="modulepreload" crossorigin href="./assets/flights-airports.js">
</head>
<body>
<div id="app">
Expand Down
4 changes: 2 additions & 2 deletions suites/charts/dist/observable-plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
min-width: 30px;
}
</style>
<script type="module" crossorigin src="./assets/plot-562fbdb6.js"></script>
<link rel="modulepreload" crossorigin href="./assets/flights-airports-9a9e6422.js">
<script type="module" crossorigin src="./assets/plot.js"></script>
<link rel="modulepreload" crossorigin href="./assets/flights-airports.js">
</head>
<body>
<div id="app">
Expand Down
12 changes: 0 additions & 12 deletions suites/charts/dist/resources.txt

This file was deleted.

1 change: 0 additions & 1 deletion suites/editors/dist/assets/codemirror-521de7ab.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions suites/editors/dist/assets/codemirror.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion suites/editors/dist/assets/index.es-02a92ebc.js.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading