18

A pure JavaScript library - build SPA web applications in a new way(component-or...

 4 years ago
source link: https://www.tuicool.com/articles/3q632qZ
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

ZuckerJS - A new way to build SPA web application.

ZuckerJS is a simple JavaScript library which was given birth to assist any web developer to build any SPA web application by component-oriented architecture(uncoupled components: view, handler and service). It's free, fast, efficient and no required dependencies.

Basically, ZuckerJS relies on some configurations from you to specify what components will be loaded. All of them will be loaded into memory. When user requests a page, ZuckerJS will get location's hash of current window to specify what page will be loaded(in theory). In practice, all components, that have that same route/hash, will be executed to render page dynamically.

ZuckerJS's concept:

Hiding the complexity and creating SPA web application by writing or reusing uncoupled components(view, handler and service components) which ZuckerJS loads based upon developer-defined configurations. It will render web page based on user's requests.

NOTE: this term "component-oriented architecture" can be understood as a set of all uncoupled components to form an application.

Install and Usage

It's simple to install and use ZuckerJS, only in 3 following steps:

  • Download ZuckerJS library "zucker.min.js" from source.
  • Include it at the end of body tag.
  • Configure ZuckerJS for application:
<script>
        window.zucker.config([YOUR_COMPONENT_LIST_HERE]).execute();
    </script>

See more details on WIKI here .

Samples

You can find two samples from source: simple and todo(played with AngularJS).

Benefits

  • Simple, fast and efficient.
  • Component-oriented architecture( all uncoupled components ).
  • SPA + cache.
  • Multiple layouts.
  • Easy to test.
  • Replace any component easily.
  • Mark version easily.

If you want some of them, ZuckerJS will be a right decision for you to work on.

Play with third-party libraries

ZuckerJS can play with all third-party libraries well. Some of them are:

  • jQuery.
  • AngularJS.
  • VueJS.
  • EmberJS.
  • KnockoutJS.

and so on.

Browser Compatibility

  • Google Chrome.
  • Firefox.
  • Edge & Edge Dev.
  • Opera.
  • Safari.
  • IE 8+.

Contributing

We're very glad to receive any contribution from you to make ZuckerJS better.

We appreciate your help!

Copyright & License

©Copyright 2019 by Saposs - MIT License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK