Giter Site home page Giter Site logo

thelgevold / closure-compiler-angular-bundling-old Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexeagle/closure-compiler-angular-bundling

7.0 6.0 2.0 26.67 MB

demo app for https://github.com/angular/angular/issues/8550

License: MIT License

Shell 19.58% HTML 19.45% TypeScript 60.67% CSS 0.30%

closure-compiler-angular-bundling-old's Introduction

This repo is a proof-of-concept for bunding an Angular application with Google Closure Compiler. It contains a minimal Hello World application with a single component.

The current compressed JS size for an Angular Hello World app is 28kb.

++ ls -alH dist/bundle.js dist/bundle.js.brotli dist/bundle.js.gz dist/bundle.js.map
-rw-r--r--  1 alexeagle  eng   77541 Jan 17 14:19 dist/bundle.js
-rw-r--r--  1 alexeagle  eng   21379 Jan 17 14:19 dist/bundle.js.brotli
-rw-r--r--  1 alexeagle  eng   24512 Jan 17 14:19 dist/bundle.js.gz
-rw-r--r--  1 alexeagle  eng  214850 Jan 17 14:19 dist/bundle.js.map
++ ls -alH node_modules/zone.js/dist/zone.min.js node_modules/zone.js/dist/zone.min.js.brotli node_modules/zone.js/dist/zone.min.js.gz
-rw-r--r--  1 alexeagle  eng  24490 Jan 12 18:12 node_modules/zone.js/dist/zone.min.js
-rw-------  1 alexeagle  eng   7270 Jan 17 14:19 node_modules/zone.js/dist/zone.min.js.brotli
-rw-r--r--  1 alexeagle  eng   8114 Jan 12 18:12 node_modules/zone.js/dist/zone.min.js.gz

See angular/angular#8550 for more context.

Try it

$ npm install
$ npm run build
$ python -m SimpleHTTPServer

Where does the size come from?

$ npm run explore

Notes

This requires an ES6 distro of Angular. I have published my own personal snapshot, which is built from this branch: https://github.com/alexeagle/angular/tree/closure

See package.json for how this is used in the demo.

Requires Node 6.x since the ngc tool (and its deps) are now shipped as ES6 as well.

Requires building rxjs from https://github.com/alexeagle/rxjs/tree/closure2 using npm run compile_dist_es6_for_closure. Copy this into the vendor directory.

TODO

  • Get an official Angular distro with ES6, don't use my branch.
  • Need rxjs to produce a closure-compatible ES6 distro, don't use my branch.
  • Remove the hack of needing node_modules/rxjs for nodejs and vendor/rxjs for browser
  • Extend the demo to use a 3rd party component, like @angular/material

closure-compiler-angular-bundling-old's People

Contributors

alexeagle avatar jeffbcross avatar jkuri avatar robwormald avatar thelgevold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.