Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

chore(package): use Project References in TS #1387

Merged
merged 9 commits into from Jan 10, 2020
Merged

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented May 24, 2019

Related to #508.


This PR introduces changes to our tsconfig.json's to use Project References feature. It was designed also to handle monorepo cases (microsoft/TypeScript#25376).

When you reference a project, new things happen:

  • Importing modules from a referenced project will instead load its output declaration file (.d.ts)
  • If the referenced project produces an outFile, the output file .d.ts file’s declarations will be visible in this project

https://www.typescriptlang.org/docs/handbook/project-references.html

Generated types structure

This feature allows to properly define rootDir option in tsconfig.json and output proper typings by compiler:

image

Without references feature it will fail because TypeScript doesn't know anything about modules structure:
image

@layershifter layershifter changed the title Chore/ts references chore(package): use Project References in TS May 27, 2019
@DustyTheBot
Copy link
Collaborator

DustyTheBot commented May 27, 2019

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.
⚠️ Package (or peer) dependencies changed. Make sure you have approval before merging!

Changed dependencies are detected.

Changed dependencies in packages/internal-tooling/package.json

package before after
@types/jest-axe ^2.2.3 ^3.2.1
jest-axe ^3.1.1 ^3.2.0

Perf comparison

Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🔧 Avatar.Fluent 0.54 0.36 1.5:1 2000 1087
🔧 Button.Fluent 1.18 0.17 6.94:1 1000 1178
🔧 Checkbox.Fluent 1.35 0.26 5.19:1 1000 1348
🔧 Dialog.Fluent 0.32 0.16 2:1 5000 1582
🔧 Dropdown.Fluent 3.18 0.34 9.35:1 1000 3180
🔧 Icon.Fluent 0.25 0.03 8.33:1 5000 1244
🔧 Image.Fluent 0.11 0.07 1.57:1 5000 532
🔧 Slider.Fluent 1.77 0.3 5.9:1 1000 1771
🦄 Text.Fluent 0.06 0.15 0.4:1 5000 287
🦄 Tooltip.Fluent 0.34 13.8 0.02:1 5000 1694

🔧 Needs work     🎯 On target     🦄 Amazing

Generated by 🚫 dangerJS

…om/stardust-ui/react into chore/ts-references

� Conflicts:
�	build/gulp/tasks/bundle.ts
�	gulpfile.ts
@layershifter
Copy link
Member Author

image

@mnajdova mnajdova merged commit b279dba into master Jan 10, 2020
@mnajdova mnajdova deleted the chore/ts-references branch January 10, 2020 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants