Code Monkey home page Code Monkey logo

Comments (6)

David-OConnor avatar David-OConnor commented on May 13, 2024

Looks great - that's the best routing approach I've seen. The issue that's driving the lack of dynamic routes is related to lifetimes, and where/how to store the popstate-listening closures so we can remove them when adding new ones... The temporary workaround is to create one closure at the start, and never detach it. Need to solve this first. (I think the relevant part of the code you linked is the external removeEventListener : part.)

from seed.

rsaccon avatar rsaccon commented on May 13, 2024

yes, at the example, in the didMount app-level life cycle hook, a closure gets registered with the route map and how it has to be processed. And still in that didMount hook, the removeEventListener stuff gets wired up to be run in a closure at component unmount, at:
self.onUnmount(() => ReasonReact.Router.unwatchUrl(watcherID))

from seed.

thedodd avatar thedodd commented on May 13, 2024

Iā€™m super stoked about this framework. The dynamic routing is pretty much the only thing blocking me from being able to fully adopt this for a production app (or at least starting to build it).

@David-OConnor if you (or anyone else) is interested in joining the Rust WASM Working Group, I know a lot of folks would be happy to toss ideas around and do some hacking (myself included).

Weekly, Thursdays. The team repo has more info. Will grab a link.

from seed.

David-OConnor avatar David-OConnor commented on May 13, 2024

Added partial dynamic routing in latest commit. See todomvc example. Still need to specify landing page routing, same syntax as before, but now you can push to pages not included in it. Must pass app state down to routing messages, which adds verbosity, but no longer need to recursively call update.

What do y'all think? Any thoughts on dynamic landing pages? Think programmatically setting up the HashMap is enough, or do we need a regex/recursive-pattern-match approach? Maybe I should change the API to be more like that ReasonMl example; it's nicer.

Interested in the group, but won't necessarily be avail Thu.

from seed.

David-OConnor avatar David-OConnor commented on May 13, 2024

Latest commit has a complete rework of the routing system; it's now like the ReasonML example. I expect this API to stay the same; it's about as simple as it can get. Might have some changes to make internally re how hash and search are handled.

from seed.

David-OConnor avatar David-OConnor commented on May 13, 2024

Published in v0.2.5

from seed.

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.