Skip to content

v0.2.0

Compare
Choose a tag to compare
@kentmw kentmw released this 09 Aug 20:40
· 642 commits to master since this release

To see changes:
v0.1.7...49f4e97

Issues resolved in 0.2.0:
#3, #5, #39, #42, #47, #61, #62, #63, #64, #66, #67, #68, #71, #72, #73, #75, #76, #77, #102, #103, #104

  1. Updates to README.md
  2. Created DOCUMENATION.md to give a lengthy explanation of the major topics and most modules
  3. Adding modules got easier, because updates to bundle.js no longer require understanding the order of dependencies. Instead, if a module depends on your module, name your module as a dependency under the "dependencies" variable in bundle.js. Likewise, if your module depends on another, add an entry to "dependencies" and list your module's dependencies. NOTE: it will look in the /modules directory for any modules, so standalone modules require no additional configuration.
  4. All internal variable and method names used by Torso should be prefixed with double underscore: "__". Any references to Torso internal methods (most often they were already prefixed by a single underscore: "_") should be updated. Variables and methods that are part of the public API, will contain no prefix.
  5. FormModel's can now contain a "url" field. This allows for multi-model, transactional saving. See #5 for more details on the implementation/API.
  6. View.js and FormView.js now default to add "model" and "view" as part of the context created by prepare(). If you override prepare() method, you will have to add these back. They contain this.model.toJSON() if one exists, and this.viewState().toJSON() respectively.
  7. The feedback mechanism was refactored out of FormView and put into View. All views should now have feedback available to them.
  8. A View's feedbackModel was changed to feedbackCell. Any reference to feedbackModel should be updated to be feedbackCell
  9. ListView's getChildView method name was changed to getChildViewFromModel. References need to be updated.
  10. All Torso implementation to set up a View was moved to Backbone's constructor option. This means that when extending a View, there is no need to invoke Torso.View's initialize method or a super method. However, any further extensions, should still invoke their parents initialize method.
  11. All mentions to super were removed from View and Collection. Either this logic has been already handled (as in the case of View and Collection) before initialize is invoked or a direct invocation of the parent's method are needed (as with FormView, ListView, and other specific extensions of the base classes).
  12. A View now comes with a viewState field that can keep track of important data associated with the view's state. This is convenient when you want to utilize a cell's ability to trigger or react to events. Also, by default, viewState is available in your template because the prepare() method's adds it to the context.
  13. this.render() is not invoked automatically when a view is instantiated. Instead it is invoked on attach(), when the view is about to be attached to the DOM.
  14. By default, a view is "activated" when instantiated.
  15. The introduction of a view lifecycle was introduced. Initialize/dispose, activate/deactivate, attach/detach are now part of the life of a view. Callbacks were introduced (_activate, _deactivate, _dispose) for adding custom logic when these states are reached. For more details, look for the "View" section of the https://github.com/vecnatechnologies/backbone-torso/blob/master/docs/DOCUMENTATION.md
  16. View's render now defaults to invoke plug and unplug
  17. Collection mixins were slightly simplified to be pure Backbone extensions rather than complicated mixins. This may cause issues if you were relying on Backbone's parent field.
  18. Collection's fetch now returns a promise. (Both cache and requester)
  19. Collection added addModelAndTrack and trackNewId which are convenience methods to help add/track a single id.
  20. Fetch from a cache collection will either make a GET request to the base collection url, or if fetchUsingTrackedIds: true was passed as an option during construction, it will only fetch the ids it is currently tracking.
  21. A cache collection can now change the HTTP action performed during a fetchByIds using the option fetchHttpAction.
  22. A configure module was added, that when required simplifies configuring Torso. See #39 for more details.
  23. guidManager was removed. Please remove all references of this module
  24. handlebarsUtils no longer makes an explicit dependency on Handlebars. Instead the module returns a function that when invoked with Handlebars passed in as the only argument, Torso's handlebars helpers are added.
  25. Some bug fixes to templateRenderer
  26. Handlebars is now not a dependency of Torso
  27. Test cases were added for collections.
  28. Test cases were added for FormModel transactional saving
  29. Added isAttached() to view. This returns true if the view is attached to the DOM.
  30. Added _attached and _detached callbacks that fire on the view and its children when the the view is attached or detached from the DOM.

Upgrade notes from 0.1.x to 0.2.x:

  • ListView had a bunch of properties' name change from _ to (view._collection -> view.collection).
  • View.super() is no longer a thing.
  • TorsoView.initialize is empty (moved logic to constructor).
  • Views are no longer rendered on creation (but attaching calls render anyway).
  • Torso Handlebar helpers need to be setup explicitly in each app.
  • cleanupSelf() is no longer a thing. Override _dispose() and you don't have to worry about the super's dispose logic.
  • Activate, detach, attach, deactivate, dispose should use their _ counterparts and should be rarely overridden.
  • Default prepare now has 2 properties { model: model.toJSON(), view: viewState.toJSON() } - some templates needed to be updated.