-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fixed peer dependencies issue of download page #1491
Conversation
download.js
Outdated
@@ -136,13 +136,15 @@ for (var category in components) { | |||
|
|||
var filepath = all.meta.path.replace(/\{id}/g, id); | |||
|
|||
var after = all[id].peerDependencies || all[id].after; |
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 have to dig through the download page logic a bit, but should we be combining peerDeps
+ after
in some way?
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.
@mAAdhaTTah They are separated now.
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.
My initial thought was something more like:
var after = all[id].after;
if (all[id].peerDependencies) {
after.push($u.type(all[id].peerDependencies) === 'string' ? [all[id].peerDependencies] : all[id].peerDependencies);
}
which would be a little simpler but would need a couple extra type checks.
Thoughts?
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.
It's kind of unnecessary because there is always only either after
(plugins) or peerDependencies
(languages).
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.
Ok, so this is fine then.
download.js
Outdated
function getSortedComponentsByRequirements(components){ | ||
var sorted = getSortedComponents(components, "after"); | ||
function getSortedComponentsByRequirements(components, secondaryOrderKey) { | ||
var sorted = getSortedComponents(components, secondaryOrderKey); |
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.
@mAAdhaTTah Do you have a better idea for the name of this variable?
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.
It's called requireName
in getSortedComponents
; might as well go with that.
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.
Well, that's ambiguous because "require"
is also a literal requireName
.
Maybe optionalRequireName
?
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 just noticed that the name optional requirement is really bitter sweet.
I'll just use afterName
.
Is there anything else that has to be done? |
The details are discussed here #1490.