Giter Club home page Giter Club logo

aero's Introduction

Aero JS Logo

NPM Version NPM Downloads Linux Build Status Coverage Status Discord Aero Go

Might cause your phone to explode as your site will load too fast. You have been warned.

Installation

echo "require('aero')().run()" > index.js && npm i aero && node .

Aero Installation & Live Reload

Visit http://localhost:4000/ in your browser and check out Aero in 30 seconds.

Features

  • Routes your pages faster than you can say "Quidditch".
  • Optimizes your website for high latency environments (a.k.a. mobile networks).
  • Allows you to write modern ES 6 with full browser compatibility.
  • Validates HTML 5 for you. Just delete that html5.validator.nu bookmark already.
  • Lets you instantly see local changes in the browser. Use 2 monitors if you're the Al Capone of web devs.
  • Make changes to a prototype while your boss is watching? Aero can update your live server on every git commit.
  • Prevents typical "Oops I forgot the parameter checks" by testing all routes.
  • 99% of execution time is spent in 1% of your code. Find that 1% by looking at response time & size of your pages.
  • Reduces your site's bandwidth hunger by using brotli instead of gzip for static contents.
  • Free ice cream: HTTP/2, IPv6, Web Manifest.
  • More ice cream via plugins: https://github.com/aerojs

Documentation

Benchmark

Aero Router Performance

Screenshot

Terminal output

Examples

URL Source Size Speed
blitzprog.org view source 12 KB 100 / 100
notify.moe view source 15 KB 100 / 100
nihongo-center.com view source 13 KB 100 / 100
increasedvoices.com view source 5 KB 98 / 100

Size: Includes compressed HTML, CSS and JS of the frontpage. Excludes external videos and images.
Speed: Measured by Google PageSpeed. Does not represent real-world loading speed.


By Eduard Urbach

aero's People

Contributors

akyoto avatar hammster avatar patrickmichalina avatar usameavci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aero's Issues

Documentation

  • Configuration
  • Layout
  • API
  • Browser scripts (for pages)
  • Pages
  • Scripts
  • Styles
  • Controllers

Controllers without boilerplate

Example:

  • page.get.js
  • page.post.js

These files wouln't need to include the controller object & function boilerplate:

module.exports = {
    get: function(request, response) {
        response.end('Hello World')
    }
}

So the content of page.get.js would simply be the bare minimum:

response.end('Hello World')

The only problem is how request and response should be named since this is very opinionated.
Personally I prefer to not use abbreviations because we have autocomplete for a reason. So I'd go with the names I just mentioned.

Implementation

page.get.js should simply be compiled into a module that exports the get function. The get function is then assigned to the either existing or automatically created controller object.

Stylus

Stylus compilation to CSS.

Use promises instead of async

Use a very high-level definition of what Aero is doing in aero.run() using Promises and emit the event "ready" when everything finished.

Layout JSON

Load JSON file for the layout and send the data to Jade.

JSON linting

Should automatically check the JSON output from pages that send back JSON.

Global scripts

Global scripts used on every page should be in the scripts directory. Compilation order is determined by the configuration file.

Serve static files

Each folder specified in the "static" array in the configuration should serve static files.

Optional:

  • cached with gzip compression
  • automagically watched by Aero

Page JSON

If there is a JSON file it should be automatically loaded and added to the locals of the jade template render.

Subpages

Aero should scan subdirectories for controllers and add them to the router.

Load plugins as node modules

Currently they're included in Aero but they should really be external npm modules.

Something like:

require(`aero-${pluginName}`).init()

Not all tests are run

Sometimes only 14 tests are run and it incorrectly reports that the build is passing.
This needs to be fixed asap.

Better HJSON file extension

Seriously, 5 characters is too much.

Maybe HSON or HON. I like HSON because it makes it very obvious that it's JSON related, however the letters don't make much sense (Human Scripting Object Notation?). Well screw the meaning, it looks better.

Page styles should be global styles, not scoped

Scoped styles are an anti-pattern for rendering performance.
It's better to properly use CSS classes instead of relying on the scoped attribute because recalculating styles on an AJAX request is bad for performance.

Therefore page styles are going to be global soon.
You should still put them into the page directory because you'll want all related components in one place.

Custom routing

The server and aero.get() should support custom routes.
That means that you can associate /very/special/route with a request handler.

Global styles

Styles that can be used on every page should be in the styles directory.
Compilation order is determined by the configuration file.

passport.js

Test if passport works normally with Aero.

Middleware

We need a middleware architecture.
Middleware that works with frameworks like Express should work with Aero as well.

Compression

gzip compression should be enabled by default.

response.json()

Should automatically set headers.
Only available on pages without templates.

Default "reset" style

Add a default style called "reset" which will be used if reset.styl has not been found in the styles directory of the project. It should include a pretty standard HTML 5 reset.

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.