Giter Club home page Giter Club logo

norris's Introduction

norris

Walker, Texas Ranger

This project aims to provide a baseline example of how to use AngularJS with the Google Closure Compiler.

It is a work in progress.

Features:

  • Angular Components (controllers, directives, services, etc) that (1) are optimized for the Closure Compiler, and (2) adhere as closely as possible to the Angular Style Guide, and the JavaScript Style Guide.
  • Compiled JS with strongly typed properties for performance and accuracy.
  • Compiled/Cached templates to minimize Ajax/HTTP requests.
  • Provide Testing coverage with Jasmine, the Karma Runner, and Sinon for spies.
  • Provide End-to-End Testing Converage with Protractor.
  • Much more.

There is nothing new here. This project just assembles the components, and offers an example application.

Rationale:

To come up with a clear example of how to build a clean, fast, highly-scalable front-end applications with AngularJS and Google Closure. The objective is to do so with as few dependencies as possible, such as skipping popular build/automation/minification libraries/frameworks such as Grunt, Gulp, and Bower. This is not always possible, but the goal is to keep the library as light as possible so that others may be incorporated as necessary/needed.

Google Closure provides us with an excellent compiler, linting tools, and a rich library full of utilities that you can pull into your code without pulling the rest of the library with it.

Building / Running

Closure Compiler

The publicly available Google Closure Compiler that you will find here has been recompiled to NOT rename properties.

For example, using the following property could be renamed:

function SomeFunction() {
  this.someProperty = 'Some Value';
}

Because of this, the workaround was to use the following syntax:

function SomeFunction() {
  this.['someProperty'] = 'Some Value';
}

...which didn't look/feel right at all.

So that the compiler would skip property renaming (but hold onto other advanced optimizations), the compiler was recompiled with the the following change:

# This:

options.setRenamingPolicy(
    VariableRenamingPolicy.ALL, PropertyRenamingPolicy.ALL_UNQUOTED);

# Became This:

options.setRenamingPolicy(VariableRenamingPolicy.ALL,
  PropertyRenamingPolicy.OFF);

Compiling the JavaScript source code

To Compile the JS and the Template Cache:

make dependencies

To Start the Express server:

npm start

Build Prerequisites (this is done when you make dependencies):

npm run-script template-cache

...More to come.

Troubleshooting

If you are getting an error like the following:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 51.0

...then you are probably on a Mac, and your Java version is outdated. Please download and install the latest Mac OSX x64 Java SDK here.

norris's People

Contributors

dlochrie avatar moderndegree avatar

Watchers

 avatar

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.