Curious what new developments are happening with the LoopBack project? Here’s a curated selection of the most important changes that have been made to LoopBack in the past four weeks or so.
What’s LoopBack? It’s an open source Node.js framework for creating REST APIs that connect to datasources like Oracle, SQL Server and MongoDB. Learn more…
deleteAllreport the number of affected model instances now. Note that this feature requires additional implementation in connectors, not all connectors were updated yet. List of supported connectors:
- Memory DB via loopback-datasource-juggler#502 loopback-datasource-juggler#511
- MongoDB via loopback-connector-mongodb#114 and loopback-connector-mongodb#118
- MySQL via loopback-connector-mysql#90
- PostgreSQL via loopback-connector-postgresql#67
- Oracle via loopback-connector-oracle#35
- Microsoft SQL via loopback-connector-mssql#37
- The memory connector was fixed to reject
CREATEcalls violating uniqueness of the primary key (the
idproperty), see loopback-datasource-juggler#510.
- loopback-datasource-juggler#509 implemented
betweenfilter in the memory db connector
- Another batch of improvements to the no-longer-new Operation hooks was landed:
- The hooks
ctx.instancepointing to the affected model instance. The
before savehook triggered by the method
prototype.updateAttributesprovides the affected model instance in
optionsargument of DAO methods like
createis passed to operation hooks in
- loopback-datasource-juggler#500 added methods for removing operation hooks observers
before saveand “after save” hooks received a new context property
ctx.isNewInstancethat can be used to distinguish between
SAVEchanges (loopback-datasource-juggler#515). Note that this feature requires additional implementation in connectors, not all connectors were updated yet.
- The hooks
persistUndefinedAsNullthat enforces the same treatment of undefined properties regardless of the connector used (memory, NoSQL, SQL).
destroyAll method (loopback-datasource-juggler#534)
- loopback#1233 added an easy-to-use conflict resolution API (resolve using mine, resolve using theirs, etc.)
- loopback#1251 improved error handling in replication
- loopback#1214 added detection of 3rd-party changes made during replication and implemented a mechanism preventing the replication algorithm to override these changes.
methat is replaced with the current user id, for example in the URL
server/component-config.jsoncan be disabled on per-environment basis (loopback-boot#103).
- loopback-connector-rest#28 fixed handling of template variables allowing usage of variables in object keys too.
- loopback-connector-mysql#78 added support for models backed by MySQL to reference mongodb
- The remote connector was enhanced to generate proxy methods for all method aliases too (loopback-connector-remote#18)
- loopback-component-oauth2#20 adds support for Message Authentication Code (MAC) Tokens (specification draft)
- loopback-component-oauth2#18 enhanced client credentials (including JWT) with pre-authorization, allowed permissions to be granted to client apps by users and enabled subject (user) for client credentials.
- loopback-sdk-ios#35 fixed
generator-loopback (a.k.a. slc loopback)
- generator-loopback#93 Added a boot script generator:
slc loopback:boot scriptName
- We have refactored the code using deprecated hooks and events to use the new operation hooks in loopback-workspace#193, this has removed deprecation warnings.
- New projects are configured with a single top-level CORS middleware, the REST adapter is configured to use this global middleware instead of adding its own (loopback-workspace#192, strong-remoting#165)
- The legacy routes
/api/routesthat were leaking server metadata are disabled by default in new projects (loopback-workspace#191).
A new example application was created to show how to use embedded relations: loopback-example-embedded-relations
Implementation of Promise-based APIs is still under way, we are close to land the change for APIs provided by model relations in oopback-datasource-juggler#452. The list of outstanding tasks is maintained in loopback#418, we are looking for volunteers willing to help us making Promises a first-class citizen of the LoopBack world.
We’ve had real time capabilities via websockets on the roadmap since the inception of LoopBack, but just been pulled in other directions thanks to our customer’s use cases. We’re finally getting there with generalized publish subscribe capabilities that Ritchie is working on including the real time use cases often fulfilled by websockets.
The full changelog
As always, you can find the full list of changes at http://strongloop.github.io/changelog/
You can help too!
LoopBack is an open source project welcoming contributions from its users. If you would like to help but don’t have any own itch to scratch, then please pick one of the issues labelled as “Beginner Friendly”, see this github view for a full list.