Skip to content

Instantly share code, notes, and snippets.

@ericf
Created November 15, 2011 04:26
Show Gist options
  • Select an option

  • Save ericf/1366136 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/1366136 to your computer and use it in GitHub Desktop.

Preferential ordering of server and browser capabilities to determine if client- side routing should happen and enhance an application's user experience.

Format: (app has capable server) && (browser has pushState) => (should route)

  1. server && html5 //=> routes
  2. server && !html5 //=> !routes
  3. !server && html //=> routes
  4. !server && !html5 //=> routes

Note: When the application has a server capable of servicing requests, but the browser does not have the HTML5 History APIs (pushState); then the app should degrade to let the server handle all full-page requests.

Names for a flag on Y.App that denotes that the application has a server-side component that is capable of handling HTTP requests. The default will be to assume the developer is a good developer and their client-side application can gracefully degrade to sending all full-page requests to the server.

Possible candidates, format: (name): (default)

  • degradable: true
  • isDegradable: true
  • degrades: true
  • canDegrade: true
  • hasServer: true
  • clientOnly: false
  • Others??
@ericf
Copy link
Copy Markdown
Author

ericf commented Nov 15, 2011

I like serverRouting too, it makes the attribute feel both like it is configurable and describes the server's capabilities. Even if the server is capable of routing, the developer can choose to turn it off and have URLs degrade to hash-based in non-HTML5 browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment