Giter Club home page Giter Club logo

Comments (6)

neetjn avatar neetjn commented on May 23, 2024

What I'd like to do is provide an interface to simply listen in on the following events,

  • start
  • stop
  • reload
  • navigate
  • transition

This project will not provide actual routing, simply an interface for listening on events providing:

  • matching
  • fragment identifiers
  • variable extrapolation
  • query string processing

Refer to event emitter.

from core-routing.

neetjn avatar neetjn commented on May 23, 2024

A rather large and important question, is how to structure the interface. Do we use an observable pattern similar to the Node.js event emitter? Or do we use a more standardized single-definition callback pattern? Both options yield a number of pros and cons, but it boils down to flexibility vs simplicity.

from core-routing.

neetjn avatar neetjn commented on May 23, 2024

Update (9/2/19):

  • Removed events for reload and transition.
    • Reload is not logical with client sided routing.
    • A transition should be handled respectfully by the consumer.
  • I've gone with a single definition callback pattern. The syntax looks like:
    • const router = new Router({
        client: {
           // onStart, onStop, onNavigate: (event) => ...
        }  
      })
  • I've greatly simplified the functional aspect of this project, as it's just an interface to subscribe to for routing. I've decided to put off fragment identification for release 0.0.2.
  • I'm experimenting with memoizing for route processing. Given the router is client sided, this won't increase initial performance drastically, but will help thwart cumbersome computations (router tools split method will be called multiple times w/ the same arguments on occassion). Q: Should/can we use local storage?

from core-routing.

neetjn avatar neetjn commented on May 23, 2024

Update (9/6/19):

  • I've implemented fragment identification to an extent, the router tools will process the given route and provide the name of the fragment. Anything beyond that functionality is for the consumer to implement.
  • The initial implementation for the router tools has been completed. I've leveraged typescript-memoize to improve performance with redundant calls. I've also finished implementing support for query strings/arguments.

from core-routing.

neetjn avatar neetjn commented on May 23, 2024

Update (9/11/19):

  • Fixed issue with memoize causing matching logic to fail.
  • Completed legacy browsing support.
  • Completed functional prototype of client interface.
  • Completed basic core tests.
  • Set up basic CI using GitHub Actions.

Todo:

  • Documentation

from core-routing.

neetjn avatar neetjn commented on May 23, 2024

Closing this issue as version 0.0.1 has been published.

from core-routing.

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.