diff --git a/docs/site/Understanding-the-differences.md b/docs/site/Understanding-the-differences.md index c38b36f63ade..4e2409a721ec 100644 --- a/docs/site/Understanding-the-differences.md +++ b/docs/site/Understanding-the-differences.md @@ -61,28 +61,231 @@ it is independent of the three services. We can define the APIs in facade the way we want. Thus, code responsible for data access and manipulation is separated from the code responsible for implementing client side APIs. -| Concept/Feature | LoopBack 3.x | LoopBack 4 | -| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Programming Language | Built with JavaScript ES5
Node.js callback | TypeScript 2.6.x & JavaScript ES2016/2017
Promise & Async/Await | -| Core foundation | Express with LoopBack extensions | Home-grown IoC container | -| Model Definition | Models can be defined with JavaScript or JSON | Models can be defined with TypeScript/JavaScript/JSON(TBA) | -| Model Persistence | A model can be attached to a datasource backed by a connector that implements CRUD operations | [Repositories](https://github.com/strongloop/loopback-next/tree/master/packages/repository) are introduced to represent persistence related operations; a repository binds a model metadata to a datasource | -| Model Relation | Relations can be defined between models | (TBA) Relations can be defined between models but they will be realized between repositories | -| Model Remoting | JavaScript/JSON remoting metadata is used to describe method signatures and their mapping to REST/HTTP
Swagger specs are generated after the fact | Remoting metadata can be supplied by OpenAPI JSON/YAML documents or generated automatically through TypeScript decorators | -| API Spec | Swagger 2.0 | OpenAPI Spec 3.0 and potentially other API specs such as GraphQL, gRPC, etc. | -| API Explorer | Built-in UI based on swagger-ui (/explorer) | (Beta) Expose OpenAPI specs and a browser redirect to Swagger UI hosted by loopback.io | -| DataSource | JSON and JS | JSON/JS/TypeScript | -| Connector | Plain JS | JS and TypeScript (TBA) | -| Mixin | Use a utility to add methods from the mixin to the target model class | Use ES2015 mixin classes pattern supported by [TypeScript 2.2 and above](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html) | -| Middleware | Express middleware with phase-based registration and ordering | Sequence consisting of actions | -| Boot script | Scripts to be invoked during bootstrapping | (TBD) | -| Remote hooks | Before/After hooks for remote methods | Sequence/actions | -| CRUD operation hooks | Hooks for CRUD operations | Sequence/actions | -| Built-in models | Built-in User/AccessToken/Application/ACL/Role/RoleMapping for AAA | (TBD) | -| Authentication | User model as the login provider
loopback-component-passport | (TBA) Authentication component ([@loopback/authentication](https://github.com/strongloop/loopback-next/tree/master/packages/authentication)) with extensibility to strategy providers | -| Authorization | Use built-in User/Application/AccessToken model for identity and ACL/Role/RoleMapping for authorization | (TBD) Authorization component | -| Component | A very simple implementation to configure and invoke other modules | A fully-fledged packaging model that allows contribution of extensions from other modules | -| Tooling | loopback-cli and API Connect UI | [@loopback/cli](https://github.com/strongloop/loopback-next/tree/master/packages/cli) | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Concept/FeatureLoopBack 3.xLoopBack 4
Programming LanguageBuilt with JavaScript ES5
Node.js callbacks
Modern TypeScript with latest JavaScript features +
Promises & async/await, ES2016/2017 and beyond +
Core foundationExpress with LoopBack extensionsHome-grown IoC container
Toolingloopback-cli and API Connect UI@loopback/cli
Model DefinitionModels can be defined with JavaScript or JSONModels can be defined with TypeScript; +
TBD: JavaScript - see + loopback-next#560 +
Model PersistenceA model can be attached to a datasource backed by a connector that + implements CRUD operations + Repositories are introduced to represent + persistence related operations; a repository binds a model metadata + to a datasource +
Model RelationRelations can be defined between modelsRelations can be defined between models; queries and persistence are + implemented at repository level +
Model RemotingJavaScript/JSON remoting metadata is used to describe method signatures + and their mapping to REST/HTTP +
Swagger specs are generated after the fact +
Remoting metadata can be supplied by OpenAPI JSON/YAML documents or + generated automatically through TypeScript decorators +
API SpecSwagger 2.0OpenAPI Spec v3 and potentially other API specs such as GraphQL, gRPC, etc.
API ExplorerBuilt-in UI based on swagger-ui v2 (/explorer)Built-in UI based on swagger-ui v3 (/explorer)
DataSourceJSONTypeScript and JSON; +
TBD: JavaScript - see + loopback-next#560 +
ConnectorsPlain JavaScript, ES5 with callbacksPlain JavaScript, ES5 with callbacks; +
TBD: TypeScript with async/await - see + loopback-next#889 +
MixinsUse a utility to add methods from the mixin to the target model classUse ES2015 mixin classes pattern supported by + TypeScript 2.2 and above +
MiddlewareExpress middleware with phase-based registration and orderingSequence consisting of actions; +
TBD: support for Express middleware, see + loopback-next#1293 + and + loopback-next#2035. +
Boot scriptScripts to be invoked during bootstrappingLife cycle events and observers
Remote hooksBefore/After hooks for remote methodsInterceptors
CRUD operation hooksHooks for CRUD operations(TBD)
Built-in modelsBuilt-in User/AccessToken/Application/ACL/Role/RoleMapping for AAA(TBD)
AuthenticationUser model as the login provider
loopback-component-passport
Authentication component + with extensibility to strategy providers +
AuthorizationUse built-in User/Application/AccessToken model for identity and + ACL/Role/RoleMapping for authorization + Authorization component + (work in progress). +
ComponentA very simple implementation to configure and invoke other modulesA fully-fledged packaging model that allows contribution of extensions + from other modules +
Storage componentloopback-compontent-storage + not available
Push notificationsloopback-component-push + not available
OAuth 2.0 providerloopback-component-oauth2 + (TBD)
3rd-party logins via Passportloopback-component-passport + @loopback/authentication-passport +
(EXPERIMENTAL) +
Offline synchronizationSynchronization component + (EXPERIMENTAL) + not available
Client SDKs + AngularJS (1.x), + Android, + iOS, + Xamarin, + Isomorphic JavaScript + + OpenAPI code generators, e.g. + swagger-codegen, + openapi-generator or + ng-openapi-gen +
## What's new and exciting in LoopBack 4 @@ -102,7 +305,7 @@ Some of the highlights of LoopBack 4 include: - Models: define schemas for business objects - Services: interact with existing REST APIs, SOAP Web Services, and other forms of services/microservices -- Refactor the ORM into separate modules for different concerns +- Refactor the ORM into separate modules for different concerns (TBD) As LoopBack 4 continues to grow, more features are continuously added. You can check out our [blog](https://strongloop.com/strongblog/tag_LoopBack.html) to