Skip to content

Commit

Permalink
Update Docusaurus to v3, initial pruning of docs and setup for FASTEl…
Browse files Browse the repository at this point in the history
…ement 2.0.0 (#6947)

# Pull Request

## 📖 Description

This pull request does the following:
- Updates docusaurus to v3
    - This necessatated some editing of the docs as they were not compliant with the `mdx` format, a document checker has been added to the package.json scripts
- Remove docs in v2.0.0 that had links to documents that will not be included in the v2.0.0 documentation site
- Rename "legacy" to 1.0.0 for clarity (this still includes documentation for removed packages but documentation site going forward will only refer to the `@microsoft/fast-element` package version and document that package).
- Removal and simplification of some legacy React components made for Docusaurus.
- Some decoupling from dependencies in the mono-repository, these are all `devDependencies`, simple configuration updates, or small TypeScript changes.

## 👩‍💻 Reviewer Notes

This is only the initial step to get the documentation site to be versioned, have a limited `@microsoft/fast-element` documentation, and be on the latest docusaurus version. Still needed is updating the documentation itself, this will occur in future PRs prior to versioning `@microsoft/fast-element` to 2.0.0.

Edit: One of the issues with this update is that any updates to the package dependencies is very difficult (to put it mildly), yarn 1 does not react appropriately to nohoisting and fixing versions with "resolution" in the root level package.json has over time caused a bit of a rats nest. This has caused me to have to change some of the tsconfig files and skip the foundation toolbar tests as well as explicitly fix and add certain package dependencies to force packages to build and test correctly. Please look at the changes with a critical eye, but know that many of these changes were done only to get this change in, and that there are plans to upgrade to npm and remove yarn as a dependency after some cleanup to the project which will make that process much easier.

## ✅ Checklist

### General

- [ ] I have included a change request file using `$ yarn change`
- [ ] I have added tests for my changes.
- [x] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](/docs/community/code-of-conduct/#our-standards) for this project.
  • Loading branch information
janechu authored May 9, 2024
1 parent 4998650 commit 4b23b5c
Show file tree
Hide file tree
Showing 1,757 changed files with 8,246 additions and 9,147 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "TypeScript update",
"packageName": "@microsoft/fast-colors",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Remove redundant docs and upgrade Docusaurus to v3, enable versioned docs",
"packageName": "@microsoft/fast-element",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Added missing types",
"packageName": "@microsoft/fast-foundation",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "DevDependency update",
"packageName": "@microsoft/fast-react-wrapper",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "DevDependency update",
"packageName": "@microsoft/fast-router",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "tslib updated to fixed version",
"packageName": "@microsoft/fast-ssr",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Convert karma configuration to cjs",
"packageName": "@microsoft/fast-web-utilities",
"email": "7559015+janechu@users.noreply.github.com",
"dependentChangeType": "none"
}
3 changes: 2 additions & 1 deletion examples/todo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"dependencies": {
"@microsoft/fast-element": "^2.0.0-beta.4",
"@microsoft/fast-foundation": "^3.0.0-alpha.9",
"tslib": "^2.4.0"
"tslib": "2.4.0"
},
"devDependencies": {
"@types/node": "^20.12.8",
"clean-webpack-plugin": "^4.0.0",
"resolve-typescript-plugin": "^1.2.0",
"ts-loader": "^9.3.0",
Expand Down
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,29 @@
"packages": [
"packages/utilities/*",
"packages/web-components/*",
"sites/site-utilities",
"sites/website",
"sites/*",
"examples/todo-app",
"examples/ssr"
],
"nohoist": [
"**/@microsoft/api-extractor",
"**/@types/chai",
"**/@types/jest",
"**/@types/karma",
"**/@types/mocha",
"**/@types/node",
"**/@types/react",
"**/@types/ws",
"**/chai",
"**/html-minifier-terser",
"**/react-syntax-highlighter"
"**/react",
"**/react/**",
"**/react-dom",
"**/react-syntax-highlighter",
"**/typescript",
"**/webpack",
"**/@storybook/builder-webpack5",
"**/@storybook/builder-webpack5/**"
]
},
"engines": {
Expand Down Expand Up @@ -88,7 +97,6 @@
"node-gyp": "^9.0.0",
"trim-newlines": "^4.0.2",
"trim": "^0.0.3",
"typescript": "^4.7.0",
"ua-parser-js": "^0.7.28",
"xmlhttprequest-ssl": "^1.6.2"
},
Expand All @@ -104,9 +112,9 @@
"copyfiles": "^2.4.1",
"docusaurus-init": "^1.11.0",
"dotenv": "^6.0.0",
"jest-mock": "29.5.0",
"glob": "^7.1.2",
"husky": "^4.2.5",
"jest-mock": "29.5.0",
"lerna": "^5.5.2",
"lint-staged": "^10.1.2",
"markdown-it": "^12.3.2",
Expand Down
5 changes: 3 additions & 2 deletions packages/utilities/fast-colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
"watch": "yarn build -- -w --preserveWatchOutput"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.24.2",
"@microsoft/eslint-config-fast-dna": "^2.1.0",
"@types/chai": "^4.2.11",
"@types/mocha": "^8.2.0",
"chai": "^4.2.0",
"mocha": "^8.2.1",
"@microsoft/eslint-config-fast-dna": "^2.1.0",
"eslint-config-prettier": "^8.8.0",
"mocha": "^8.2.1",
"prettier": "2.8.8",
"typescript": "^4.7.0"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/utilities/fast-react-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"prettier:diff": "prettier --config ../../../.prettierrc \"**/*.ts\" --list-different",
"eslint": "eslint . --ext .ts",
"eslint:fix": "eslint . --ext .ts --fix",
"test": "yarn eslint && yarn test-chrome:verbose && yarn doc:ci",
"test": "yarn eslint && yarn build && yarn test-chrome:verbose && yarn doc:ci",
"test-node": "mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
"test-node:verbose": "mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage",
Expand Down Expand Up @@ -78,6 +78,7 @@
"ts-loader": "^9.3.0",
"ts-node": "^8.9.1",
"tsconfig-paths": "^3.9.0",
"tslib": "^2.4.0",
"typescript": "^4.7.0",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/utilities/fast-react-wrapper/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"outDir": "dist/esm",
"experimentalDecorators": true,
"target": "es2015",
"module": "ESNext",
"moduleResolution": "Node16",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"importHelpers": true,
"jsx": "react",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const commonChromeFlags = [
"--force-device-scale-factor=1",
];

module.exports = function (config: any) {
module.exports = function (config) {
let browsers;
if (process.env.BROWSERS) {
browsers = [process.env.BROWSERS];
Expand Down Expand Up @@ -133,9 +133,9 @@ module.exports = function (config: any) {
loader: "istanbul-instrumenter-loader",
options: { esModules: true },
test: /\.[tj]s$/,
} as any);
});
options.reporters = ["coverage-istanbul", ...options.reporters];
(options as any).coverageIstanbulReporter = {
options.coverageIstanbulReporter = {
reports: ["html", "text-summary", "json", "lcovonly", "cobertura"],
dir: "coverage",
verbose: true,
Expand All @@ -149,7 +149,7 @@ module.exports = function (config: any) {
},
},
};
(options as any).junitReporter = {
options.junitReporter = {
outputDir: "coverage",
outputFile: "test-results.xml",
useBrowserName: false,
Expand Down
18 changes: 9 additions & 9 deletions packages/utilities/fast-web-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
"test": "yarn eslint && yarn build && yarn test-chrome:verbose",
"test-node": "mocha --reporter min --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
"test-node:verbose": "mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
"test-chrome": "karma start karma.conf.ts --browsers=ChromeHeadlessOpt --single-run --coverage",
"test-chrome:verbose": "karma start karma.conf.ts --browsers=ChromeHeadlessOpt --single-run --coverage --reporter=mocha",
"test-chrome:watch": "karma start karma.conf.ts --browsers=ChromeHeadlessOpt --coverage --watch-extensions js",
"test-chrome:debugger": "karma start karma.conf.ts --browsers=ChromeDebugging",
"test-chrome:verbose:watch": "karma start karma.conf.ts --browsers=ChromeHeadlessOpt --coverage --watch-extensions js --reporter=mocha",
"test-chrome:verbose:debugger": "karma start karma.conf.ts --browsers=ChromeDebugging --reporter=mocha",
"test-firefox": "karma start karma.conf.ts --browsers=FirefoxHeadless --single-run --coverage",
"test-firefox:verbose": "karma start karma.conf.ts --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha",
"test-firefox:watch": "karma start karma.conf.ts --browsers=FirefoxHeadless --coverage --watch-extensions js",
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage",
"test-chrome:verbose": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage --reporter=mocha",
"test-chrome:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js",
"test-chrome:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging",
"test-chrome:verbose:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js --reporter=mocha",
"test-chrome:verbose:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging --reporter=mocha",
"test-firefox": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage",
"test-firefox:verbose": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha",
"test-firefox:watch": "karma start karma.conf.cjs --browsers=FirefoxHeadless --coverage --watch-extensions js",
"eslint": "eslint . --ext .ts,.tsx",
"eslint:fix": "eslint . --ext .ts,.tsx --fix",
"watch": "yarn build -- -w --preserveWatchOutput"
Expand Down
2 changes: 2 additions & 0 deletions packages/utilities/fast-web-utilities/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist",
"module": "Node16",
"moduleResolution": "Node16",
"strictNullChecks": true,
"strictPropertyInitialization": true,
"allowJs": true,
Expand Down
4 changes: 0 additions & 4 deletions packages/web-components/fast-element/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ Within your JavaScript or TypeScript code, you can then import library APIs like
import { FASTElement } from '@microsoft/fast-element';
```

:::tip
Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](../integrations/introduction.md).
:::

### From CDN

A pre-bundled script that contains all APIs needed to build web components with FAST Element is available on CDN. You can use this script by adding [`type="module"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) to the script element and then importing from the CDN.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Besides rendering content, attributes, and properties, you'll often want to add
In both examples above, after your event handler is executed, `preventDefault()` will be called on the event object by default. You can return `true` from your handler to opt-out of this behavior.
:::

The second example demonstrates an important characteristic of the templating engine: it only supports *unidirectional data flow* (model => view). It does not support *two-way data binding* (model <=> view). As shown above, pushing data from the view back to the model should be handled with explicit events that call into your model's API.
The second example demonstrates an important characteristic of the templating engine: it only supports *unidirectional data flow* `(model => view)`. It does not support *two-way data binding* `(model <=> view)`. As shown above, pushing data from the view back to the model should be handled with explicit events that call into your model's API.

## Templating and the element lifecycle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ description: Now that you're familiar with the robust and powerful features of F

We've seen how to use `FASTElement` to declaratively build Web Components. In addition to the basics of element and attribute definition, `FASTElement` also provides a way to declare templates capable of high-performance rendering, and efficient, incremental batched updates. Finally, CSS can easily be associated with an element in a way that leverages core platform optimizations for performance and low memory allocation.

Now that you're familiar with the robust and powerful features of `FASTElement`, you're ready to build your own components and apps. But you don't have to start from scratch there either! If you haven't already explored them, check out our [FAST Components](../components/getting-started.md), which provide all the basic UI building-blocks you'd expect in a modern component library. You can also leverage the same adaptive design system that our own components use to enable robust theming throughout all you create. Read more on that in [Styling Components](../design-systems/fast-frame.md#configuring-components). Finally, you'll want to take advantage of a modern toolset by installing [a powerful editor and plugins](../tools/vscode.md).
Now that you're familiar with the robust and powerful features of `FASTElement`, you're ready to build your own components and apps.

For a quick reference, check out [our Cheat Sheet](../resources/cheat-sheet.md).
2 changes: 1 addition & 1 deletion packages/web-components/fast-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"ts-node": "^8.9.1",
"tsconfig-paths": "^3.9.0",
"tslib": "^2.4.0",
"typescript": "^4.7.0",
"typescript": "~4.7.0",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/fast-element/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"strictPropertyInitialization": false,
"target": "es2015",
"module": "ESNext",
"moduleResolution": "Node16",
"moduleResolution": "NodeNext",
"types": [
"mocha",
"webpack-env"
Expand Down
3 changes: 2 additions & 1 deletion packages/web-components/fast-foundation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@
"prettier:diff": "prettier --config ../../../.prettierrc \"**/*.ts\" --list-different",
"eslint": "eslint . --ext .ts",
"eslint:fix": "eslint . --ext .ts --fix",
"pretest": "yarn eslint && yarn build-storybook --quiet",
"test": "playwright test",
"posttest:ci": "yarn doc:ci",
"start": "yarn start:storybook",
Expand All @@ -268,6 +267,8 @@
"expect": "29.2.1",
"prettier": "2.8.8",
"qs": "^6.11.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"resolve-typescript-plugin": "^1.2.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-terser": "^7.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config: PlaywrightTestConfig = {
},
webServer: {
// double-quotes are required for Windows
command: `node -e "import('express').then(({ default: e }) => e().use(e.static('./storybook-static')).listen(6006))"`,
command: "yarn start",
port: 6006,
reuseExistingServer: process.env.CI ? false : true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ export class FASTDataGrid extends FASTElement {
return;
}

const unselectableRowIndexes = [];
const unselectableRowIndexes: Array<number> = [];

for (
let index: number = 0, maxIndex = this.rowElements.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class FASTDesignTokenNode extends DesignTokenNode implements HostBehavior {
}

if (parent !== this.parent) {
const reparent = [];
const reparent: Array<FASTDesignTokenNode> = [];
for (const child of parent.children) {
if (
child instanceof FASTDesignTokenNode &&
Expand Down
Loading

0 comments on commit 4b23b5c

Please sign in to comment.