18F / jekyll_pages_api_search

DEPRECATED - Jekyll search plugin based on lunr.js and jekyll_pages_api
https://rubygems.org/gems/jekyll_pages_api_search
Other
39 stars 8 forks source link

Switch from bower to npm for most dependencies #4

Closed mbland closed 9 years ago

mbland commented 9 years ago

Prompted by @msecret to read an article about preferring npm to bower.

This nudged me towards the convention of "rely on the npm by default" for JavaScript dependencies. This necessitated bumping the Angular version to 1.3.x, as Angular wasn't properly browserify-able until 3.1.14.

The new Angular version causes a ~19K bump in minified bundle size, ~7k compressed:

  Before:
  133068 assets/js/search-bundle.js
   47680 assets/js/search-bundle.js.gz

  After:
  151892 assets/js/search-bundle.js
   54533 assets/js/search-bundle.js.gz

Bower is still used for angular-livesearch, but the debowerify transform is no longer needed, as it just calls angular.module() and doesn't actually export anything.

Thoughts? Worth the trouble? Leave good enough alone?

cc: @afeld

afeld commented 9 years ago

FYI, just enabled Travis, so we should ensure that the build passes successfully.

afeld commented 9 years ago

Womp.

https://travis-ci.org/18F/jekyll_pages_api_search/builds/65161502

mbland commented 9 years ago

Pushed a ci_build target that should work, once Travis gets hip to it.

afeld commented 9 years ago

You need to set script: bundle exec rake ci_build in the .travis.yml in that case.

mbland commented 9 years ago

So the sizes are very slightly smaller switching to napa:

151846 assets/js/search-bundle.js
 54514 assets/js/search-bundle.js.gz
afeld commented 9 years ago

We need to see if we can iterate through every package manager for this site :trollface:

:shipit: