Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Enable prettier caching #18370

Merged
merged 8 commits into from Nov 17, 2023
Merged

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Nov 17, 2023

Enables prettier caching.

I set up two repos, one with the change and one without, then ran some benchmarks. Results show at least a 4x improvement.

hyperfine --runs 10 --warmup 1 \
-L dir no-cache,with-cache \
-L command 'prettier:fix','prettier' \
'cd {dir} ; pnpm run -r --no-sort --stream {command}'
Command Mean [s] Min [s] Max [s] Relative
cd no-cache ; pnpm run -r --no-sort --stream prettier:fix 27.492 ± 0.091 27.342 27.635 4.54 ± 0.02
cd with-cache ; pnpm run -r --no-sort --stream prettier:fix 6.166 ± 0.012 6.138 6.178 1.02 ± 0.00
cd no-cache ; pnpm run -r --no-sort --stream prettier 27.302 ± 0.081 27.212 27.440 4.51 ± 0.02
cd with-cache ; pnpm run -r --no-sort --stream prettier 6.051 ± 0.014 6.037 6.087 1.00

@github-actions github-actions bot added area: build Build related issues area: dds Issues related to distributed data structures area: dds: propertydds area: dds: sharedstring area: dds: tree area: dev experience Improving the experience of devs building on top of fluid area: driver Driver related issues area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: loader Loader related issues area: odsp-driver area: runtime Runtime related issues area: server Server related issues (routerlicious) area: tests Tests to add, test infrastructure improvements, etc area: website base: main PRs targeted against main branch labels Nov 17, 2023
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Nov 17, 2023

@fluid-example/bundle-size-tests: +14 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 447.55 KB 447.55 KB +2 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 240.64 KB 240.64 KB No change
loader.js 165.06 KB 165.07 KB +2 Bytes
map.js 48.06 KB 48.06 KB +2 Bytes
matrix.js 141.84 KB 141.85 KB +2 Bytes
odspDriver.js 90.35 KB 90.35 KB +2 Bytes
odspPrefetchSnapshot.js 41.82 KB 41.82 KB +2 Bytes
sharedString.js 162.75 KB 162.75 KB No change
sharedTree2.js 275.1 KB 275.1 KB No change
Total Size 1.73 MB 1.73 MB +14 Bytes

Baseline commit: e373070

Generated by 🚫 dangerJS against 139456c

Comment on lines +87 to +89
# Ignore docs markdown files since those are formatted using markdownlint
docs/**/*.yaml
docs/**/*.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Yaml or markdown?

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

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

Other than the ignore entry from my previous comment, looks good!

Copy link
Contributor

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluidframework-docs@0.25.0 ci:linkcheck /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test ci:start http://localhost:1313 linkcheck:full

1: starting server using command "npm run ci:start"
and when url "[ 'http://localhost:1313' ]" is responding with HTTP status code 200
running tests using command "npm run linkcheck:full"


> fluidframework-docs@0.25.0 ci:start
> http-server ./public --port 1313 --silent


> fluidframework-docs@0.25.0 linkcheck:full
> npm run linkcheck:fast -- --external


> fluidframework-docs@0.25.0 linkcheck:fast
> linkcheck http://localhost:1313 --skip-file skipped-urls.txt --external

Crawling...

http://localhost:1313/community/
- (125:32) 'Microsof..' => https://opensource.microsoft.com/codeofconduct/ (connection failed)
- (129:29) 'Code of ..' => https://opensource.microsoft.com/codeofconduct/faq/ (connection failed)

http://localhost:1313/docs/apis/location-redirection-utils/
- (833:52) => http://localhost:1313/docs/apis/container-loader/-entrypoint (HTTP 404)
- (833:52) => http://localhost:1313/docs/apis/container-loader/-entrypoint (HTTP 404)

http://localhost:1313/docs/apis/react-inputs/icollaborativetextareaprops-interface/
- (886:45) 'read-only' => https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-readonly (HTTP 200 but missing anchor)
- (943:45) 'read-only' => https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-readonly (HTTP 200 but missing anchor)
- (886:45) 'read-only' => https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-readonly (HTTP 200 but missing anchor)
- (943:45) 'read-only' => https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-readonly (HTTP 200 but missing anchor)

http://localhost:1313/docs/apis/runtime-definitions/
- (1850:37) 'https://..' => https://datatracker.ietf.org/doc/html/rfc4122%29 (HTTP 404)
- (1850:37) 'https://..' => https://datatracker.ietf.org/doc/html/rfc4122%29 (HTTP 404)

http://localhost:1313/docs/apis/tree/
- (4170:210) 'https://..' => https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-utils/src/error.ts (HTTP 404)
- (4170:210) 'https://..' => https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-utils/src/error.ts (HTTP 404)

