ko.routing: a free knockoutjs specific router

200 views
Skip to first unread message

Francesco Abbruzzese

unread,
May 14, 2014, 10:07:08 AM5/14/14
to knock...@googlegroups.com
ko.routing is an advanced light router (7kb minimized) specifially designed for knockout.js that depends only on knockout.js with the following features:
  • Free Open Source, and very light
  • AMD, & CommonJs compatible
  • It allows a fine grained control over the search engine visibility of all SPA links
  • One may have several independent routers in the same page
  • The format of all routes may be changed without affecting the remainder of the code
  • Routing rules may be nested
  • Links may use a kind of useful relative reference
  • Available also as a Nuget package
More infos on the web site.



Daniele Dellafiore

unread,
Oct 9, 2015, 9:59:07 AM10/9/15
to KnockoutJS
Hi,

what is your experience in make SPA built with ko.routing crawlable?
Thanks.

Francesco Abbruzzese

unread,
Oct 9, 2015, 10:44:24 AM10/9/15
to knock...@googlegroups.com
Hi Daniele,
I never designed a SPA with the explicit intention that this SPA be
crawable, that was just a pleasant side effect!
As an example of crawable pages see the "not logged" pages of the
clients/reseller section of my web site, namely:
 https://members.mvc-controls.com. The
whole private area of that site was implemeted with a product built on top
of ko.routing.

Google officially declared it is crawling SPAs. Here the important stuff is
using links to reach different views and not other stuffs. In fact links
are followed by google, that now execute also javascript. This way the link
actually load a different SPA page.

However, I dont know if SPA pages are rated the same of standard pages.
However, for what happened to my SPA Views if there is some penalty for
sure it is not so big since they were ranked acceptably.

Another important point is that while executing Javascript Google crawler
timeout javascript code, so if your SPA view contains too much complex
javascript it will not be executed properly, so probably Google will not be
able to index it and to follows its SPA links.

If you have more specific questions please let me know.


--
You received this message because you are subscribed to a topic in the Google Groups "KnockoutJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/knockoutjs/jLnqFNmTdaE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Daniele Dellafiore

unread,
Oct 9, 2015, 12:12:23 PM10/9/15
to knock...@googlegroups.com
thanks for the answer.

From what I see from the doc, the mount point of a page in ko.routing is something like #/home
that is non crawlable by definition, AFAIK. It should be #!/home to be crawlable, and then one need to use something likve PhantomJS or PRerender.io to make it really cralwlable.

If I put an url like mydomain.com/#page on Google WebMaster (now Search Console) and use the "fetch as google", it fetches nothing. While fetching mydomain.com/!#/page return something, even a "nothing found" if the URL is broken.

So I am trying to make pagerjs work in HTML5 History mode to have URLs with #!/ but I am failing (and I've open a support issue).
On the other side I am exploring new routing options to see how this and other things are handled.
Daniele Dellafiore
me: http://dellafiore.net
get a meeting: http://bookmein.pipelean.com

Francesco Abbruzzese

unread,
Oct 9, 2015, 1:32:45 PM10/9/15
to knock...@googlegroups.com

That is the classic way that assumes google crawler do not executes javascript.

If google crawler do executes javascript when you use mydomain/#page google crawler first go to your home page, then home page js is executed.

NOW you need to configure your home page to execute the router code as soon as home page is loaded.This way as a consequence of js execution the right SPA View is loaded.

Clearly if home page is not configured to execute router on page load nothing will work.

Francesco Abbruzzese

unread,
Oct 10, 2015, 6:25:15 AM10/10/15
to KnockoutJS
Anyway there is no reason why you might not specify #!/page rules with ko.routing.
The default routing rule is something like #/page, but you may write your own default rule and many other routing rules of the type #!......
there is no limit on the format of what you have after #. Documentation explains how to extract the view name and other parameters from the url.The mechanism is a kind of pattern matching that returns the instantiations of all variables contained in the pattern of the rule...so no limit on the format.

On the other side if you would like to test googlebot javascript capabilities...do not forget to make js file accessible to it(not forbidden for bots...)

Daniele Dellafiore

unread,
Oct 11, 2015, 9:21:31 AM10/11/15
to KnockoutJS
thanks, I'll try next week and will let you know.

--
You received this message because you are subscribed to a topic in the Google Groups "KnockoutJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/knockoutjs/jLnqFNmTdaE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages