Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// You don't have to add scenarios to this structure unless you want their iterations to differ from the default.
const scenarioIterations = {
export const scenarioIterations = {
MakeStyles: 50000,
FluentProviderWithTheme: 10,
};

module.exports = scenarioIterations;
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// You don't have to add scenarios to this structure unless you want their display name to differ
// from their scenario name.
const scenarioNames = {};

module.exports = scenarioNames;
export const scenarioNames = {};
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
*/

const AllRenderTypes = ['mount', 'virtual-rerender', 'virtual-rerender-with-unmount'];
const DefaultRenderTypes = ['mount'];
export const DefaultRenderTypes = ['mount'];

const scenarioRenderTypes = {
export const scenarioRenderTypes = {
FluentProviderWithTheme: AllRenderTypes,
};

module.exports = {
scenarioRenderTypes,
DefaultRenderTypes,
};
22 changes: 11 additions & 11 deletions apps/perf-test-react-components/tasks/perf-test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import fs from 'fs';
import path from 'path';
import flamegrill, { CookResults, Scenarios, ScenarioConfig, CookResult } from 'flamegrill';
import scenarioIterations from '../src/scenarioIterations';
import { scenarioIterations } from '../src/scenarioIterations';
import { scenarioRenderTypes, DefaultRenderTypes } from '../src/scenarioRenderTypes';
import { argv } from '@fluentui/scripts';

type ScenarioSetting = Record<string, { scenarioName: string; iterations: number; renderType: string }>;

// TODO: consolidate with newer version of fluent perf-test

// A high number of iterations are needed to get visualization of lower level calls that are infrequently hit by ticks.
Expand Down Expand Up @@ -145,13 +147,15 @@ export async function getPerfRegressions() {
const scenarioList = scenariosArg.length > 0 ? scenariosArg : scenariosAvailable;

const scenarios: Scenarios = {};
const scenarioSettings = {};
const scenarioSettings: ScenarioSetting = {};
scenarioList.forEach(scenarioName => {
if (!scenariosAvailable.includes(scenarioName)) {
throw new Error(`Invalid scenario: ${scenarioName}.`);
}
const iterations = iterationsArg || scenarioIterations[scenarioName] || iterationsDefault;
const renderTypes = scenarioRenderTypes[scenarioName] || DefaultRenderTypes;
const iterations =
iterationsArg || scenarioIterations[scenarioName as keyof typeof scenarioIterations] || iterationsDefault;
const renderTypes: string[] =
scenarioRenderTypes[scenarioName as keyof typeof scenarioRenderTypes] || DefaultRenderTypes;

renderTypes.forEach(renderType => {
const scenarioKey = `${scenarioName}-${renderType}`;
Expand Down Expand Up @@ -221,7 +225,7 @@ export async function getPerfRegressions() {
/**
* Create test summary based on test results.
*/
function createReport(scenarioSettings, testResults: CookResults) {
function createReport(scenarioSettings: ScenarioSetting, testResults: CookResults) {
const report = '## [Perf Analysis (`@fluentui/react-components`)](https://github.com/microsoft/fluentui/wiki/Perf-Testing)\n'

// Show only significant changes by default.
Expand All @@ -239,13 +243,9 @@ function createReport(scenarioSettings, testResults: CookResults) {
* Create a table of scenario results.
* @param showAll Show only significant results by default.
*/
function createScenarioTable(scenarioSettings, testResults: CookResults, showAll: boolean) {
function createScenarioTable(scenarioSettings: ScenarioSetting, testResults: CookResults, showAll: boolean) {
const resultsToDisplay = Object.keys(testResults).filter(
key =>
showAll ||
(testResults[key].analysis &&
testResults[key].analysis.regression &&
testResults[key].analysis.regression.isRegression),
key => showAll || testResults[key].analysis?.regression?.isRegression,
);

if (resultsToDisplay.length === 0) {
Expand Down
10 changes: 2 additions & 8 deletions apps/perf-test-react-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@
"module": "commonjs",
"jsx": "react",
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"preserveConstEnums": true,
"strictNullChecks": true,
"noImplicitAny": true,
"lib": ["es2016", "dom"],
"types": ["webpack-env"],
"skipLibCheck": true
"lib": ["ES2015", "DOM"],
Comment thread
spmonahan marked this conversation as resolved.
"types": ["webpack-env"]
},
"include": ["src"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// You don't have to add scenarios to this structure unless you want their iterations to differ from the default.
const scenarioIterations = {
export const scenarioIterations = {
DocumentCardTitle: 1000,
Breadcrumb: 1000,
CommandBar: 1000,
Expand All @@ -17,5 +17,3 @@ const scenarioIterations = {
GroupedList: 2,
GroupedListV2: 2,
};

module.exports = scenarioIterations;
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// You don't have to add scenarios to this structure unless you want their display name to differ
// from their scenario name.
const scenarioNames = {
export const scenarioNames = {
DetailsRowFast: 'DetailsRow (fast icons)',
DetailsRowNoStyles: 'DetailsRow without styles',
DocumentCardTitle: 'DocumentCardTitle with truncation',
StackWithIntrinsicChildren: 'Stack with Intrinsic children',
StackWithTextChildren: 'Stack with Text children',
};

module.exports = scenarioNames;
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
*/

const AllRenderTypes = ['mount', 'virtual-rerender', 'virtual-rerender-with-unmount'];
const DefaultRenderTypes = ['mount'];
export const DefaultRenderTypes = ['mount'];

const scenarioRenderTypes = {
export const scenarioRenderTypes = {
ThemeProvider: AllRenderTypes,
GroupedList: AllRenderTypes,
GroupedListV2: AllRenderTypes,
};

module.exports = {
scenarioRenderTypes,
DefaultRenderTypes,
};
21 changes: 10 additions & 11 deletions apps/perf-test/tasks/perf-test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import fs from 'fs';
import path from 'path';
import flamegrill, { CookResults, Scenarios, ScenarioConfig, CookResult } from 'flamegrill';
import scenarioIterations from '../src/scenarioIterations';
import { scenarioIterations } from '../src/scenarioIterations';
import { scenarioRenderTypes, DefaultRenderTypes } from '../src/scenarioRenderTypes';
import { argv } from '@fluentui/scripts';

type ScenarioSetting = Record<string, { scenarioName: string; iterations: number; renderType: string }>;
// TODO: consolidate with newer version of fluent perf-test

// A high number of iterations are needed to get visualization of lower level calls that are infrequently hit by ticks.
Expand Down Expand Up @@ -143,13 +144,15 @@ export async function getPerfRegressions() {
const scenarioList = scenariosArg.length > 0 ? scenariosArg : scenariosAvailable;

const scenarios: Scenarios = {};
const scenarioSettings = {};
const scenarioSettings: ScenarioSetting = {};
scenarioList.forEach(scenarioName => {
if (!scenariosAvailable.includes(scenarioName)) {
throw new Error(`Invalid scenario: ${scenarioName}.`);
}
const iterations = iterationsArg || scenarioIterations[scenarioName] || iterationsDefault;
const renderTypes = scenarioRenderTypes[scenarioName] || DefaultRenderTypes;
const iterations: number =
iterationsArg || scenarioIterations[scenarioName as keyof typeof scenarioIterations] || iterationsDefault;
const renderTypes: string[] =
scenarioRenderTypes[scenarioName as keyof typeof scenarioRenderTypes] || DefaultRenderTypes;

renderTypes.forEach(renderType => {
const scenarioKey = `${scenarioName}-${renderType}`;
Expand Down Expand Up @@ -217,7 +220,7 @@ export async function getPerfRegressions() {
/**
* Create test summary based on test results.
*/
function createReport(scenarioSettings, testResults: CookResults) {
function createReport(scenarioSettings: ScenarioSetting, testResults: CookResults) {
const report = '## [Perf Analysis (`@fluentui/react`)](https://github.com/microsoft/fluentui/wiki/Perf-Testing)\n'

// Show only significant changes by default.
Expand All @@ -235,13 +238,9 @@ function createReport(scenarioSettings, testResults: CookResults) {
* Create a table of scenario results.
* @param showAll Show only significant results by default.
*/
function createScenarioTable(scenarioSettings, testResults: CookResults, showAll: boolean) {
function createScenarioTable(scenarioSettings: ScenarioSetting, testResults: CookResults, showAll: boolean) {
const resultsToDisplay = Object.keys(testResults).filter(
key =>
showAll ||
(testResults[key].analysis &&
testResults[key].analysis.regression &&
testResults[key].analysis.regression.isRegression),
key => showAll || testResults[key].analysis?.regression?.isRegression,
);

if (resultsToDisplay.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion apps/public-docsite-resources/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ preset();
task('generate-json', () => generatePageJsonFiles(require('./config/api-docs')));

// copied from scripts/just.config.js with addition of generate-json
task('build', series('clean', 'copy', 'sass', 'generate-json', 'ts')).cached();
task('build', series('clean', 'copy', 'sass', 'generate-json', 'ts')).cached!();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whilst using ! is deprecated and should be avoided, this is caused by bad just types, so sticking with ! instead of nodejs standard ?

task('dev', series('copy', 'sass', 'generate-json', 'webpack-dev-server'));
2 changes: 1 addition & 1 deletion apps/public-docsite-v9/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task } from '@fluentui/scripts';

preset();

task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 2 additions & 0 deletions apps/test-bundles/just.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { preset, task, resolveCwd } from '@fluentui/scripts';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - parallel-webpack has no types

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could write types manually for this package but I decided to not do so ATM (its the only usage in whole repo)

import { run } from 'parallel-webpack';

preset();
Expand Down
2 changes: 1 addition & 1 deletion apps/ts-minbar-test-react-components/just.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { preset, task } from '@fluentui/scripts';

preset();
task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 1 addition & 1 deletion apps/ts-minbar-test-react/just.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { preset, task } from '@fluentui/scripts';

preset();
task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 1 addition & 1 deletion apps/vr-tests/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task } from '@fluentui/scripts';

preset();

task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ jobs:
yarn nx run @fluentui/nx-workspace-tools:check-graph
displayName: NX workspace lint

- script: |
# @fluentui/api-docs is used within apps/public-docsite-resources/just.config.ts thus it needs to be build in advance
yarn workspace @fluentui/api-docs build
yarn tsc -p ./tsconfig.json
displayName: Type-check just.config.ts files

- script: |
yarn check:installed-dependencies-versions
displayName: 'check packages: installed dependencies versions'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/api-docs",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/azure-themes",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/codemods",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/common-styles",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/fluent2-theme",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/jest-serializer-merge-styles",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/monaco-editor",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/react-conformance",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/react-conformance-griffel",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/react-monaco-editor",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: enable strict checking in all just-config files and their dependencies",
"packageName": "@fluentui/test-utilities",
"email": "martinhochel@microsoft.com",
"dependentChangeType": "none"
}
2 changes: 1 addition & 1 deletion packages/a11y-testing/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task } from '@fluentui/scripts';

preset();

task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 1 addition & 1 deletion packages/api-docs/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task } from '@fluentui/scripts';

preset();

task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 1 addition & 1 deletion packages/azure-themes/just.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { preset, just } from '@fluentui/scripts';
import { preset } from '@fluentui/scripts';

preset();
2 changes: 1 addition & 1 deletion packages/codemods/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task } from '@fluentui/scripts';

preset();

task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 1 addition & 1 deletion packages/common-styles/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task, series } from '@fluentui/scripts';

preset();

task('build', series('clean', 'copy')).cached();
task('build', series('clean', 'copy')).cached!();
2 changes: 1 addition & 1 deletion packages/fluent2-theme/just.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { preset, just } from '@fluentui/scripts';
import { preset } from '@fluentui/scripts';

preset();
2 changes: 1 addition & 1 deletion packages/jest-serializer-merge-styles/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { preset, task } from '@fluentui/scripts';

preset();

task('build', 'build:node-lib').cached();
task('build', 'build:node-lib').cached!();
2 changes: 1 addition & 1 deletion packages/monaco-editor/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ task('ts:postprocess', postprocessTask([...defaultLibPaths, 'esm/**/*.d.ts']));
task('ts', series(parallel('ts:esm', 'ts:commonjs'), 'ts:postprocess'));
task('eslint', eslint);

task('build', series('clean', 'copy', 'transform-css', 'ts')).cached();
task('build', series('clean', 'copy', 'transform-css', 'ts')).cached!();

task('lint', 'eslint');
Loading