-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add engines to Works With section #1058
Conversation
@jthomasmock @filiptronicek What do you think? |
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.
LGTM, left some non-blocking comments
const displayName = getTargetPlatformDisplayName(targetPlatform); | ||
return displayName ? <span key={targetPlatform}>{index > 0 ? ', ' : ''}{displayName}</span> : null; | ||
}); | ||
const renderWorksWithEngines = (engines?: Record<string, string>): ReactNode => { |
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'd be great to make this use useCallback
so that we memoize the return value without having to re-render every time. The same goes for renderWorksWithTargetPlatformsList
as well.
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.
If we do, we should make the functions depend on extension.engines
and extension.downloads
respectively by removing the arguments and using extension
there and always reference extension
from the component itself.
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.
Sounds good. I'll add memoization.
@@ -91,7 +91,7 @@ export interface Extension { | |||
description?: string; | |||
|
|||
// key: engine, value: version constraint | |||
engines?: string[]; | |||
engines?: Record<string, string>; |
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.
looks like this is nothing new, just aligning with reality 👍
.map((engine) => ({ | ||
key: engine, | ||
name: getEngineDisplayName(engine), | ||
version: engines[engine] |
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 wonder how much free rein extensions have here. Do we have any limits on what users can put into the engine version?
I don't think it's necessary to parse these values per se, but we could have some validation on the backend if we don't already.
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.
The vscode
version is required, but a publisher can add other engines too. From https://code.visualstudio.com/api/references/extension-manifest:
Looks great to me! |
48a686d
to
a0d16ab
Compare
a0d16ab
to
999a978
Compare
Add engines to Works With section. Related issue: #1042
Some examples: