Breaking changes:
- Batman.js depends on an implementation of
Promise(build files includees6-promisespolyfill) - Set constructor takes a single param -- an array of members https://github.com/batmanjs/batman/pull/1042
- HasOne always returns
HasOneProxyhttps://github.com/batmanjs/batman/pull/1120 - Model storage operations return a Promise https://github.com/batmanjs/batman/pull/1099
toSentencedoesnt gobble the array passed to it https://github.com/batmanjs/batman/pull/1055toSentence,ordinalizeandtitleizeadded as view filters https://github.com/batmanjs/batman/pull/1064incrementdecrementandtogglefilters added https://github.com/batmanjs/batman/pull/1081capitalizeupcases the first letter and downcases the rest (a la Rails) https://github.com/batmanjs/batman/pull/1103
increment,decrementandtogglefunctions for operating on properties https://github.com/batmanjs/batman/pull/1080
Set::mappedTopassed toSetProxy, too https://github.com/batmanjs/batman/pull/1052- Set constructor takes a single param -- an array of members https://github.com/batmanjs/batman/pull/1042
Set::addArrayandSet::removeArrayfor adding and removing arrays https://github.com/batmanjs/batman/pull/1042SetSort::atand::toArrayare ordered and observable https://github.com/batmanjs/batman/pull/1109
delegatesToTargetcreates functions that delegate to the target
- Can update params without redirecting: https://github.com/batmanjs/batman/pull/1048
if/unlesshandles multiple keys: https://github.com/batmanjs/batman/pull/1058- primaryKeys that look like integers are coerced by default https://github.com/batmanjs/batman/pull/1071
Model::_loadIdentitycoerces its value to an integer if possible https://github.com/batmanjs/batman/pull/1071- more messages for association-related errors https://github.com/batmanjs/batman/pull/1072
- association sets aren't
transaction'd orapplyChanges'd twice https://github.com/batmanjs/batman/pull/1062 @validate presence: truewill check forproxy.targetif the value is a proxy https://github.com/batmanjs/batman/pull/1063@urlNestsUnderaccepts deeply nested routes https://github.com/batmanjs/batman/pull/1068Model::destroypasses options to storage adapter https://github.com/batmanjs/batman/pull/1075hasManysets serialize to objects with index keys https://github.com/batmanjs/batman/pull/1065@hasMany encodeWithIndexes: trueencodes children as an object instead of an array https://github.com/batmanjs/batman/pull/1065- AssociationProxy delegates
destroy,save,transactionandvalidateto their targets https://github.com/batmanjs/batman/pull/1078 Transaction.saveandTransaction.applyChangesallowonlyandexceptoptions https://github.com/batmanjs/batman/pull/1089- Fix for associations like
@hasOne 'address'which was wrongly singularized https://github.com/batmanjs/batman/pull/1090 Transaction.destroydestroys the base https://github.com/batmanjs/batman/pull/1121- Storage operations return a Promise https://github.com/batmanjs/batman/pull/1099
- HasOne always returns
HasOneProxyhttps://github.com/batmanjs/batman/pull/1120 - HasMany removes items not found in JSON (configurable) https://github.com/batmanjs/batman/pull/1102
- Fix TransactionAssociationSet supports addArray / removeArray https://github.com/batmanjs/batman/pull/1111
- ModelPaginator can get totalCount from the server response https://github.com/batmanjs/batman/pull/1067
- Storage errors respond to
toJSONhttps://github.com/batmanjs/batman/pull/1066 - Storage adapters keep the last storage error at
@lastErrorhttps://github.com/batmanjs/batman/pull/1066
- params that look like integers are coerced to integers https://github.com/batmanjs/batman/pull/1071
- Fix
View.isInDOMthrowsundefined methodfrom the render cache https://github.com/batmanjs/batman/pull/1050 data-showif/data-hideifchecks forproxy.targetif the value is a proxy https://github.com/batmanjs/batman/pull/1063
@encodesNestedAttributesForto help with nested attributes https://github.com/batmanjs/batman/pull/1074
Besides lots of bug fixes, documentation updates, etc, here some major changes:
- batman.js node package was removed
- Travis uploads successful, tagged builds to
http://batman.js.s3.amazonaws.com/batman-#{tag}.tar.gz. Also,masteris available at http://batman.js.s3.amazonaws.com/batman-master.tar.gz. - added
cake buildandcake build:distfor compiling batman.js https://github.com/batmanjs/batman/pull/864
toSentenceadded https://github.com/batmanjs/batman/pull/1035capitalizebecametitlize,capitalizegets a deprecation warning https://github.com/batmanjs/batman/pull/1035
Batman.Object.delegatewas added https://github.com/batmanjs/batman/pull/830@delegatehandlessetandunsettoo https://github.com/batmanjs/batman/pull/982@classDelegateto delegateclassAccessorhttps://github.com/batmanjs/batman/pull/1001
::toJSONiterates over members and callstoJSONon them https://github.com/batmanjs/batman/pull/905::mappedToreturns aBatman.SetMappinghttps://github.com/batmanjs/batman/pull/1018
::toJSONiterates over members and callstoJSONon them https://github.com/batmanjs/batman/pull/905
- Class accessors
pendingRequestCountandrequestIsPendingadded https://github.com/batmanjs/batman/pull/1032
AssociationSet::loadtakes options and passes env https://github.com/batmanjs/batman/pull/825- Added 401 Error to StorageAdapter https://github.com/batmanjs/batman/pull/860
- Added
onlyIntegerto Numeric Validator https://github.com/batmanjs/batman/pull/867 @belongsTokeys always returnBelongsToProxyhttps://github.com/batmanjs/batman/pull/891@encode'sasoption can be a function https://github.com/batmanjs/batman/pull/863::validatefiresvalidatedif validation was successful https://github.com/batmanjs/batman/pull/943@validateallowsifhttps://github.com/batmanjs/batman/pull/883@validateif&unlesstake strings which are looked up on the record https://github.com/batmanjs/batman/pull/1012@validateacceptsemail: truewith EmailValidator https://github.com/batmanjs/batman/pull/940::saveacceptsonlyorexceptwith keys https://github.com/batmanjs/batman/pull/951- Added
@createMultipleFromJSONhttps://github.com/batmanjs/batman/pull/981 @hasManydoesn't coerce primary key integer-like strings to integers https://github.com/batmanjs/batman/pull/866- Added
Model::transactionandBatman.TransactionAssociationSetfor editing records https://github.com/batmanjs/batman/pull/992 - Added
::reflectOnAllAssociationsand::reflectOnAssociationhttps://github.com/batmanjs/batman/pull/992 - Association
saveInlinedefaults to false https://github.com/batmanjs/batman/pull/1028 - Calls to
Model.findfor the same ID are pipelined likeModel.loadhttps://github.com/batmanjs/batman/pull/1026 validate associatedFields: truepushes messages from associated records to this record https://github.com/batmanjs/batman/pull/995@validatesmessage:option may be a string or function https://github.com/batmanjs/batman/pull/1040AssociationSet::buildadds a child record with passed attributes https://github.com/batmanjs/batman/pull/994
- default to current controller when redirecting https://github.com/batmanjs/batman/pull/999
@filterwas added https://github.com/batmanjs/batman/pull/804- Filters are available in subviews https://github.com/batmanjs/batman/pull/870
data-trackbinding was added https://github.com/batmanjs/batman/pull/835- Added
data-route="routes.root"for routing to "/" https://github.com/batmanjs/batman/pull/865 - Views rendered from controllers will use
::sourceunless overridden in@render()https://github.com/batmanjs/batman/pull/909 - InsertionBinding and ShowHideBinding use
fireAndCallfor lifecycle events https://github.com/batmanjs/batman/pull/931 - Added
data-deferifhttps://github.com/batmanjs/batman/pull/925 data-bind-classdoesn't overwrite existing classes https://github.com/batmanjs/batman/pull/958- Added filters
ceil,floor,round,precision,fixedanddelimitNumberhttps://github.com/batmanjs/batman/pull/954 - Added filters
lt,gt,lteq,gteq,eq, andneqhttps://github.com/batmanjs/batman/pull/1009 - added
primaryInteractionEvent&primaryInteractionEventNameto allow use with touch https://github.com/batmanjs/batman/pull/880 withArgumentsfilter works withTerminalAccessiblehttps://github.com/batmanjs/batman/pull/923
- Translation filters fixed,
@useFallbackfor cases of missing translations https://github.com/batmanjs/batman/pull/988
Major changes:
- Support Keypaths with
-or_e7fb66681bc0d685a3a45b6ed74f0455d949fd2d - Added
EventEmitter::off
- Added Inclusion/Exclusion validators 114fb3b6fb8ffaed7389663611334eb073ed2b46
- Added
encoderKeyoption for associations c6f24a9984891dfb2164417812f22cbcaaf3432e
- Remove viewContext a784bd3f6b9776aca99cb32ce01eefb693c1cab9
- Use
Batman.LifecycleEventsfor before/after filters 950607e91d5546078394a1f531e2a4d633108d2a
- Big breaking changes:
data-mixinremoved. - Remove mixins 997c7b9063837e7ba147ddf94a0a0f2d634350b0
- Optimize IteratorBinding 5eecbe7b7aec101d629e9ba77fb2d483936de466
data-stylefor binding to specific CSS properties 0c23ef6ff6de6c259cb7ca6fb51e7502e35be188- disable View cache 0b5c8f9f3e1f3b55d1569b0fccad57ce5a6d3f85
- Support multiple classes with
data-addclassadf963a581e4942a72f7b7b6e3892ab0d5afc845 - Added
lookupKeypath,setKeypathandtargetForKeypathfor context lookups viewPrefixconfig renamed topathToHTML- default path for HTML templates switched from
/viewsto/html ViewStorerenamed toHTMLStore. Renamed its functions "view" -> "HTML" also.
- Removed
App.require-related code bf59e2b180f1a72c7ad73f127d2e81247d519064
- XHR assertions fcd428c8e0b7a50b6892673ed672f5d16bda08ec
- Added
stubAccessorbdf5e03c2b8871db53c1ee0c9f5006d6fda70740
toArrayregisters the base as a source 7c17daf041c569ba8b0609bb06d6e58ddcd2bc90
- Added: CRSF Token support 635463b458d8417d152d4211d0b079d5bb513183
- Added:
encodeTimestamps7056f43d88c7ddb950b94a7401e7d4f242b266ad - Config
pathToHTMLdefaults to/assets/batman/html
- Added
Batman.Enumerable::countf53e99025d2a5e437263510ca1c15fa734e7afe9 - Added
Batman.LifecycleEvents97ad1a98fc1b2c0b288e2e66768b3aaa4b717a46 - Use LitCoffee docs 35287a20f594c8e8bca9f05de1bb8e0d73b21a6f
- Removed Batman cli tools 798884cece6e7000c8ab8dd4d5a33d00c503aeb6
- Config
pathPrefixrenamed topathToApp
Lots of other bug fixes and performance improvements! See all at https://github.com/batmanjs/batman/compare/v0.14.1...v0.15.0
Forgot to bump a version number to fix the version number test.
https://github.com/Shopify/batman/compare/v0.13.0...master
- Added:
App.shouldAllowEvent.[event]. Callbacks in this hash will be called whenever the correspondingdata-eventis fired from anywhere within the app. Return false to prevent app-level propagation. For example:
class MyApp extends Batman.App
@shouldAllowEvent.click = (event) ->
return false- Fix: Prevent additional history items from being created if the users navigates to the page they are already on.
- Fix: Nested resource routing names.
- Deprecated: App loader utilities:
App.controller,App.model,App.view,App.require. Batman does not care how you load your code, as long as it's loaded before callingApp.run.
- Added: Substantially better for support for polymorphic associations.
- Added: Configure custom URL's for associations. Typically used for resources whose backends aren't quite as RESTful as they should be.
- Added: A server response of 422 will result in the response being parsed as an error and the response's data being used injected into
errors. - Added: A server response of 409 will result in a
RecordExistsError. - Added:
NumericValidatorcan now compare for equality. - Added:
Batman.Model._mapIdentitiesto map many items and then add them to the set all at once. - Performance:
Batman.Model.loadWithOptionsusesmapIdentitiesinstead ofmapIdentity. - Change: Model instance methods are no longer bound to themselves. If you're passing model methods as callbacks make sure you bind them manually!
- Fix: Respect sorted order in
SetSort::find. - Fix: Respect sorted order of
SetSort::merge.
- Change: Moved the
Batman.ViewStore'sfetchFromRemoteandprefixproperties toBatman.configand rename them tofetchRemoteViewsandviewPrefix. - Fix:
Batman.DOM.setStylePropertywill respect!importantin all browsers. - Fix: Don't intercept middle-click events.
- Change: Rename
BindingtoValueBinding. - Fix: Biding to the correct option when loading a
<select>element. If the data is null when the binding is created, we bind to an option with an empty string. - Fix: Parsing keypaths that begin with numbers.
- Added: The ability for bindings within subviews to update their values that have been added to the context via
data-bind. - Deprecated:
data-confirmevent attribute.
- Fix: The prepend and append filters don't prepend/append undefined to the string if the value is undefined.
data-bind="undefinedValue | append 'my string'"now returnsmy stringand notundefinedmy string.
- Change: Promise accessors return the result of their promise function, such that promises which return valueA and asynchronously deliver valueB retune the delivered valueB instead of the returned valueA.
- Change: Class promise accessors are now be recalculated after calling clear, e.g.
Product.clear(). - Added:
Batman.Object::_resetPromise.
- Added: A deprecation mechanism. Putting
Batman.developer.deprecatedinside a function will log a warning in the console in development mode. - Fix: Some cases where
clearImmediatewould break IE. - Fix: IE7 inability to access a character from a string using the index
[]notation. - Fix: Support all symbols with unescapeHTML. e100aca
- Fix: Bug in reduce where the reduction function returning undefined caused undesirable return values.
- Fix: Bug when using arrays of models as the keys of a
Batman.Hash. - Fix: Ensure that
addis only called once when multiple items are added to aSetSortat the same time.
- Performance: Fight off hoardes of DOM memory leaks.
- Performance: Speed up
Batman.SimpleSetiteration. - Performance: Speed up
Batman.Propertyiteration when firing some observers. - Performance: Added Two levels of caching for
_batmanansestors. - Performance: Use arrays instead of sets in hot functions.
- Performance: Remove splats in hot functions.
- Performance: Avoid creating
EventEmitterevents when not necessary. - Fix: Watson and Tiller integration.
Patch Release
Bug Fixes
- Make the prepend and append filters use the empty string if passed undefined (#543)
- Fix a bug with InsertionBinding throwing DOM exceptions if the bound keypath changed from a falsy value to another falsy value. (#512)
- Fix a bug with the solo build throwing errors on load due to a missing semicolon with reqwest. (#552)
Major Release
Breaking Changes:
- Removed top level DOM helpers from the
Batmannamespace and moved them to theBatman.DOMnamespace. The moved helpers aresetInnerHTML,propagateBindingEvent,propagateBindingEvents,trackBinding,onParseExit,forgetParseExit,setStyleProperty,destroyNode,removeOrDestroyNode,insertBefore,addEventListener,removeEventListener,hasAddEventListener,preventDefault,stopPropagation, andappendChild. - Moved the DOM helpers which could be expressed using platform specific code into the platform adapters. This means that
Batman.DOM.setInnerHTMLwill usejQuery.fn.htmlwhen using the jQuery platform adapter and the old implemention when usingsolo. Affected helpers arequerySelector,querySelectorAll,appendChild,removeNode,destroyNode, andsetInnerHTML, - Removed support for daemonizing the
batmanserver tool.
Features
- Add
Controller::handleError(),Controller::errorHandler(), andController.catchErrorfor regstering error handlers and wrapping callbacks to automatically handle errors coming back from async operations. - Remove
Model.lifecycle(Model::lifecyclestill exists) and switched toloadingandloadedevents instead so that multiple loads can occur at the same time. - Formalize error objects returned from
RestStorage. eg,UnprocessableEntityErrorcomes back from a422response. These error objects also have reference to theenvfor the operation as well as therequest. - Allow
Model.persistto take more than one object to mixin to the storage adapter. - Add
record.get('isDirty')as a shortcut to check if a model is in the dirty state.
Bug Fixes
- Make
hasManyassociations use the same sets before and after a record has an ID. (#537) - Make
belongsToassociations replace theproxyobject in the parent's property after the association is loaded. - Make
IteratorBindingrecover gracefully when the bound collection returns undefined fortoArray. - Fix a bug in
EventBindingwhere proxied values could cause non existant event handlers to fire causing browser errors. - Fix routing bugs surrounding regexp indexes in IE8.
- Made
EventBindings not interfere with control or command clicks instead of calling the handler regardless of what modifier keys were pressed. - Fix underscoring in route names for nested member and collection routes. (#547)
- Made filters which can't operate on null not operate on null.
Major Release
Breaking Changes:
- Switch the interpretation of
Model.urlandModel::urlto respect absolute and relative routes, and only in the case of relative routes prepend theurlPrefix. - Ensure that lifecycle events happen on models before validation takes place.
Features:
- Add
Model.createFromJSONas a shortcut for booting models from JSON and sticking them in the identity map - Add the
asoption toModel.encodewhich allows serialization into a key other than the key mentioned inencode - Add Rails style optional route segments with
() - Add a
trimfilter - Give most validations the
allowBlankoption to force them to pass if the value is undefined or the empty string - Add an
AssociatedValidatoradded by callingModel.validate 'name', associated: true - Make Controllers stop executing the rest of the action when a redirect occurs in a beforeFilter.
- Add a
Proxyclass for proxying an object - Allow
EventEmitter::onto take more than one key to attach a handler to
Bugfixes:
- Fix a bug where radio buttons didn't quite work properly if their
valueHTML attributes were strings (#500) - Fix a bug where views would render when given a node regardless if their source was present or not. (#501)
- Fix a bug with the pluralize filter not working correctly when passed "0" (#520)
- Switch to not changing the URL in the address bar on 404s. (#524)
- Fix a bug where redirecting during an existing redirect sequence would cause the oldest instead of the newest path to end up in the URL bar. (#536)
- Ensure that lifecycle events happen on models before validation takes place.
Really Minor Release
- Add the association
extendoption to allow mixing in an object to an association Rails style
Minor Release
- Add Batman.DOM.querySelector and Batman.DOM.querySelectorAll helpers to wrap whatever methods are available for doing such things
- Add the
keyan observer is on to the arguments passed to the observe - Switch the
orfilter to be a real boolean || - Make the inferred view class a Controller checks for when rendering play nice with nested routing keys
- Add the
encodeForeignKeyoption to belongs to associations to allow disabling of the foreign key encoding.
Bugfixes:
- Fix a race condition surrounding data-defineview sometimes causing views to be fetched from the server (#476)
- Make autogenerated route names match the rest of the named routes generated (using . instead of CamelCaseing)
- Fix Controller to allow operations to take place after an action without issue
- Make the
defaultfilter check for both blank strings or non existing values - Fix model dirty tracking to really keep track of the clean value (#482)
- Mark
AssociationSets as loaded if their parent is a new record and that parent is saved
Minor Release (but it changes major node versions)
- Improve
$setImmediateperformance on node - Remove the "bind to an object full of keys pointing to keypaths" functionality from
StyleBindingdue to complexity and underuse. - Add
Hash.meta.toArrayaccessors and enumerability - Make
RestStoragerespect URLs passed to it in options, say, fromModel.Request - Add
SetComplementfor getting a set of items in one set but not another. This complements SetIntersect and SetUnion quite nicely if you ask me. - Make
Setuse a user land quality test for membership checks. This means two objects which aren't===can defineisEqualto return true and only one will end up in aSet. - Ensure records can save successfully after failing validation once before.
- Rename
Object._objectIDtoObject._batmanID - Remove
Batman.Request::canceland the extrasetImmediaterequired for its implementation. - Add
data-insertifanddata-removeifbindings which downright remove nodes from the DOM instead of CSS'ing them away. - Make the automatic application of resource URLs on the server to Models no longer automatic and instead an option on the association macro
- Add special behaviour for
params['#']in controller actions to scroll to an element with that ID if it exists - Make Controller after filters run truely after the action's operations have completed. This is to say after render and DOM insertion.
- Make
URImutable and add atoStringto get back the URI string. - Allow view classes to declare they aren't cacheable.
- Add a regexp validator accessible with
@validates 'foo', pattern: /foo/ - Give
ValidationErrors afullMessageaccessor which does the i18n stuff. - Add the
humanizehelper toBatman.helpersand toBatman.Filters
Bugfixes:
- Prevent unloaded but autoloading associations from autoloading during encoding.
- Fix dirtyKey tracking when the value is set to
nullorundefinedafter having an initial value. - Properly propagate changes into JS land when text is pasted into inputs when supported by browsers.
- Make
currentURL,currentRouteandcurrentParamsavailable during beforeFilters. - Fix the generators to a) work and b) generate more modern code.
- Fix a bug in the
HasManyAssociationdecoder which could result in duplicate entries being added to the identity map when nested associations were decoded.
Major Release
- Refactor StateMachine class to be its own class with transitions, callbacks, and predicates
- Reimplement the Model lifecycle as a StateMachine residing at .get('lifecycle')
- Implement load pipelining to multiplex multiple
loadcalls to the same outgoing request if a second call is issued while a first is pending - Add the
@optionclass macro to Views to allow the declaration ofdata-view-myargument="keypath"argument passing to custom views - Make the Model
@encodemacro use the default unit function for the absent options if only anencodeordecodeoption is passed. - Make
@urlNestsUnderallow multiple levels of nesting - Add a
RenderCacheclas which will cache major views rendered byController::render - Make
Controlleruse previously rendered views from theRenderCacheinstead of rendering new ones - Remove the ability for views to be "container nodes". Views now have one root node always.
- Make View insertion and removal indempotent, including with regards to yields. This means that if a view is removed from the DOM, it will retract nodes yielded elsewhere, and when reinserted, it will reinsert those yields into contentfors.
- Add
View::inInDOM()to ask a view if it is currently in the DOM or not, which indicates if it is safe to destroy. - Add behaviour to
SelectBindingto update the JS land value with the first selected option if no JS land value was present. - Add
SetIndex#forEachfor looping over sets corresponding to particular values. - Add
Controller#executeActionfor executing other actions within a parent action - Add
Enumerable#inGroupsOffor getting an enumerable partitioned into groups of a particular length - Make
Batman.helpers.pluralizeact more like the Rails version and not include the count when called in JS land. - Expose
RestStorageAdapter's environment allowing access to the meta information surrounding a request. - Move
Paginatorinto an extra so people not using don't pay the filesize penalty - Remove unimplemented ability to have multiple storage adapters on Models.
- Add
get,put,post, anddeleteactions toRestStoragefor doing "non-standard" requests while still using the nice request adapter pipeline - Add
Model.requestfor sending nonstandard requests instead of having to use rawBatman.Requests - Add ability for
NamedRouteQueryto accept arguments which aren't full objects and are the value of the params. "data-route='routes.customers[1]' instead of "data-route='routes.customers[customer]'" - Add the
$extendhelper, which is a lightweight$mixinwhich doesn't useset. - Add ability to not include the count in the
pluralizehelper - Add minification saftey warnings and the requirement for
resourceNameto be defined on Model subclasses androutingKeyto be defined on Controller subclasses - Add the
isNewaccessor to Models - Add a Batman.URI class
- Add node v0.7 compatibility and remove v0.4 compatibility
- Unified params serialization to use
Batman.URI.paramsFromQuery - Let the implicit
@rendercall in controller actions be configurable viaController::defaultRenderYield - Add
observeOncefor observing a property change and then immediately removing the observer after the first time it fires.
Meta
- Update QUnit to
1.5 - Updated to CoffeeScript
1.3.2 - Updated Alfred example to the TodoMVC version
- Break out classes into seperate files compiled by snockets.
Bugfixes:
- Fix serialization of null to end up as null in JSON or absent in post bodies (#364, #365)
- Fix filter argument parsing to support string literals and object literals in more cases (#373)
- Make select bindings more cautious about updating the JS land property on first bind (#377, #378)
- Fix click event propagation around
RouteBindings - Make
NamedRouteQuerynot loudly error with undefined params. - Fix
Model.get('all')to always load even if otherloads have occurred already (#401) - Stop Model operations from adding erroneous sources to enclosing accessors. (#406)
- Fix Request sending in IE8 when the
Fileobject doesn't exist. - Fix a bug where filter args could be carried over between executions (#438)
- Fix file uploads using jQuery
- Ensure filters receive undefined for absent arguments
Really Major Release
- Add node v0.6.x support
- Add documentation.
- Benchmarking suite added
- Add
Batman.SessionStoragestorage adapter for using thesessionStoragehost object - Make
<select>bindings populate JS land values if an option has the selected attribute. - Add
data-viewbindings for instantiating customBatman.Viewsubclasses - Add support for closure compiler
- Add AMD loader support
- Add JS implementation of ActiveSupport::Inflector for pluralization and ordinalization
- Pass the RenderContext to event handlers called by data-event bindings.
- Add support for string data in batman.solo and batman.node
- Make
view.set('node')work like one might expect (deffering rendering until the node is present) - Add
Model.clearfor busting the identity map. - Add
Batman.Property.withoutTrackinghelper for swallowing dependencies in accessor bodies - Add
SetUnionandSetIntersection - Add
withArgumentsfilter for currying arguments to event handlers - Add decoding of ISO-8601 dates to
RailsStorage, optionally with timezones - Add
FileBindingfor binding - Swtich data-route bindings into real bindings and add a named route query syntax (routes)
- Ensure bindings with filters become simple one way JS -> DOM bindings, since we can't always unfilter
- Add
Enumerable.mapToPropertyfor fetching a single property of a bunch of items in a collection - Formalize data-formfor bindings to have handy functionality like adding error classes to inputs bound to invalid fields and adding a list of errors to the form if an element with a .errors class exists
- Major routing system refactor to support nested resources declarations and the named routes syntax
- Add
replacefilter - Add
Set.find(f)which returns the first item in the set for whichf(item)is truthy - Add binding content escaping, and thus the
escapeandrawfilters - Make
AssociationSetsfire aloadedevent - Refactor the
RenderContextstack into a proper tree with one root node to limit memory usage - Add ability to give false as the value of encode or decode when adding encoders to omit that half of the process
- Add polymorphic belongsTo and hasMany associations
- Add @promiseAccessor for easy wrapping of asynchronous operations into eventually defined accessors
- Add
Batman.View.event('appear'),beforeAppear,disappear, andbeforeDisapperwhich will fire as views enter and exit the dom - Reimplement Hash storage mechanism for greater speed and less memory usage
- Reimplement Set storage mechanism for greater speed and less memory usage. Note: this changes set iteration order.
- Reimplement event storage mechanism for similar speed and less memory usage
- Add wrapAccessor macro for redefinining accessors in terms of their old implementations
- Add
urlNestsUndermacro toModelfor easy definiton of nested backend routes - Add
EventEmitter::oncefor attaching handlers which autoremove themselves - Add
Batman.getPathfor doing recursive gets on properties without encoding the key seperator
Bugfixes:
- Process bindings in a consistent order (#204)
- Ensure attribute bindings bind undefined as the empty string (#245)
- Ensure RestStorage passes the proper Content-type on POST and PUT operations.
- Make
data-targetbind immediately and populate the JS land value at that time - Fix bugs surrounding replacing classes with spaces (#305, #361)
- Ensure encoding and decoding respect custom primary keys
- Fix a slew of bugs surrounding associations to custom primary keys
- Fix textarea bindings to set the value across all browsers
- Add proper bindings for HTML5 inputs like type=search, type=tel, and so on
- Ensure event handlers on yielded content are not destroyed during yielding
- Ensure showif bindings work regardless of the node's initial CSS (#261)
- Support controllers named AppController (#326)
- Ensure model classes don't inherit parent class state (#340)
- Ensure
SetSortproperly propagates length property (#355) - Ensure non-existent models don't get added to the identity map (#366)
- Ensure data-route bindings stop event propagation (#369)
Major Release
- Add
Batman.StateHistoryfor pushState navigation support - View source html can be prefetched via
View.viewSourceCache.prefetch - Major refactoring of view bindings into class based hierarchy
- Add
data-defineviewto allow view sources to be declared inline - Add Association support to Model via
Model.hasOne,Model.hasMany,Model.belongsTo - Add smart AssociationProxy objects which support reloading
- Add support for loading associations with inline JSON
- Add support for
?and!in property names and keypaths - Store the current
paramson theBatman.currentAppfor introspection. - Add
ParamsReplacerandParamsPusheras smart objects which when set, update the global params, pushState or replaceState, and redirect. - Add
Hash::update,Hash::replace, andSet::update - Add
Set::indexedByUnique - Add
Batman.containsfor membership testing and accompanyinghasfilter - Add support for JSONP requests in
batman.solo - Add
finalproperty support to optimize observing properties which will never change - Add
Batman.version - Add support for customizable render targets in
Controller::render
Bugfixes:
Hash::clearnow fires observers for cleared keys- Properties are no longer retained if they aren't being observed to reduce memory usage
IteratorBindingcan have its sibling node changed without erroring- Filter arguments can be keypaths which start on or descend through POJOs
data-contextnow correctly only takes effect for its child nodesdata-event-*has a catchall to attach event listeners for any event- Made
Batman.datawork in IE7 - Made
Batman.Modelproperly inherit storage adapters - Made
data-bind-stylebindings camelize keys - Fixed major memory leaks around Bindings never being garbage collected via Batman.data
- Made
Renderer::stopwork if called before the renderer started - Stop mixing
Observableintowindowto error earlier when accidental sets and gets are done onwindow - Fix memory leaks around View instances never being garbage collected
- Fix memory leaks around IteratorBinding instances growing with time
- Fix memory leaks around SetIndex observing all items forever
- Fix sets on POJOs from keypaths
- Fix
batman.soloto properly encode GET params - Fix
Model::toJSONandModel::fromJSONto)deal with falsey values like any other - Remove ability for
Viewinstances to have eithercontextorcontexts, and unify oncontext. - Fix error thrown if the
mainyield didn't exist - Made the extras files requirable in node
- Fix an invalid data bug when receiving large responses using
batman.node - Fix JSON de-serialization when receiving collection responses using
batman.node - Fix support for non numeric model IDs
- Fix
data-partialanddata-yieldto stop introducing superfluous divs.
Major Maintenance Release
- pagination through
Batman.PaginatorandBatman.ModelPaginator - nested resources routes
- unknown params passed to
urlForwill be appended to the query string App.layoutaccepts a class name which will automatically instantiate that class upon loadController::renderaccepts anintooption, which lets you render into a yield other thanmainyield/contentFor/replaceare now animatable throughshow/hideinterpolatefilter- pleasant reminders if you seem to have forgotten some encoders
- removing nodes will destroy all their bindings
Batman.setImmediatefor fast stack popping
Bugfixes:
App.readyis now a oneShot eventApp.controller/model/vieware now only available in developmentdata-foreach(through Iterator) is now entirely deferred- better support for
input type='file' - sets within gets don't register sources
- fixes several memory leaks
- better view html caching
Major Maintenance Release
- added extras folder
- start of i18n features
- overhauled event system, which properties are now clients of (requires code changes)
Property::isolateandProperty::exposewill prevent a property from firing dependent observersdata-contentForwill now append its content to itsdata-yielddata-replacewill replace the content of itsdata-yield- descending SetSorts
Batman.Appfires aloadedevent when all dependencies are loadedBatman.App.currentRouteproperty for observing- allow
controller#actionsyntax indata-route
Bugfixes:
- use persistent tree structure for RenderContext
- keep track of bindings and listeners with Batman.data
- correctly free bindings and listeners
- coerce string IDs into integers when possible in models
- accessors are memoized
- suppress developer warnings in tests
- don't match non
data-*attributes - fix
data-bind-style
Maintenance Release
- added
Batman.Enumerable - added support for multi-select boxes
- added batman.rails.coffee, a new adapter for use within Rails
- added developer namespace for easy debugging (it gets stripped out in building)
- one way bindings have been changed to
data-sourceanddata-targetto avoid ambiguity - added
data-bindsupport forinput type='file' - added
data-event-doubleclick - added
lengthfilter - added
trimhelper Controller.resourcescreates anewroute instead ofdestroyModel.findwill always return the shared record instance. you can then bind to this and when the data comes in from the storage adapter, your instance will be updated- added
Model::findOrCreate - added
Model::updateAttributes - allow storage adapters to specific their namespace with
storageKey - storage adapter filter callbacks take errors
- added
App.readyevent that fires once the layout is ready in the DOM - normalize
status/statusCodeinBatman.Request - hashes now have meta objects to non-obtrusively bind metadata like
length - the
propertykeyword is no longer reserved
Bugfixes:
Controller.afterFilterwas missing- hash history uses
Batman.DOM.addEventListener - routes such as
data-route="Model/new"will route correctly - fix
Batman.DOM.removeEventListenerso it doesn't depend on document - fire
renderedevent after all children have been rendered - model methods can be used as event handlers
- animation methods called with node as context
data-eventworks within the binding system- simpler model identity mapper
SortableSet::clearinvalidates sort indices- IE: doesn't have Function.prototype.name (move things into $functionName)
- IE: doesn't support
isSameNode - IE: doesn't support
removeEventListener(usedetachEventinstead) - IE: fix $typeOf for undefined objects
- IE: event dispatching fixes
- IE: include json2.js in the tests
Major Maintenance Release
- added
Batman.Accessible, a simple object wrapper around an accessor - added
Batman.SetSortfor getting a sorted version of a set which automatically watches the source set and propagates changes - added
Batman.SetIndexfor getting a filtered version of a set which automatically watches the source set and propagates changes - added after filters to
Batman.Controller - moved
Batman.Modelattributes into an attributes hash to avoid namespace collisions with model state. - added
Batman.datafor safely attaching JS objects to DOM nodes - added support for many
[]style gets in filters - added asymmetric bindings (
data-readanddata-write) - ensured Batman objects are instantiated using
new(#65) - added support for radio button
valuebindings (#81) - added
Batman.Encodersto store built in encoders, and addedBatman.Encoders.RailsDate - added
statustoBatman.Request, normalizing XHR object'sstatus/statusCode - added proper parameter serialization to the
batman.soloplatform adapter
Bugfixes:
-
fixed
batman serveroptions (batman -b serverworks as expected) -
fixed binding to
submitevents on forms (#6) -
fixed Renderer's ready events to fire when all child renderers have returned (#13)
-
fixed textarea value bindings to work as expected (#20)
-
made bindings to undefined populate their nodes with an empty string instead of "undefined" (#21)
-
made
data-foreach,data-formfor,data-context, anddata-mixinall work as expected when the collection/object being bound changes (#22) -
fixed
LocalStorage's primaryKey generation (#27) -
made
Requestsend the proper content type (#35) -
made the current application always appear on the context stack (#46, #48)
-
made
@render falseprevent render on a controller action (#50) -
made
data-foreachwork with cleared sets and many additions/removals (#52, #56, #67) -
made empty bindings work (#54)
-
made
Sets not leak attributes when given items to add in the constructor (#66) -
prevented
@redirectfrom entering a redirect loop when usinghashchangeevents (#70) -
made
showifandhideifbindings play nice with inline elements (#71) -
made jQuery record serialization work with
RestStorage(#80) -
made
Model.get('all')implicitly load (#85) -
fixed binding to
stateon models (#95) -
made
Hashaccept keys containing "." (#98)
Maintenance Release
batman serveris nowbatman serve(or stillbatman s)- Configure the hostname for the server with -h
- CI support with Travis
Bugfixes:
- RestStorage uses correct HTTP methods and contentType
- Some improvements for
batman new, more coming in 0.5.2 - DOM manipulation performance improvement
Known issues:
- Apps generated with
batman neware somewhat broken - Generators allow too many non-alphanumeric characters
Initial Release
Known issues:
- Inflector support is naive
- Code is too big
- Performance hasn't been investigated
- Filters don't support async results
- Model error handling is callback based
Missing features:
- Model assosciations
- Model scopes
- Model pagination
- Push server
- Documentation