-
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 2 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,124 @@ | ||
# 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 for injecting all possible dependencies. This is just a small step towards improving the type safety of our source code and aligning our Angular implementations with recent standards. | ||
|
||
## Keeping Current | ||
|
||
We believe it's important to stay up-to-date. With that in mind, we've updated to Angular version 15, Nx version 16.1, and Node 18. Please note, this will introduce some breaking changes, but we trust you'll navigate them like the pros you are! | ||
LayZeeDK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Supporting Standalone Angular Applications | ||
|
||
A significant change in this version is the added support for standalone Angular applications. Now, you can include Lumberjack directly in the `bootstrapApplication` function. Here's a simple example: | ||
|
||
```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 be a familiar compared to how we configure the modules. | ||
|
||
It is as simple as passing the 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 `withHttpOptions` | ||
|
||
```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. | ||
|
||
## 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.