From 801f95db8de7f1eb5e33dba8baba438e03609fa0 Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Tue, 23 May 2023 05:09:30 -0300 Subject: [PATCH 1/4] docs: write first draft for launch blog post --- README.md | 7 +- lumberjack/introducing-lumberjack-15.md | 107 ++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 lumberjack/introducing-lumberjack-15.md diff --git a/README.md b/README.md index 5323908..1c657e0 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/lumberjack/introducing-lumberjack-15.md b/lumberjack/introducing-lumberjack-15.md new file mode 100644 index 0000000..e72a8dd --- /dev/null +++ b/lumberjack/introducing-lumberjack-15.md @@ -0,0 +1,107 @@ +# Introducing @ngworker/lumberjack version 15: Improved, Modernized, and More Powerful Than Ever + +Hello, Angular enthusiasts! + +Today, we're thrilled to announce the release of @ngworker/lumberjack version 15. Our team has been working tirelessly to introduce some exciting changes to this OSS Angular library that you've grown to love. And trust us, this new version is _lumberjack_ in every sense: strong, agile, and efficient! + +**TL;DR** - Lumberjack version 15 introduces significant updates, including all possible dependencies now being injected with the latest type-safe `inject` function. We've updated to Angular version 15, Nx version 16.1, and Node 18, and we're proud to present our standout feature: support for standalone Angular applications. Now, you can easily include Lumberjack in the `bootstrapApplication` function and configure Lumberjack drivers to suit your needs. + +## Powerfully Type-Safe Dependency Injection + +Firstly, we've ensured that all possible dependencies are now injected using the most recent type-safe `inject` function. This internal change not only improves the type safety of our source code but also modernizes our Angular implementations. Yes, that's right, no compromises on modernity! + +## Keeping Up With The Latest + +In line with our commitment to staying updated, we've made the significant leap to Angular version 15, Nx version 16.1, and Node 18. This does introduce some breaking changes, but fear not, we believe in the power of evolution! + +## Standalone Angular Applications + +Our most substantial addition is the support for standalone Angular applications. Now, you can simply include Lumberjack in the `bootstrapApplication` function. Here's a simple example: + +```ts +bootstrapApplication(AppComponent, { + providers: [ + // (...) + provideLumberjack(), + // (...) + ], +}); +``` + +## Configurable Drivers + +We've also extended the capability to provide the Lumberjack drivers. This offers you a greater degree of control and customization. Check out the example below: + +```ts +bootstrapApplication(AppComponent, { + providers: [ + // (...) + provideLumberjack(), + provideLumberjackConsoleDriver(), + provideLumberjackHttpDriver(withHttpConfig({...})), + // (...) + ], +}); +``` + +## More Advanced Configuration + +For those of you craving advanced configuration, we're introducing a way to configure the httpDriver, offering you even more flexibility: + +```ts +import { bootstrapApplication } from "@angular/platform-browser"; +import { LumberjackLevel, provideLumberjack } from "@ngworker/lumberjack"; +import { provideLumberjackConsoleDriver } from "@ngworker/lumberjack/console-driver"; +import { + provideLumberjackHttpDriver, + withHttpConfig, +} from "@ngworker/lumberjack/http-driver"; +import { AppComponent } from "./app/app.component"; +bootstrapApplication(AppComponent, { + providers: [ + provideLumberjack(), + provideLumberjackConsoleDriver(), + provideLumberjackHttpDriver( + withHttpConfig({ + levels: [LumberjackLevel.Critical, LumberjackLevel.Error], + origin: "ForestApp", + storeUrl: "/api/logs", + retryOptions: { maxRetries: 5, delayMs: 250 }, + }) + ), + ], +}); +``` + +You can even configure the internal httpClient configuration: + +```ts +bootstrapApplication(AppComponent, { + providers: [ + provideLumberjack(), + provideLumberjackConsoleDriver(), + provideLumberjackHttpDriver( + withHttpOptions({ + 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); + }, + ]) + ), +``` + +## Module Support Continues + +And don't worry, we still fully support modules. This new addition complements the existing features rather than replacing them. + +## In Closing + +We're excited about these changes and believe they will take your Angular application development to new heights. Thank you for your continued support, and as always, happy coding! From 1325a21944e041aee14227ef4068c72e272b3c85 Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Tue, 23 May 2023 09:34:58 -0300 Subject: [PATCH 2/4] docs: rewrite blog --- lumberjack/introducing-lumberjack-15.md | 97 +++++++++++++++---------- 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/lumberjack/introducing-lumberjack-15.md b/lumberjack/introducing-lumberjack-15.md index e72a8dd..0166bd3 100644 --- a/lumberjack/introducing-lumberjack-15.md +++ b/lumberjack/introducing-lumberjack-15.md @@ -1,22 +1,20 @@ -# Introducing @ngworker/lumberjack version 15: Improved, Modernized, and More Powerful Than Ever +# Announcing @ngworker/lumberjack version 15: A Step Forward -Hello, Angular enthusiasts! +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! -Today, we're thrilled to announce the release of @ngworker/lumberjack version 15. Our team has been working tirelessly to introduce some exciting changes to this OSS Angular library that you've grown to love. And trust us, this new version is _lumberjack_ in every sense: strong, agile, and efficient! +**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. -**TL;DR** - Lumberjack version 15 introduces significant updates, including all possible dependencies now being injected with the latest type-safe `inject` function. We've updated to Angular version 15, Nx version 16.1, and Node 18, and we're proud to present our standout feature: support for standalone Angular applications. Now, you can easily include Lumberjack in the `bootstrapApplication` function and configure Lumberjack drivers to suit your needs. +## Better Type Safety -## Powerfully Type-Safe Dependency Injection +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. -Firstly, we've ensured that all possible dependencies are now injected using the most recent type-safe `inject` function. This internal change not only improves the type safety of our source code but also modernizes our Angular implementations. Yes, that's right, no compromises on modernity! +## Keeping Current -## Keeping Up With The Latest +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! -In line with our commitment to staying updated, we've made the significant leap to Angular version 15, Nx version 16.1, and Node 18. This does introduce some breaking changes, but fear not, we believe in the power of evolution! +## Supporting Standalone Angular Applications -## Standalone Angular Applications - -Our most substantial addition is the support for standalone Angular applications. Now, you can simply include Lumberjack in the `bootstrapApplication` function. Here's a simple example: +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, { @@ -28,9 +26,9 @@ bootstrapApplication(AppComponent, { }); ``` -## Configurable Drivers +## Enhanced Driver Configuration -We've also extended the capability to provide the Lumberjack drivers. This offers you a greater degree of control and customization. Check out the example below: +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, { @@ -44,49 +42,68 @@ bootstrapApplication(AppComponent, { }); ``` -## More Advanced Configuration +## 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. -For those of you craving advanced configuration, we're introducing a way to configure the httpDriver, offering you even more flexibility: +It is as simple as passing the configuration object as the single parameter of the provide functions. ```ts -import { bootstrapApplication } from "@angular/platform-browser"; -import { LumberjackLevel, provideLumberjack } from "@ngworker/lumberjack"; -import { provideLumberjackConsoleDriver } from "@ngworker/lumberjack/console-driver"; -import { - provideLumberjackHttpDriver, - withHttpConfig, -} from "@ngworker/lumberjack/http-driver"; -import { AppComponent } from "./app/app.component"; bootstrapApplication(AppComponent, { providers: [ - provideLumberjack(), - provideLumberjackConsoleDriver(), - provideLumberjackHttpDriver( - withHttpConfig({ - levels: [LumberjackLevel.Critical, LumberjackLevel.Error], - origin: "ForestApp", - storeUrl: "/api/logs", - retryOptions: { maxRetries: 5, delayMs: 250 }, - }) - ), + provideLumberjack({ levels: [LumberjackLevel.Error] }), + provideLumberjackConsoleDriver({ + levels: [LumberjackLevel.Info, LumberjackLevel.Error], + }), ], }); ``` -You can even configure the internal httpClient configuration: +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(), - provideLumberjackConsoleDriver(), provideLumberjackHttpDriver( withHttpOptions({ origin: 'ForestApp', retryOptions: { maxRetries: 1, delayMs: 250 }, + storeUrl: '/api/logs', + }), + ), +``` +Or the `withHttpOptions` - storeUrl: '/api/logs', +```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) => { @@ -98,10 +115,10 @@ bootstrapApplication(AppComponent, { ), ``` -## Module Support Continues +## Continuous Module Support -And don't worry, we still fully support modules. This new addition complements the existing features rather than replacing them. +We want to assure you that we continue to support modules. The new standalone APIs are a complement, not a replacement. -## In Closing +## Wrapping Up -We're excited about these changes and believe they will take your Angular application development to new heights. Thank you for your continued support, and as always, happy coding! +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! From 946b95360abd045ef2a7244a891b589d895f94fb Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Wed, 24 May 2023 22:39:36 -0300 Subject: [PATCH 3/4] docs: rewrite sentences for clarity and adjust structure --- lumberjack/introducing-lumberjack-15.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lumberjack/introducing-lumberjack-15.md b/lumberjack/introducing-lumberjack-15.md index 0166bd3..8851477 100644 --- a/lumberjack/introducing-lumberjack-15.md +++ b/lumberjack/introducing-lumberjack-15.md @@ -6,15 +6,17 @@ We are pleased to share that we've just released @ngworker/lumberjack version 15 ## 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. +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 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! +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 -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: +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, { @@ -26,7 +28,7 @@ bootstrapApplication(AppComponent, { }); ``` -## Enhanced Driver Configuration +### 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: @@ -42,11 +44,11 @@ bootstrapApplication(AppComponent, { }); ``` -## Advanced Configuration for Those Who Want More +### 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. +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. -It is as simple as passing the configuration object as the single parameter of the provide functions. +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, { @@ -76,7 +78,7 @@ bootstrapApplication(AppComponent, { ), ``` -Or the `withHttpOptions` +Or the `withHttpConfig` ```ts bootstrapApplication(AppComponent, { @@ -117,7 +119,7 @@ bootstrapApplication(AppComponent, { ## Continuous Module Support -We want to assure you that we continue to support modules. The new standalone APIs are a complement, not a replacement. +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 From 7b96835d34153f45ac142b65157e93e553f02a03 Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Thu, 25 May 2023 07:24:46 -0300 Subject: [PATCH 4/4] docs: remove warning about node 18 being a breaking change --- lumberjack/introducing-lumberjack-15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lumberjack/introducing-lumberjack-15.md b/lumberjack/introducing-lumberjack-15.md index 8851477..89676d7 100644 --- a/lumberjack/introducing-lumberjack-15.md +++ b/lumberjack/introducing-lumberjack-15.md @@ -10,7 +10,7 @@ First on our list, we've introduced the use of the newest type-safe `inject` fun ## 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. +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. ## Supporting Standalone Angular Applications