Coder Social home page Coder Social logo

tech-stack-academy / slim.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slimjs/slim.js

0.0 0.0 0.0 2.16 MB

Fast & Robust Front-End Micro-framework based on modern standards

Home Page: http://slimjs.com

License: MIT License

HTML 23.46% JavaScript 76.54%

slim.js's Introduction

hello, slim.js

Build Status

Chat on gitter

Hello, slim.js

Declarative Web Components

Slim is an ultra fast, native and elegant library for Web Components development

Slim.js is a lightning fast library for development of native Web Components and Custom Elements based on modern standards. No black magic involved, no useless dependencies.

It uses ES6+DOM native API to boosts up HTML elements with superpowers.

It is extensible: You can add your own directives (HTML-compilant) for DOM manipulation.

It is pluggable: You can add plugins that are activated during different hooks in component's lifecycle.

Is this another framework?

Nope. It's a very thin code layer (~3k) that adds framework-like power to your custom elements, using only the browser's native capabilities โ€” as defined by W3C standards.

Here's what you get:

  • Automatic rendering using templates.
  • One-way data binding, derived from templates. No need to declare which properties are what.
  • It can be extended: anyone can add custom plugins or directives.
  • It feels like a framework (in a good way), but without the limits of a classic framework. It works everywhere, you pick your own framework.
  • It's as small as 3.4 KBytes (gzipped) and the built-in directives are OPTIONAL!
  • Single file for core functionality, and you're good to go.
  • No dependencies, everything is based on native browsers' API. Choose your own tools.
  • (Optional) Decorators for ES7/Next syntax, via Babel included.
  • Works with mixins from other component libraries, such as Polymer, out of the box.

Standards-compliant

  • ES6
  • Web Components V1
  • No transpiling or compilation required

No Setup required. It just works.

  • Add Slim.js to your project and you're good to go!

Documentation

The official website is built with Slim.js (with source maps). Check out the source code, see it for yourself.

Version 4+ Changes and Migration

  • Package files supports ES6 native modules - i.e. import / exports.
  • For no-modules approach, every file has a filename.nomodule.js
  • Directives are in separate files, to reduce core package size. For using directives:
import 'slim-js/directives/repeat.js'
import 'slim-js/directives/if.js'
import 'slim-js/directives/switch-case.js'
// Or if you need them all
import 'slim-js/directives/all.js'
  • For the no-module approach place in your HTML:
<script src="slim-js/Slim.nomodule.js"></script>
<script src="slim-js/directives/all.nomodule.js"></script>

or alternatively use the ES6 native modules in your browser:

<script type="module" src="slim-js/Slim.js"></script>
<script type="module" src="slim-js/directives/..."></script>

Contibutors are welcome.

USE THE PLATFORM

Do you want to be a supporter? Contact [email protected].

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.