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(client): Use new node16 tsconfigs in azure, client, and DDS projects #18152

Merged

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Nov 3, 2023

This PR is the first in several that will update the CommonJS builds within the repo to use module: node16, which implies moduleResolution: node16.

There are new configs in the build-common package, and these configs are used as follows:

"extends": [
	"../../../../../common/build/build-common/tsconfig.base.json",
	"../../../../../common/build/build-common/tsconfig.cjs.json",
],

These configs are designed to be used together using TypeScript's support for extending multiple config files.

  • tsconfig.base.json - This base config contains defaults that all packages within the repo should use as a baseline.
  • tsconfig.cjs.json - This config sets module: Node16 and is intended for CommonJS builds. This config is intended to
    be layered on top of the base config.
  • tsconfig.esm.json - This config sets module: ESNext and moduleResolution: Node10 and is intended for ESM builds. This config is intended to be layered on top of the base config. This config uses Node10 module resolution because Node16 cannot be used to build both CJS and ESM from a common source.
  • tsconfig.test.json - This config disables some settings that we don't want to use in test code, like declaration and decarationMap. It also enables the node types by default.

This PR updates the packages in the packages/common and packages/dds paths. For each package, the CJS, ESM, and test tsconfig files are updated to use the new build-common configs, which means that CJS builds now use module: node16 which implies moduleResolution: node16. ESNext builds continue to use Node10 module resolution because Node16 cannot be used to build both CJS and ESM from a common source.

@github-actions github-actions bot added area: build Build related issues area: dds Issues related to distributed data structures 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 base: main PRs targeted against main branch area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc dependencies Pull requests that update a dependency file public api change Changes to a public API labels Nov 3, 2023
@tylerbutler tylerbutler force-pushed the module-resolution-node16-with-tsconfigs branch from b1f5e19 to c319b6a Compare November 3, 2023 01:03
@tylerbutler tylerbutler force-pushed the module-resolution-node16-with-tsconfigs branch 2 times, most recently from ff667d7 to 9e88f1e Compare November 6, 2023 19:56
@github-actions github-actions bot removed area: examples Changes that focus on our examples area: driver Driver related issues area: odsp-driver area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: loader Loader related issues area: tests Tests to add, test infrastructure improvements, etc area: runtime Runtime related issues labels Nov 6, 2023
@github-actions github-actions bot removed the dependencies Pull requests that update a dependency file label Nov 6, 2023
@tylerbutler tylerbutler marked this pull request as ready for review November 7, 2023 01:52
@tylerbutler tylerbutler requested review from a team as code owners November 7, 2023 01:52
@tylerbutler tylerbutler changed the title Draft: node16 moduleResolution part 1 Use new node16 tsconfigs in azure and DDS projects Nov 7, 2023
@@ -17,3 +17,24 @@ It can be extended in your package's local configuration file like the following

This package previously exported a series of configurations with differing levels of validation.
These configurations are now deprecated and have been replaced with the configuration noted above.

## TypeScript Configurations (`tsconfig.json`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding these docs! These are great!

"rootDir": "./",
"outDir": "../../dist/test",
"types": ["mocha", "node"],
"noUnusedLocals": false, // Need it so memory tests can declare local variables just for the sake of keeping things in memory
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the comment!!

@tylerbutler tylerbutler changed the title Use new node16 tsconfigs in azure and DDS projects build(client): Use new node16 tsconfigs in azure, client, and DDS projects Nov 7, 2023
@tylerbutler tylerbutler merged commit de14e47 into microsoft:main Nov 8, 2023
29 checks passed
@tylerbutler tylerbutler deleted the module-resolution-node16-with-tsconfigs branch November 8, 2023 00:25
This pull request was closed.
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: sharedstring area: dds Issues related to distributed data structures base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants