ampersand-state
ampersand-state copied to clipboard
Upgrade lodash dependency to 4.*
lodash
is currently on version 4.2.1
but all of ampersand-*
packages are using 3
. I think that a complete ampersand project wide upgrade should occur with perhaps a major version bump for each ampersand package. lodash 4.0.0
has been out since 2016-01-12
.
Maybe wait another month and then bump it?
This is certainly something that would be nice to have, it's quite a large undertaking though. Wondering if anyone feels they have the time to carve out to do this?
it may be easy-ish to do using ampersand-family-meeting . could be a good first run with it. need to finish the PR logic, which won't be hard. doesn't cover the package publishing, but could with a little elbow grease :)
Would love to see this. I'm working on migrating a library to lodash 4 using babel-plugin-lodash and the library doubled in size because ampersand is pulling in lodash 3
@cdaringe Is it really so difficult to update all packages to use a new lodash?
@dschissler, full time job, school, and life! you're welcome to start staging these PRs on your own if you want. we'd happily accept them :). the upgrade is not so seamless
- not all modules are compatible with the upgrade immediately. i did upgrade &-view, and it didn't pass tests. debugging required
- all lodash refs need to be converted to
lodash/mod
vslodash.mod
for package size reduction - to be most effective, we'd want and try and hit ampersandjs-core modules (most important) but propose the updates to community modules as well. with everyone aligned, bundle sizes continue to drop.
npm search
will show you that the following pkgs exist:
- ampersand-app
- ampersand-array-checkbox-view
- ampersand-array-input-view
- ampersand-auto-closing-view
- ampersand-autocomplete-view
- ampersand-avatar-field
- ampersand-avatar-input-view
- ampersand-bootstrap-tagsinput-view
- ampersand-bubble-prop
- ampersand-calendar
- ampersand-chart
- ampersand-checkbox-view
- ampersand-chess-state
- ampersand-chess-view
- ampersand-class-extend
- ampersand-collection
- ampersand-collection-filterable
- ampersand-collection-fluxible-mixin
- ampersand-collection-history
- ampersand-collection-jquery-datatable
- ampersand-collection-lodash-mixin
- ampersand-collection-pouchdb-mixin
- ampersand-collection-pusher-mixin
- ampersand-collection-rest-mixin
- ampersand-collection-sort-mixin
- ampersand-collection-underscore-mixin
- ampersand-collection-view
- ampersand-controller-router
- ampersand-date-view
- ampersand-date-view2
- ampersand-dependency-mixin
- ampersand-dom
- ampersand-dom-bindings
- ampersand-domthing-mixin
- ampersand-drawer-view
- ampersand-events
- ampersand-expanding-textarea-view
- ampersand-express-router
- ampersand-fetch
- ampersand-file-drop-view
- ampersand-filereader-input-view
- ampersand-filter-tracker
- ampersand-filtered-collection
- ampersand-filtered-subcollection
- ampersand-floatinglabel-input-view
- ampersand-form-manager-view
- ampersand-form-view
- ampersand-fullcalendar-view
- ampersand-grid-view
- ampersand-grouped-collection-view
- ampersand-hoodie-collection
- ampersand-hoodie-mixin
- ampersand-hoodie-model
- ampersand-infinite-scroll
- ampersand-input-view
- ampersand-io
- ampersand-io-collection
- ampersand-io-model
- ampersand-jid-datatype-mixin
- ampersand-json-patch
- ampersand-jsonapi-ajaxconfig
- ampersand-jsonapi-collection
- ampersand-jsonapi-model
- ampersand-local-cache-mixin
- ampersand-main-view
- ampersand-mixins
- ampersand-modal-view
- ampersand-model
- ampersand-model-optimistic-update-mixin
- ampersand-model-patch-mixin
- ampersand-model-pouchdb-mixin
- ampersand-model-pusher-mixin
- ampersand-model-validations-mixin
- ampersand-movingobj
- ampersand-multifield-view
- ampersand-multiselect-view
- ampersand-offline-first
- ampersand-optimistic-sync
- ampersand-paginated-subcollection
- ampersand-pagination-mixin
- ampersand-pikaday-view
- ampersand-pouchdb-sync
- ampersand-questionnaire-view
- ampersand-radio-view
- ampersand-react-connector
- ampersand-react-mixin
- ampersand-react-view
- ampersand-react-view-mixin
- ampersand-registry
- ampersand-rest-collection
- ampersand-router
- ampersand-router-query-parameters
- ampersand-sanitized-html-data-type
- ampersand-search-select
- ampersand-select-view
- ampersand-single-sync
- ampersand-state
- ampersand-state-fluxible-mixin
- ampersand-state-mixin-datatype-function
- ampersand-state-mixin-datatype-iso-date
- ampersand-store
- ampersand-subcollection
- ampersand-sync
- ampersand-sync-adapter
- ampersand-sync-localforage
- ampersand-sync-promise
- ampersand-sync-with-promise
- ampersand-tab-view
- ampersand-time-range
- ampersand-version
- ampersand-view
- ampersand-view-conventions
- ampersand-view-jquery-events
- ampersand-view-jquery-mixin
- ampersand-view-switcher
- ampersand-virtual-dom-mixin
- ampersand-webcam-snapshot-view
- ampersand-websocket-hint
- ampersand-webworker-demo
- ampersand-wildemitter-datatype-mixin
so, in summary, (not to be curt), it is difficult and very time consuming. that's why i started working on ampersand-family-agenda--to help automate these upgrades and to ease the synchronization of our loosely-coupled framework!
Hey @cdaringe Thanks for all the details. Why is lodash/get
better for package size reduction over lodash.get
? Doesn't the roll-up technique work the same on both?
hey @pgilad! how's it goin man?
j dalton explained in a presentation that the lodash.xzy
inlines the module with all of its dependencies. so, if .get
and .set
both have a common dep (which they do, _isKey
), you will consequently "over-bundle" it using the dot strategy.
by example:
// get-set-dot-strategy.js
var set = require('lodash.set');
var get = require('lodash.get');
// get-set-slash-strategy.js
var set = require('lodash/set');
var get = require('lodash/get');
# post browserify
cdieringer staff 17038 Mar 25 00:34 get-set-dot-strategy.bundled.js
cdieringer staff 15318 Mar 25 00:35 get-set-slash-strategy.bundled.js # less, yahtzee!
@cdaringe Once everything is upgraded when using NPM 3 it would be the same since it installs flat dependencies. Just sayin'.
@cdaringe Would we bump the major version on every single post 1.0 module? Also I think that if someone committed to upgrading about 20 core packages that they should be allowed a commit freeze for a defined period of time to get it all done. It could become very annoying if tiny commits were sneaked into various packages during this conversion.
I'm not sure how I would test it since I'm using only the following in my project:
ampersand-class-extend
ampersand-collection
ampersand-collection-view
ampersand-dom
ampersand-dom-bindings
ampersand-events
ampersand-router
ampersand-state
ampersand-version
ampersand-view
ampersand-view-switcher
@cdaringe thanks for the info man!
I could get the upgrades in some of the packages if you want
@cdaringe Once everything is upgraded when using NPM 3 it would be the same since it installs flat dependencies. Just sayin'.
hey @dschissler, the dot strategy inlines the dependencies, so even if npm3 flattens deps, they will still be duplicated in each lodash module :)
I could get the upgrades in some of the packages if you want
@pgilad, if you'd like to! it's really about keepin' the users happy by this point, and churning to keep our deps up to date. maybe greenkeeper is something we should consider? i'm definitely not opposed to getting the ball rolling, i'm just swamped ATM
Given our test coverage, and the fact that greenkeeper makes PRs from local branches (i.e. the saucelabs credentials would show up) I'd be all for enabling greenkeeper.
@cdaringe Can you verify this is the proper direction? https://github.com/AmpersandJS/ampersand-events/pull/15
Looks good @pgilad and that's a good module to start in cause it's at the top of the dependency tree.