Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade lodash dependency to 4.* #230

Open
dschissler opened this issue Feb 4, 2016 · 15 comments
Open

Upgrade lodash dependency to 4.* #230

dschissler opened this issue Feb 4, 2016 · 15 comments

Comments

@dschissler
Copy link

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?

@wraithgar
Copy link
Contributor

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?

@cdaringe
Copy link
Member

cdaringe commented Feb 4, 2016

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 :)

@ianwremmel
Copy link

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

@dschissler
Copy link
Author

@cdaringe Is it really so difficult to update all packages to use a new lodash?

@cdaringe
Copy link
Member

@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 vs lodash.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:
  1. ampersand-app
  2. ampersand-array-checkbox-view
  3. ampersand-array-input-view
  4. ampersand-auto-closing-view
  5. ampersand-autocomplete-view
  6. ampersand-avatar-field
  7. ampersand-avatar-input-view
  8. ampersand-bootstrap-tagsinput-view
  9. ampersand-bubble-prop
  10. ampersand-calendar
  11. ampersand-chart
  12. ampersand-checkbox-view
  13. ampersand-chess-state
  14. ampersand-chess-view
  15. ampersand-class-extend
  16. ampersand-collection
  17. ampersand-collection-filterable
  18. ampersand-collection-fluxible-mixin
  19. ampersand-collection-history
  20. ampersand-collection-jquery-datatable
  21. ampersand-collection-lodash-mixin
  22. ampersand-collection-pouchdb-mixin
  23. ampersand-collection-pusher-mixin
  24. ampersand-collection-rest-mixin
  25. ampersand-collection-sort-mixin
  26. ampersand-collection-underscore-mixin
  27. ampersand-collection-view
  28. ampersand-controller-router
  29. ampersand-date-view
  30. ampersand-date-view2
  31. ampersand-dependency-mixin
  32. ampersand-dom
  33. ampersand-dom-bindings
  34. ampersand-domthing-mixin
  35. ampersand-drawer-view
  36. ampersand-events
  37. ampersand-expanding-textarea-view
  38. ampersand-express-router
  39. ampersand-fetch
  40. ampersand-file-drop-view
  41. ampersand-filereader-input-view
  42. ampersand-filter-tracker
  43. ampersand-filtered-collection
  44. ampersand-filtered-subcollection
  45. ampersand-floatinglabel-input-view
  46. ampersand-form-manager-view
  47. ampersand-form-view
  48. ampersand-fullcalendar-view
  49. ampersand-grid-view
  50. ampersand-grouped-collection-view
  51. ampersand-hoodie-collection
  52. ampersand-hoodie-mixin
  53. ampersand-hoodie-model
  54. ampersand-infinite-scroll
  55. ampersand-input-view
  56. ampersand-io
  57. ampersand-io-collection
  58. ampersand-io-model
  59. ampersand-jid-datatype-mixin
  60. ampersand-json-patch
  61. ampersand-jsonapi-ajaxconfig
  62. ampersand-jsonapi-collection
  63. ampersand-jsonapi-model
  64. ampersand-local-cache-mixin
  65. ampersand-main-view
  66. ampersand-mixins
  67. ampersand-modal-view
  68. ampersand-model
  69. ampersand-model-optimistic-update-mixin
  70. ampersand-model-patch-mixin
  71. ampersand-model-pouchdb-mixin
  72. ampersand-model-pusher-mixin
  73. ampersand-model-validations-mixin
  74. ampersand-movingobj
  75. ampersand-multifield-view
  76. ampersand-multiselect-view
  77. ampersand-offline-first
  78. ampersand-optimistic-sync
  79. ampersand-paginated-subcollection
  80. ampersand-pagination-mixin
  81. ampersand-pikaday-view
  82. ampersand-pouchdb-sync
  83. ampersand-questionnaire-view
  84. ampersand-radio-view
  85. ampersand-react-connector
  86. ampersand-react-mixin
  87. ampersand-react-view
  88. ampersand-react-view-mixin
  89. ampersand-registry
  90. ampersand-rest-collection
  91. ampersand-router
  92. ampersand-router-query-parameters
  93. ampersand-sanitized-html-data-type
  94. ampersand-search-select
  95. ampersand-select-view
  96. ampersand-single-sync
  97. ampersand-state
  98. ampersand-state-fluxible-mixin
  99. ampersand-state-mixin-datatype-function
  100. ampersand-state-mixin-datatype-iso-date
  101. ampersand-store
  102. ampersand-subcollection
  103. ampersand-sync
  104. ampersand-sync-adapter
  105. ampersand-sync-localforage
  106. ampersand-sync-promise
  107. ampersand-sync-with-promise
  108. ampersand-tab-view
  109. ampersand-time-range
  110. ampersand-version
  111. ampersand-view
  112. ampersand-view-conventions
  113. ampersand-view-jquery-events
  114. ampersand-view-jquery-mixin
  115. ampersand-view-switcher
  116. ampersand-virtual-dom-mixin
  117. ampersand-webcam-snapshot-view
  118. ampersand-websocket-hint
  119. ampersand-webworker-demo
  120. 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!

@pgilad
Copy link
Member

pgilad commented Mar 25, 2016

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?

@cdaringe
Copy link
Member

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!

@dschissler
Copy link
Author

@cdaringe Once everything is upgraded when using NPM 3 it would be the same since it installs flat dependencies. Just sayin'.

@dschissler
Copy link
Author

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

@dschissler
Copy link
Author

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

@pgilad
Copy link
Member

pgilad commented Mar 25, 2016

@cdaringe thanks for the info man!

I could get the upgrades in some of the packages if you want

@cdaringe
Copy link
Member

@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

@wraithgar
Copy link
Contributor

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.

@pgilad
Copy link
Member

pgilad commented Mar 26, 2016

@cdaringe Can you verify this is the proper direction?
AmpersandJS/ampersand-events#15

@wraithgar
Copy link
Contributor

Looks good @pgilad and that's a good module to start in cause it's at the top of the dependency tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants