Code Monkey home page Code Monkey logo

Comments (3)

JovanMilenkovic avatar JovanMilenkovic commented on May 18, 2024 2

I wanted to open an issue for discussion similar to this so might as well do it here. I wanted to recommend that upon registering a new route, router issues a fatal error in case it concludes there is an ambiguity. Router has no way of making a valid decision on what should be done, and this happened because of a programmer error which I think should crash on boot.

from routing-kit.

tanner0101 avatar tanner0101 commented on May 18, 2024

This is a limitation of the design of the router. A given node can have at most one wildcard child. In the above example, there is no way to distinguish between an Order and Order.ID component.

Since the Order component is registered first, the router node is set as "order" type. When the second route is registered, the router sees a parameter path component is already there and uses that. There is no check as to whether the existing parameter type is the same.

A suggestion could be printing a warning (and perhaps failing) if non-matching paramater type path components are registered to the same node. This could be done here.

from routing-kit.

tanner0101 avatar tanner0101 commented on May 18, 2024

This should be possible by adding a check that, if a dynamic child node already exists, its value is equal to the new dynamic node's value.

from routing-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.