microsoft / microsoft/fluentui

setup v9 transpilation to be based on browser support minbar

Open
#26,170 9 comments 0 reactions 1 assignee View on GitHub

@TristanWatanabe is already working on this.

Since Jan 4, 2023.

Area: Build System Resolution: Soft Close Status: Blocked Type: Epic
Dominant language
TypeScript
Stars
20.3k
Forks
2.9k
Avg merge
2d 9h
Merged PRs (30d)
46

Description

ISSUE

Migrate v9 transpilation tooling to be based on browser support matrix. Use either swc or babel to replace ts transpilation to esm and commonjs.

Steps:

  • Update migrate-converged-pkg generator to add an .swcrc file to each v9 package which will contain browserlist data based on the full browser support matrix of v9. #26527
  • Adds build:react-components just-task to be used by v9 packages. The key difference here and the normal build task is that this now splits up transpilation and api-generation as two separate tasks. The transpilation portion uses SWC to transpile code down and then makes use of babel to transform griffel related code. Transpiling to cjs or amd will now use the already transpiled esm code output from SWC as a workaround to the issue where our griffel babel-preset is unable to directly parse cjs code transpiled by SWC (tracking PR of ongoing work for this). This method allows for @griffel/babel-preset to still parse code as expected since it has no trouble transforming esm transpiled code from SWC. #26527
  • Run migration generator on all v9 library packages to migrate to using swc transpilation. #27250
  • Export withFluentProvider from @fluentui/react-storybook-addon package and explicitly declare it in the @fluentui/vr-tests-react-components storybook preview.js file so that the decorator is applied when storybook compiles via build-storybook script (comment where this workaround was discovered in test). Fix issue causing @fluentui/storybook-addon to not be properly applied during build-storybook script #27006
  • Pin puppeteer to v19 to mitigate unresponsive perf-tests: #26965
  • Update create-package templates. #27286

Long term:

  • Update migrate-converged-pkg workspace generator to use browser matrix target instead of es2019
  • Run migration generator to update .swcrc files to use browser matrix target. #27036

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.