-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Take into account peerDependency versions when calculating packageId #57029
Conversation
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
@typescript-bot test top200 @typescript-bot perf test this @typescript-bot user test tsserver |
Heya @jakebailey, I've started to run the diff-based top-repos suite (tsserver) on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the tarball bundle task on this PR at 3d33069. You can monitor the build here. |
Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the public perf test suite on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the regular perf test suite on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the diff-based user code test suite (tsserver) on this PR at 3d33069. You can monitor the build here. Update: The results are in! |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@jakebailey Here are the results of running the user test suite comparing Everything looks good! |
@jakebailey Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
Hey @jakebailey, the results of running the DT tests are ready. |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Details
|
@jakebailey Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. DetailsServer exited prematurely with code unknown and signal SIGABRT
Affected reposcalcom/cal.comRaw error text:RepoResults7/calcom.cal.com.rawError.txt in the artifact folder
Last few requests{"seq":753,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/apps/swagger/pages/index.tsx","line":4,"offset":52}}
{"seq":754,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/apps/swagger/pages/index.tsx","line":4,"offset":52}}
{"seq":755,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["@PROJECT_ROOT@/apps/api/test/lib/middleware/withMiddleware.test.ts"],"openFiles":[]}}
{"seq":756,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/apps/web/app/_trpc/client.ts","projectRootPath":"@PROJECT_ROOT@"}]}}
Repro steps
|
@typescript-bot test top200 @typescript-bot perf test this @typescript-bot user test tsserver |
Heya @sheetalkamat, I've started to run the regular perf test suite on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Heya @sheetalkamat, I've started to run the diff-based top-repos suite on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Heya @sheetalkamat, I've started to run the public perf test suite on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Heya @sheetalkamat, I've started to run the diff-based top-repos suite (tsserver) on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Heya @sheetalkamat, I've started to run the diff-based user code test suite (tsserver) on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Heya @sheetalkamat, I've started to run the parallelized Definitely Typed test suite on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at 9497cf8. You can monitor the build here. |
Heya @sheetalkamat, I've started to run the diff-based user code test suite on this PR at 9497cf8. You can monitor the build here. Update: The results are in! |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@sheetalkamat Here are the results of running the user test suite comparing Everything looks good! |
@sheetalkamat Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@sheetalkamat Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
Hey @sheetalkamat, the results of running the DT tests are ready. |
@sheetalkamat Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@sheetalkamat Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. DetailsServer exited prematurely with code unknown and signal SIGABRT
Affected reposcalcom/cal.comRaw error text:RepoResults7/calcom.cal.com.rawError.txt in the artifact folder
Last few requests{"seq":797,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"@PROJECT_ROOT@/apps/swagger/pages/_app.tsx","projectRootPath":"@PROJECT_ROOT@"}]}}
{"seq":798,"type":"request","command":"organizeImports","arguments":{"scope":{"type":"file","args":{"file":"@PROJECT_ROOT@/apps/swagger/pages/_app.tsx"}},"skipDestructiveCodeActions":true}}
{"seq":799,"type":"request","command":"organizeImports","arguments":{"scope":{"type":"file","args":{"file":"@PROJECT_ROOT@/apps/swagger/pages/_app.tsx"}},"skipDestructiveCodeActions":false}}
{"seq":800,"type":"request","command":"navto","arguments":{"searchValue":"a","maxResultCount":256}}
Repro steps
|
@sheetalkamat Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Details
|
@weswigham @andrewbranch @jakebailey can you please take a look again so we can get this in for 5.5 early on. |
const peerPackageJson = getPackageJsonInfo(nodeModules + key, /*onlyRecordFailures*/ false, state); | ||
if (peerPackageJson) { | ||
const version = (peerPackageJson.contents.packageJsonContent as PackageJson).version; | ||
result += `+${key}@${version}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: I could theoretically name a package on disk typescript@5.4.1+
and munge this cache key up pretty badly (all these separators are valid filepath characters after all). Shouldn't this use, eg, ?
and |
instead of +
and @
, since, at least on windows, those aren't valid path characters? Believe it or not, a require("typescript@5.4.1+")
will work and resolve on disk, even if npm
won't let you publish a package with those characters!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that shouldnt matter right becaus this is just distinguisher and gets added as packageName@version+peerPackage@peerPackageversion...
as the package ID for distinguishing.. Actually was wondering if peerPackageDependency should be array of { packageName, version} instead so that in future we can use it say in module specifier etc .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewbranch do you think we would be able to use peer dependency to determine the "moduleSpecifier" name for transitive dependencies? If yes i will make change to make this object with packageName and version instead of a string of all peer dependencies together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would we use that exactly? Usually when we’re trying to compute a module specifier, we’re starting from a source file or module symbol. So I’m not sure where this would come in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eg. if your file has import whose peer dependency is the source File for the package then short cut to directly use package name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { a } from "foo";
export functopn bar() {
return a.bar(); // This is from package Bar@BarVersion
}
then while going through all imports in the file: if you find say "foo" import whose peer dependency is "Bar@Bar.version" use that package name ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that could be leveraged somehow, but getting just the package name is usually fairly easy compared to figuring out what subpath can be used to get to the export we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weswigham @andrewbranch do we still have concern about the string for peer dependency calculations.
Do we want this as array of package name and versions for future use or just some string is ok. Should i make this internal for now so we have option to change this later? Would like to get this in sooner than later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should probably be internal if it’s a formatted string that only gets used as a lookup id. But if you want to go ahead and change it to be an object with name/version, that works too.
@andrewbranch marked peerDependencies as internal for now |
Fixes #56762