基于Knockout的单页程序(SPA)框架 knockout-spa
发布于 12小时前 作者 onlyurei 90 次浏览 来自 分享

今天刚开源,文档还很欠缺。不过项目文件应该是自说明的。欢迎大家的feedback! https://github.com/onlyurei/knockout-spa

knockout-spa

Take a SPA with Knockout.

What is this?

  • A mini (but full-fledged) SPA framework built on top of Knockout, Require, Director, jQuery, Sugar.
  • 1.0.0

How do I use it?

  • All required files are in the repo already
  • Take a look at the file structure and comments/TODOs in the bootstrapped setup - you’ll figure out everything in 30 minutes
  • Only needed external thing is the RequireJS optimizer r.js, just run npm install in the repo

Features

  • Routing (based on Flatiron’s Director): HTML5 history (pushState) or hash.
  • Highly composable and reusable: pick modules/components for a page in the page-specific JS and they will be auto-wired for the page’s HTML template
  • SEO ready (prerender.io)
  • Fast and lightweight (85 KB of JS minified and gizpped)
  • Two-tier bundle build for JS for production: common module that will be used by most pages, and page-specific modules that will be lazy-loaded
  • Organized folder structure to help you stay sane for organizing and reusing JS, CSS, HTML
  • Using Knockout 3.3.0+ so ready for Knockout’s flavor of web component and custom tags (http://knockoutjs.com/documentation/component-overview.html)
  • All documentation are in the major dependencies’ own homepages, so that you don’t need to completely learn a new framework

Demo

Seeing/hacking is believing, here you go.

RentEver - Social Rental Marketplace http://rentever.com

回到顶部