Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

Denormalize required values to nodes #914

Closed
wants to merge 12 commits into from

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Nov 17, 2018

  • Matching
  • Link generation
  • Fix MvcEndpointDataSource tests

@JamesNK JamesNK requested a review from rynowak November 17, 2018 07:06
@JamesNK JamesNK changed the title Denormalize required values to nodes [WIP] Denormalize required values to nodes Nov 20, 2018
@JamesNK
Copy link
Member Author

JamesNK commented Nov 20, 2018

Matching is passing!
Link generation is almost passing! Something in link generation is breaking with areas.

}
}

AddLiteralNode(includeLabel, nextParents, parent, requiredValue.ToString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a case like Foo/{action=Index} where rv: { action = "Index" } how does Foo match? Is that handled by the handling for default values? This is worth a comment at least.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that handled by the handling for default values?

Yes, HasAdditionalRequiredSegments will add the endpoint as a match for the current node. I don't think this needs a comment to call that out here. There is no difference between how that logic interacts with required values and anything else.

I'll add a comment about the what is happening to the required value before it is used as a literal.

Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As promised, I gave this another look. It really seems like its on the right track

@JamesNK
Copy link
Member Author

JamesNK commented Nov 21, 2018

🆙 📅

@JamesNK JamesNK changed the title [WIP] Denormalize required values to nodes Denormalize required values to nodes Nov 21, 2018
@natemcmaster
Copy link
Contributor

We're merging Routing today into aspnet/AspNetCore. If you can merge this in the next 30 minutes or so, we can bring this along. Otherwise, you'll have to open a new PR against https://github.com/aspnet/AspNetCore.

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line. According to people like you this is very important

Suggested change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is important 🙏

Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 👍

@natemcmaster
Copy link
Contributor

FYI @ryanbrandenburg this will likely be the last change to master before I make this repo readonly.

@rynowak
Copy link
Member

rynowak commented Nov 22, 2018

This requires a reaction in MVC tho

@JamesNK
Copy link
Member Author

JamesNK commented Nov 22, 2018

Will be rebased. Close this 💀

@natemcmaster
Copy link
Contributor

Just chatted with James. Yes, this will need to be rebased onto aspnet/AspNetCore. I'm going to close this PR, but I'll make sure to leave this branch around so you can copy the code over.

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

Successfully merging this pull request may close these issues.

3 participants