-
Notifications
You must be signed in to change notification settings - Fork 0
docs: release lumberjack 15 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
NachoVazquez
wants to merge
4
commits into
main
Choose a base branch
from
docs/release-lumberjack-15
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
801f95d
docs: write first draft for launch blog post
NachoVazquez 1325a21
docs: rewrite blog
NachoVazquez 946b953
docs: rewrite sentences for clarity and adjust structure
NachoVazquez 7b96835
docs: remove warning about node 18 being a breaking change
NachoVazquez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# blog | ||
All ngworker related blog posts. This allows ngworker members to review blog posts before publishing. | ||
# NgWorker Blog Posts | ||
|
||
## Lumberjack | ||
|
||
- [Introducing @ngwoker/lumberjack@v15](./lumberjack/introducing-lumberjack-15.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# Announcing @ngworker/lumberjack version 15: A Step Forward | ||
|
||
We are pleased to share that we've just released @ngworker/lumberjack version 15. The team have been quietly working on a few updates that we hope you will find useful. Enough small talk, let's dive into what's new! | ||
|
||
**TL;DR** - Lumberjack version 15 introduces a few updates worth noting: internal upgrades like the use of the latest type-safe `inject` function for all possible dependencies, updates to Angular version 15, Nx version 16.1, and Node 18. The big announcement is that we've added support for standalone Angular applications. Now, you can conveniently include Lumberjack in the `bootstrapApplication` function and configure Lumberjack drivers as needed. | ||
|
||
## Better Type Safety | ||
|
||
First on our list, we've introduced the use of the newest type-safe `inject` function moving away from constructor paramter decorators. This is just a small step towards improving the type safety (it is quite good) of our source code and aligning our Angular implementations with recent standards. | ||
|
||
## Keeping Current | ||
|
||
We are all excited about everything that's happening on the JavaScript world. That's why we will continue putting efforts on keeping Lumberjack up to date with the latest version of Angular and any other tool that's part of the Lumberjack suite. This time, we have updated to Angular version 15, Nx version 16.1, and Node 18. Please note, this will introduce breaking changes; make sure to update to Angular 15 before upgrading Lumberjack and verify that your other dependecies are compatible with Node 18. | ||
|
||
## Supporting Standalone Angular Applications | ||
|
||
And the cherry of the cake is... | ||
|
||
Our most exciting announcement is that we've added support standalone Angular applications. Now, you can include Lumberjack directly in the `bootstrapApplication` function. Here's a simple example of how to use the new APIs: | ||
|
||
```ts | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
// (...) | ||
provideLumberjack(), | ||
// (...) | ||
], | ||
}); | ||
``` | ||
|
||
### Enhanced Driver Configuration | ||
|
||
We've also made it possible for you to enable the standalone providers for the out-of-the-box Lumberjack drivers. Here's how you can do it: | ||
|
||
```ts | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
// (...) | ||
provideLumberjack(), | ||
provideLumberjackConsoleDriver(), | ||
provideLumberjackHttpDriver(withHttpConfig({...})), | ||
// (...) | ||
], | ||
}); | ||
``` | ||
|
||
### Advanced Configuration for Those Who Want More | ||
|
||
Configuring `Lumberjack` and the `ConsoleDriver` with the new API should represent a similar experience that what we have been able to do before with Modules. | ||
|
||
Both `Lumberjack` and the `ConsoleDriver` can be configure without any extra arguments or by passing a configuration object as the single parameter of the provide functions. | ||
|
||
```ts | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
provideLumberjack({ levels: [LumberjackLevel.Error] }), | ||
provideLumberjackConsoleDriver({ | ||
levels: [LumberjackLevel.Info, LumberjackLevel.Error], | ||
}), | ||
], | ||
}); | ||
``` | ||
|
||
The `HttpDriver` is slightly more advanced since now we need to use the `with*` config functions for the diffent configurations types. | ||
|
||
We can use the `withHttpOptions` | ||
|
||
```ts | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
provideLumberjack(), | ||
provideLumberjackHttpDriver( | ||
withHttpOptions({ | ||
origin: 'ForestApp', | ||
retryOptions: { maxRetries: 1, delayMs: 250 }, | ||
storeUrl: '/api/logs', | ||
}), | ||
), | ||
``` | ||
|
||
Or the `withHttpConfig` | ||
|
||
```ts | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
provideLumberjack(), | ||
provideLumberjackHttpDriver( | ||
withHttpConfig({ | ||
levels: [LumberjackLevel.Error], | ||
origin: 'ForestApp', | ||
retryOptions: { maxRetries: 1, delayMs: 250 }, | ||
storeUrl: '/api/logs', | ||
}), | ||
), | ||
``` | ||
|
||
The big novelty is that now, we can also configure the underlying `HttpClient` using the second argument of the `provideLumberjackHttpDriver` function | ||
|
||
```ts | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
provideLumberjack(), | ||
provideLumberjackHttpDriver( | ||
withHttpConfig({ | ||
levels: [LumberjackLevel.Error], | ||
origin: 'ForestApp', | ||
retryOptions: { maxRetries: 1, delayMs: 250 }, | ||
storeUrl: '/api/logs', | ||
}), | ||
withInterceptors([ | ||
(req, next) => { | ||
const easy = inject(easyToken); | ||
console.log('are interceptors working?', easy); | ||
return next(req); | ||
}, | ||
]) | ||
), | ||
``` | ||
|
||
## Continuous Module Support | ||
|
||
We want to assure you that we continue to support modules. The new standalone APIs are a complement, not a replacement. Choose your poison. | ||
|
||
## Wrapping Up | ||
|
||
We hope these changes will be of help in your Angular application development journey. We're grateful for your support, and as always, happy coding! |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.