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(all): use typescript project references #632
Conversation
ca91fbc
to
9948a2f
Compare
I don't understand why they recommend this option - isn't it just unsafe? You don't know anymore for example if your dep references browser APIs that aren't in your matrix or anything like that. |
The code you are using is type checked. So if a browser API in these code paths is used that you don't support the compiler should be able to catch that (need to test that in a small repro). Of course this assumes that the lib itself would be free of side effects. |
88af6cd
to
6c7d364
Compare
💡 I didn't know that. So what you are saying is this? // node_modules/a/index.ts
function foo(): string {
return new Intl.PluralRules().select(0);
}
function bar(): string {
return "other";
// src/works.ts
import { bar } from "a";
console.log(bar());
// src/broken.ts
import { foo } from "a";
console.log(foo()); |
@fahrradflucht It's a good thing you started this discussion. Based on your example I created this test repo: https://github.com/unstubbable/skip-lib-check-test Quoting the README from there:
This brings me to the conclusion that this compiler option should only be used a stop-gap measure (if at all) for a short period of time, when the types of two libraries (in this case |
This reduces the compile time significantly. It is also a recommended compiler option. Note: Explicit usage of third-party code is still checked.
Since ts-node does not support project references we use js files with jsdoc type annotations instead.
This is needed to properly handle project references.
The increase is caused by a newer version of semver which introduced memoization to improve the performance of range parsing. With this lru-cache was added as a dependency which unfortunately leads to the larger overall size of @feature-hub/core.
6c7d364
to
8f57c95
Compare
Removed |
There is currently no issue without `skipLibCheck`, until we decide to update to webpack 5, and DefinitelyTyped/DefinitelyTyped#50773 is not resolved till then.
8f57c95
to
5e6161b
Compare
Interesting, with |
3207b0f
to
1c9d7d3
Compare
This also enablesskipLibCheck
which reduces the compile time significantly. It is also a recommended compiler option.Note: Explicit usage of third-party code is still checked.packages/demos
to js to avoid usingts-node
(no support for project references)The increase of
@feature-hub/core
by 2 kb is caused by a newer version ofsemver
(required byts-loader
) which introduced memoization to improve the performance of range parsing. With thislru-cache
was added as a dependency which unfortunately leads to the larger overall size of@feature-hub/core
.