Skip to content
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

Merged
merged 3 commits into from
Jul 22, 2018

Conversation

RunDevelopment
Copy link
Member

The details are discussed here #1490.

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;
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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).

Copy link
Member

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);
Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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 ?

Copy link
Member Author

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.

@RunDevelopment
Copy link
Member Author

@mAAdhaTTah

Is there anything else that has to be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants