Giter Site home page Giter Site logo

router about minimal-14kb-website HOT 7 OPEN

leeoniya avatar leeoniya commented on July 17, 2024
router

from minimal-14kb-website.

Comments (7)

jaetask avatar jaetask commented on July 17, 2024 1

Hey Leon, thanks for the input. I took a look at routie but it uses hash routing which I'd like to avoid. My plan is to provide standard express style routing and consumable urls.

I'm loving domvm, It's a great piece of code.

Nice one. Jae

from minimal-14kb-website.

leeoniya avatar leeoniya commented on July 17, 2024

domvm's router supports both hash and history api.

However, i discovered a serious limitation of using history-style routing when implementing ThreaditJS: the need for server-side routing support. You cannot just take your app/widget and plop it anywhere (other than domain root) as you can with hashes. The server must know to serve the same "front controller" regardless of actual uri in case you decide to F5-refresh some non-root route. With hash routing, you can run your SPA out of any sub-dir and it will just work without any server tweaking. I really have not found a compelling case to avoid hash routing. To me, /#/someroute vs /someroute is not worth the drawbacks. Perhaps there are SEO benefits, but that remains to be tested.

I'm in the process of writing a < 200kb impl of a gmail-style mobile webmail UI (including web/icon fonts)...also using Marked for composition. We should start a "tiny-webapps" org :)

from minimal-14kb-website.

jaetask avatar jaetask commented on July 17, 2024

Yes, I have been thinking about this. I believe that there is an opportunity to solve this problem server side in a really elegant way.

I imagine that when you hit /someroute directly, via bookmark or F5 then it would deliver the routes content wrapped in the / controller and if you hit /someroute directly via ajax request then you would simply get the routes assets.

I might be over complicating the app by doing that, and looking at my most used apps gmail and rememberthemilk.com, both of them use the hashing method.

Can I ask why you chose to write your own when routie was available and comes in at 800 bytes?

p.s. TinyWebappsRUS are the future :) I deleted over 80% of the code on my last project and it made a huge difference on 2G/3G. I think people forget that not everyone/everywhere has fast connections. You app sounds cool, is it open source or a private build?

from minimal-14kb-website.

leeoniya avatar leeoniya commented on July 17, 2024

Can I ask why you chose to write your own when routie was available and comes in at 800 bytes?

Routie is a bit too simple, kinda like domchanger :). I needed href generation from params, i needed querystring support, hash-in-hash support, onenter and onexit callbacks, uniform History api support, etc. domvm's router does all this in 2100 bytes (min). A quick intro: https://github.com/leeoniya/domvm#route-module

Also, the API is more uniform with the rest of domvm without being tightly coupled.

You app sounds cool, is it open source or a private build?

I'm writing it for a blog post to introduce domvm. It will be open source. If you want to help, you can. The backend serves JSON from an sqlite database of Hillary Clinton's released emails, since i didn't want to use my own private messages :)

from minimal-14kb-website.

jaetask avatar jaetask commented on July 17, 2024

Hi, You should also keep an eye on this project

https://github.com/jaetask/gym-guide

Its open source and I am going to be using domvm :)

from minimal-14kb-website.

leeoniya avatar leeoniya commented on July 17, 2024

ok, thanks. i'll watch it and comment if i see any non-idiomatic hacks. it'll help me with docs and/or guides/tutorials.

from minimal-14kb-website.

gangaanonymous avatar gangaanonymous commented on July 17, 2024

Connection problem arises. How can i connect to my router by WAN from another city ?
I have a router at my hone and want to connect it from my workplace computer

from minimal-14kb-website.

Related Issues (1)

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.