Resolve module identifier with @cardstack/catalog/ prefix#4296
Resolve module identifier with @cardstack/catalog/ prefix#4296tintinthong merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dfcd0a11c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let moduleInfo = | ||
| this.moduleInfoCache.get(moduleIdentifier) ?? | ||
| (await this.fetchModuleInfo(new URL(moduleIdentifier))); | ||
| (await this.fetchModuleInfo(cardIdToURL(moduleIdentifier))); |
There was a problem hiding this comment.
Normalize moduleInfoCache lookup key before fetch
When moduleIdentifier is a prefix-form ID like @cardstack/catalog/..., this new cardIdToURL(moduleIdentifier) call resolves it to an absolute URL, but the cache lookup still uses the original prefix string. fetchModuleInfo() stores entries under url.href, so prefixed modules will never hit moduleInfoCache and will re-fetch module metadata for each type assembled from the same module. This introduces avoidable network requests and can noticeably slow type assembly in flows that load multiple definitions from one prefixed module.
Useful? React with 👍 / 👎.
Preview deployments |
Host Test Results 1 files ± 0 1 suites ±0 2h 15m 9s ⏱️ -7s Results for commit d56f985. ± Comparison against base commit e6f2b06. This pull request removes 1 and adds 25 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
richardhjtan
left a comment
There was a problem hiding this comment.
This fix works without error coming from the LHS inspector
habdelra
left a comment
There was a problem hiding this comment.
this is never ending....
1dfcd0a to
d56f985
Compare


This affects LHS when we open a module
It seems this is activated when opening a card that imports @cardstack/catalog/prefix from the type-chain somehow. Either LHS or RHS