Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Gulp task enhancements - template cache #704

Closed
wants to merge 91 commits into from

Conversation

rhutchison
Copy link
Contributor

These are updates to gulp build automation.

Gulp Template Cache

Added angular-templatecache to cache templates for prod environment and combine with application.min.js. No more html files loaded in prod.

Auto Prefixer

As of bootstrap 3.2, vendor prefixes are deprecated in favor of autoprefixer.

Ref: https://github.com/twbs/bootstrap/blob/master/less/mixins/vendor-prefixes.less#L3

@rhutchison
Copy link
Contributor Author

@ilanbiala please review

@mleanos
Copy link
Member

mleanos commented Jul 25, 2015

LGTM.

@@ -9,7 +9,7 @@
"curly": false, // Require {} for every new block or scope.
"eqeqeq": true, // Require triple equals i.e. `===`.
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"latedef": true, // Prohibit variable use before definition.
"latedef": "nofunc", // Prohibit variable use before definition.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "nofunc" mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to ignore function declarations - jshint/jshint#941

Taken from angular-styleguide

@ilanbiala ilanbiala added this to the 0.4.0 milestone Jul 25, 2015
@ilanbiala ilanbiala self-assigned this Jul 25, 2015
@rhutchison rhutchison closed this Jul 26, 2015
@rhutchison rhutchison reopened this Jul 26, 2015
@ilanbiala
Copy link
Member

@rhutchison squash?

@rhutchison
Copy link
Contributor Author

@ilanbiala Wanted to give you time to review. You want it down to 1 commit?

@ilanbiala
Copy link
Member

Yes please.

@rhutchison
Copy link
Contributor Author

@ilanbiala ready for final review

@ilanbiala
Copy link
Member

@rhutchison I like the idea and the implementation seems fine, but I'm trying to figure out how much the performance actually increases. Is there any way for you to maybe test a couple pages and see if it is indeed faster and by how much?

@rhutchison
Copy link
Contributor Author

it will avoid the html download on every page load, so the rendering is much quicker. The performance will be based on the client internet connection/speed.

@ilanbiala
Copy link
Member

Ok, until we remove Grunt, will this cause issues in the JS?

@ilanbiala
Copy link
Member

@rhutchison since this only adds features and doesn't break anything, I'm moving this to 0.4.x and if it's ready for 0.4.0 in the next few days I'll move it back and merge, but there really isn't much rush to shove it out.

@ilanbiala ilanbiala modified the milestones: 0.4.x, 0.4.0 Jul 29, 2015
@rhutchison
Copy link
Contributor Author

@lirantal @ilanbiala I tested 'grunt prod' with these changes. I didn't notice any issues.

grunt prod

@codydaig
Copy link
Member

LGTM

@lirantal
Copy link
Member

@rhutchison yeah of course it will be pretty much ok since most of the change is on gulp.
On that - what does the template cache do and how does it work? I'm curious

Also, why do we need "latedef": "nofunc" ?

@rhutchison
Copy link
Contributor Author

@lirantal #704 (comment)

template cache will look for all of the html files in the application and then compile them in to javascript statements and minify with the app, so all of the html is downloaded with the app. If you look at network traffic when you are using the app, whenever you change state, you will see the html is fetched, which will slow down the initial state load. What angular does is when the html is fetched from the server, it is put in template cache. This does that step at build time (on production).

@lirantal
Copy link
Member

so basically template cache means all the HTML templates for Angular actually downloaded when the app first loads so that it doesn't need to go and download them later on?
I'm not against but it sounds to me like simply a trafe-off between when to download the templates, at first app load or later on one by one, and when the templates grow then this will mean more time to load the app on first load.

simison and others added 22 commits August 21, 2015 15:36
Link to editorconfig.org from CONTRIBUTING.md
Added Deploy To Bluemix button to the README
[fix] Was storing a 6 char password in plain text [fixes meanjs#829]
Correct <br /> Tags and set Title
…l not be mapped. Username will be generated from first initial of first name and last name.

.jshint latedef set to nofunc.
current implementation does double redirect due to '#!'
local.example.js still has old fb auth callback
mask exception route for 404 responses.
…links

Refreshing the M.E.A.N links and description in the homepage
Added Auth Interceptor tests

cleaned up test

Update routes
remove data prefix from attributes.

fix tests
client-side form validation with ng-messages.
lint is already referenced in build task.

missing env:prod

add client/server test tasks

Add template cache and autoprefixer.

Update .jshintrc
@rhutchison rhutchison force-pushed the task-enhancements branch 4 times, most recently from 4c007e3 to 1fa9776 Compare August 26, 2015 04:55
@rhutchison
Copy link
Contributor Author

Reopening against master

@rhutchison rhutchison closed this Aug 26, 2015
@rhutchison rhutchison deleted the task-enhancements branch September 16, 2015 02:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.