Originally published on strongloop.com
In October, we were excited to see an increasing number of community contributions as people joined the Hacktoberfest event. This month we had pretty balanced improvements in each area of the framework, including context, health check, OpenAPI specification and documentations. Keep reading to learn about the recently added features!
We welcomed @mrmodise as the maintainer of loopback4-shopping-example
. And we'd like to thank everyone @nflaig, @MattiaPrimavera, @mdbetancourt, @mrmodise, @frbuceta, @HrithikMittal, @simlt, @hectorleiva, @pktippa, @VergilSkye, @kerolloz, @arondn2, @mayank-SFIN571 for your contributions in October!
Here are the highlighted improvements:
Context
- A set of fine-grained scopes
APPLICATION
,SERVER
andREQUEST
has been introduced to allow better scoping of binding resolutions. The limitation of the previous scopes is explained in section choose the right scope, and section resolve a binding value by key and scope within a context hierarchy explains how different scopes determine the binding resolutions.
REST
Allowed array query parameter for a single value, like
{tags: 'hello'}
where parametertags
is a string array. See PR #6542.Supported property level configuration for hidden fields, like
@property({type: 'string', hidden: true}) password: string
. This is the shortcut for specifying the hidden properties in model settings. See PR #6484.save()
method throwing error due to missingidName
is fixed in PR #6640.modifySpec()
turns to an async function to allow async spec updates. See PR #6655.
Build
A force clean rebuild was added to the pre-start script for the LoopBack 4 examples. You can run
npm start
after removing artifacts without manually cleaning the/dist
files. See PR #6588.Turned on
exit
for mocha tests for the created LoopBack applications. See PR #6475.
Extensions
Module @loopback/socketio was added to use socket.io to expose controllers as WebSocket friendly endpoints.
Enable/disable the metrics endpoints in explorer when mounting the metric and health extensions. See PR #6646 and PR #6645.
Only add
MetricsObserver
,MetricsPushObserver
and expose/metrics
endpoints when they are enabled. See PR #6644.The health check for applications running in container now returns a more accurate HTTP status code based on the state. For example, checking
/health
for application in states 'STARTING', 'STOPPING' or 'STOPPED' returns 503. You can find more details in PR #6648.
Documentation Restructure
LoopBack 4 targets both API developers and extension developers, while the current website doesn't distinguish them clearly. This month we restructured the sidebar to classify the documentation into two parts: "Building LoopBack Applications" and "Extending LoopBack Framework". You can check https://loopback.io/doc/en/lb4/Customizing-server-configuration.html to view the new layout.
The instructions for implementing HTTP redirects and mounting an Express router are extracted into a standalone page under "How-to guides". You can check https://loopback.io/doc/en/lb4/Customizing-routes.html to view the content.
Moved server recipes to how-to guides Customizing-server-configuration. See PR #6663.
Examples
Two examples were added last month:
Example webpack was added to demo LoopBack running inside the browser as client-side JavaScript application.
Example socketio gives a basic implementation of socketio with LoopBack 4.
You can also download the examples by using the lb4 example
command.
Enriching LoopBack and its Community - You are Invited!
As mentioned in our recent blog post, your contribution is important to make LoopBack a sustainable open source project.
Here is what you can do:
- Join LoopBack Slack community
- Look for first-contribution-friendly issues
- Give us feedback and join our discussion in our GitHub repo
Let's make LoopBack a better framework together!