Skip to content

Commit

Permalink
Moon v1
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jul 19, 2018
2 parents a0f4eed + 806aef1 commit 2b1b1e5
Show file tree
Hide file tree
Showing 133 changed files with 4,598 additions and 7,005 deletions.
57 changes: 57 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"browser": true,
"node": true
},
"rules": {
"constructor-super": 2,
"no-class-assign": 2,
"no-compare-neg-zero": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-empty": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"no-fallthrough": 2,
"no-func-assign": 2,
"no-global-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-mixed-spaces-and-tabs": 2,
"no-new-symbol": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-self-assign": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-undef": 2,
"no-unexpected-multiline": 2,
"no-unsafe-finally": 2,
"no-unsafe-negation": 2,
"no-unused-labels": 2,
"no-unused-vars": 2,
"no-useless-escape": 2,
"require-yield": 2,
"semi": 2,
"use-isnan": 2,
"valid-typeof": 2
}
}
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sh ./build/build.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./build/pr.sh; fi'
node_js:
- "node"
after_success:
- bash <(curl -s https://codecov.io/bash)
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sh ./build/travis.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./build/travis-pr.sh; fi'
node_js:
- "node"
after_success:
- bash <(curl -s https://codecov.io/bash)
35 changes: 6 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Hey! I'm super glad you're interested in contributing to Moon. Helpful contribut

Please ensure you have understood the guidelines before contributing, it helps keep the code organized.

* [Development Setup](https://github.com/KingPixil/moon/blob/master/CONTRIBUTING.md#development-setup)
* [Development](https://github.com/KingPixil/moon/blob/master/CONTRIBUTING.md#development)
* [Submitting an Issue](https://github.com/KingPixil/moon/blob/master/CONTRIBUTING.md#submitting-an-issue)
* [Submitting a Pull Request](https://github.com/KingPixil/moon/blob/master/CONTRIBUTING.md#submitting-a-pull-request)
* [Development Setup](https://github.com/kbrsh/moon/blob/master/CONTRIBUTING.md#development-setup)
* [Development](https://github.com/kbrsh/moon/blob/master/CONTRIBUTING.md#development)
* [Submitting an Issue](https://github.com/kbrsh/moon/blob/master/CONTRIBUTING.md#submitting-an-issue)
* [Submitting a Pull Request](https://github.com/kbrsh/moon/blob/master/CONTRIBUTING.md#submitting-a-pull-request)

### Development Setup

Expand Down Expand Up @@ -62,30 +62,7 @@ Be sure to put the number of the issue you fixed.

##### File Structure

* `src` - main source files
* `compiler` - code for the compiler, which is responsible for lexing, parsing, optimizing, and generating code for templates.
* `directives` - code for all directives, including ones that are invoked at runtime, and special directives that generate code
* `global` - code for the global API
* `instance` - code for instance methods
* `observer` - code for the dependency tracking system, and changing the context of methods
* `util` - code for utilities used throughout the codebase (logs, virtual DOM, DOM operations, and other general utilities)
* `index.js` - code that defines the Moon constructor and normalizes all options
* `wrapper.js` - code that exports Moon correctly depending on the environment
* `dist` - distribution files
* `moon.js` - development version of moon
* `moon.min.js` - production (minified + no warnings) version of moon
* `build` - scripts for automating certain build tasks
* `release.js` - generates release notes and copies them to the clipboard
* `build.sh` - script for Travis CI to run for every push to Git
* `pr.sh` - script for Travis CI to run for every PR
* `test` - files for testing
* `test` - folder with actual test definitions
* `core` - all core tests
* `index.html` - HTML file for Mocha/Chai Phantom browser tests
* `log.js` - file that logs extra information about test results
* `benchmarks` - benchmarks for measuring performance
* `dbmon` - DBMonster benchmark code
* `loop` - Loop benchmark code
TODO

### Submitting an Issue

Expand All @@ -98,4 +75,4 @@ Submit an issue for the following reasons:

### Submitting a Pull Request

Submit a pull request if you'd like to address an issue. Be sure to follow the [development guide](https://github.com/KingPixil/moon/blob/master/CONTRIBUTING.md#development).
Submit a pull request if you'd like to address an issue. Be sure to follow the [development guide](https://github.com/kbrsh/moon/blob/master/CONTRIBUTING.md#development).
39 changes: 11 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
<p align="center"><a href="https://kbrsh.github.io/moon" target="_blank"><img width="100" src="https://raw.githubusercontent.com/kbrsh/moon/gh-pages/img/logo.png"></a></p>
<h1 align="center">Moon</h1>
<p align="center">A minimal, blazing fast UI library.</p>
<p align="center">The minimal & fast UI library.</p>
<p align="center">
<a href="https://travis-ci.org/kbrsh/moon"><img src="https://travis-ci.org/kbrsh/moon.svg?branch=master" alt="Build Status"></a>
<a href="https://codecov.io/gh/kbrsh/moon"><img src="https://codecov.io/gh/kbrsh/moon/branch/master/graph/badge.svg" alt="Code Coverage"></a>
<a href="https://moon-slack.herokuapp.com"><img src="https://moon-slack.herokuapp.com/badge.svg" alt="Slack"></a>
<a href="https://kbrsh.github.io/license"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
<a href="https://travis-ci.org/kbrsh/moon"><img src="https://travis-ci.org/kbrsh/moon.svg?branch=master" alt="Build Status"></a>
<a href="https://codecov.io/gh/kbrsh/moon"><img src="https://codecov.io/gh/kbrsh/moon/branch/master/graph/badge.svg" alt="Code Coverage"></a>
<a href="https://moon-slack.herokuapp.com"><img src="https://moon-slack.herokuapp.com/badge.svg" alt="Slack"></a>
<a href="https://kbrsh.github.io/license"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
</p>
<p align="center">
<a href="https://saucelabs.com/u/KingPixil"><img src="https://saucelabs.com/browser-matrix/KingPixil.svg" alt="Browser Support Table"></a>
<a href="https://saucelabs.com/u/KingPixil"><img src="https://saucelabs.com/browser-matrix/KingPixil.svg" alt="Browser Support Table"></a>
</p>

### Summary

- :tada: Small file size (7kb minified + gzip)
- :tada: Small file size (3kb minified + gzip)
- :zap: Blazing fast performance
- :rocket: Intuitive API
- :gem: Powerful directives
- :hammer: Compose with Components
- :rocket: Minimal & intuitive API
- :hammer: Compose with components

### About

Moon is a simple front end JavaScript library heavily inspired by [Vue](https://vuejs.org). The library is fast, flexible, and easy to learn. Check out the [Medium Article](https://hackernoon.com/introducing-moon-1d44a99635f0) for more information on why I made this.

### Extras

*[moon-cli](https://github.com/kbrsh/moon-cli) - scaffold a feature rich project
* 🚩 [moon-router](https://github.com/kbrsh/moon-router) - fast component router
* 📋 [monx](https://github.com/kbrsh/monx) - clean state management
* 🌎 [moon-ssr](https://github.com/kbrsh/moon-ssr) - universal server-side rendering
* 📊 [moon-bars](https://kbrsh.github.io/moon-bars) - beautiful bar graph component

### Another library?

There have been a lot of JavaScript libraries released lately. Moon has been developed since late 2015. Most libraries are bloated, with a complex API and large file size, leading to applications becoming slower, and less mobile friendly.

Moon differs from the existing solutions by providing a faster, yet compact library with a simple but powerful API. It uses a compiler that uses advanced optimizations to create performant functions for generating virtual DOM trees. The virtual DOM engine uses these trees to efficiently update the DOM. In a variety of benchmarks, Moon has proven itself to be one of the fastest UI libraries out there.

Still, you do not have to use Moon if you are satisfied with your current solution, or if you have already started a project without it. Feel free to use it if you are creating something new, need performance gains, like the intuitive API, or are simply curious.
Moon is a JavaScript library with a minimal API and fast view compiler. It splits up a web application into two parts: the view and the data. The view is responsible for displaying the data to the user. Moon compiles the view into a JavaScript program running on a 3kb runtime capable of creating, updating, and destroying the view. The data is a simple object with access to the Moon API for updating itself.

### Usage

Expand All @@ -53,4 +36,4 @@ Support Moon [on Patreon](https://patreon.com/kbrsh) to help sustain the develop

### License

Licensed under the [MIT License](http://kbrsh.github.io/license) by [Kabir Shah](https://kabir.ml)
Licensed under the [MIT License](https://kbrsh.github.io/license) by [Kabir Shah](https://kabir.sh)
211 changes: 0 additions & 211 deletions benchmarks/dbmon/ENV.js

This file was deleted.

Loading

0 comments on commit 2b1b1e5

Please sign in to comment.