dwyl / dwyl/learn-closure-compiler

How?

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted question
Dominant language
No language data
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The instructions in the repo: https://github.com/google/closure-compiler-js are quite clear.
The _output_ is the standard "_compiled_" output you'd would expect.

A _tiny example_ featuring `Object.assign` (ES6 Feature):

``` js
var user = { name: 'Jack', email: 'jackiscuel@email.net' };
var meta = { height: '185', eyes: 'blue', hair: 'blonde' };
var social = { twitter: 'jackyboy', instagram: 'iamjack' };
// and combine them into a new object with Object.assign:
var jack = Object.assign({}, user, meta, social);
```

Gets compiled to:
![learn-closure-compiler--object assign-example-compiled](https://cloud.githubusercontent.com/assets/194400/18807872/c12a6284-824a-11e6-8e47-4f031be47920.png)

The `Object.assign` gets [polyfilled](https://remysharp.com/2010/10/08/what-is-a-polyfill) and the resulting (_compiled_) code has quite a few more characters than the _source_.
(_obviously, the benefits of compilation will be felt better in a larger codebase..._)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.