http://localhost:1313/docs/apis/tree2/internaltypes-namespace/
- (904:15) 'https://..' => https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (HTTP 302 => 203)
  - redirect path:
    - https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (302)
    - https://spsprodwus24.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2Fintentional%2Fintent%2F_wiki%2Fwikis%2FNP%2520Platform%2F7146%2FNominal-vs-Structural-Types&redirect=1&hid=4a05b22b-56d9-4015-84eb-356e83cc96ca&context=eyJodCI6MiwiaGlkIjoiMTg1NjAzMjgtMWMwMC00NWE4LTg0OGYtZDdmMTJlMzg0YjAwIiwicXMiOnt9LCJyciI6IiIsInZoIjoiIiwiY3YiOiIiLCJjcyI6IiJ90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2 (203)
- (904:15) 'https://..' => https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (HTTP 302 => 203)
  - redirect path:
    - https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (302)
    - https://spsprodwus24.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2Fintentional%2Fintent%2F_wiki%2Fwikis%2FNP%2520Platform%2F7146%2FNominal-vs-Structural-Types&redirect=1&hid=4a05b22b-56d9-4015-84eb-356e83cc96ca&context=eyJodCI6MiwiaGlkIjoiMTg1NjAzMjgtMWMwMC00NWE4LTg0OGYtZDdmMTJlMzg0YjAwIiwicXMiOnt9LCJyciI6IiIsInZoIjoiIiwiY3YiOiIiLCJjcyI6IiJ90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2 (203)

http://localhost:1313/docs/apis/tree2/internaltypes/makenominal-interface/
- (837:8) 'https://..' => https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (HTTP 302 => 203)
  - redirect path:
    - https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (302)
    - https://spsprodwus24.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2Fintentional%2Fintent%2F_wiki%2Fwikis%2FNP%2520Platform%2F7146%2FNominal-vs-Structural-Types&redirect=1&hid=4a05b22b-56d9-4015-84eb-356e83cc96ca&context=eyJodCI6MiwiaGlkIjoiMTg1NjAzMjgtMWMwMC00NWE4LTg0OGYtZDdmMTJlMzg0YjAwIiwicXMiOnt9LCJyciI6IiIsInZoIjoiIiwiY3YiOiIiLCJjcyI6IiJ90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2 (203)
- (837:8) 'https://..' => https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (HTTP 302 => 203)
  - redirect path:
    - https://dev.azure.com/intentional/intent/_wiki/wikis/NP%20Platform/7146/Nominal-vs-Structural-Types (302)
    - https://spsprodwus24.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2Fintentional%2Fintent%2F_wiki%2Fwikis%2FNP%2520Platform%2F7146%2FNominal-vs-Structural-Types&redirect=1&hid=4a05b22b-56d9-4015-84eb-356e83cc96ca&context=eyJodCI6MiwiaGlkIjoiMTg1NjAzMjgtMWMwMC00NWE4LTg0OGYtZDdmMTJlMzg0YjAwIiwicXMiOnt9LCJyciI6IiIsInZoIjoiIiwiY3YiOiIiLCJjcyI6IiJ90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2 (203)

http://localhost:1313/docs/build/bundlers/
- (843:233) 'here' => https://github.com/microsoft/FluidFramework/blob/a4c38234a920abe9b54b1c26a14c0a8e430cd3fa/packages/tools/webpack-fluid-loader/webpack.config.js#L37 (HTTP 200 but missing anchor)

http://localhost:1313/docs/deployment/service-options/
- (848:72) 'Routerli..' => https://github.com/microsoft/FluidFramework/tree/main/server#readme (HTTP 200 but missing anchor)
- (850:168) 'Routerli..' => https://github.com/microsoft/FluidFramework/tree/main/server#readme (HTTP 200 but missing anchor)

http://localhost:1313/docs/faq/
- (927:87) 'Routerli..' => https://github.com/microsoft/FluidFramework/tree/main/server#readme (HTTP 200 but missing anchor)

http://localhost:1313/docs/testing/telemetry/
- (848:3) 'ILoaderP..' => https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/src/loader.ts#L313 (HTTP 200 but missing anchor)


Stats:
  259717 links
    2498 destination URLs
       2 URLs ignored
      11 warnings
       6 errors

 ELIFECYCLE  Command failed with exit code 1.

@tylerbutler tylerbutler marked this pull request as ready for review November 17, 2023 22:37
@tylerbutler tylerbutler requested review from a team as code owners November 17, 2023 22:37
@tylerbutler tylerbutler merged commit a6a6e92 into microsoft:main Nov 17, 2023
50 checks passed
@tylerbutler tylerbutler deleted the prettier-cache branch November 17, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues area: dds: propertydds area: dds: sharedstring area: dds: tree area: dds Issues related to distributed data structures area: dev experience Improving the experience of devs building on top of fluid area: driver Driver related issues area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: loader Loader related issues area: odsp-driver area: runtime Runtime related issues area: server Server related issues (routerlicious) area: tests Tests to add, test infrastructure improvements, etc area: website base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants