<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrew Stacy</title>
    <description>The latest articles on DEV Community by Andrew Stacy (@ajstacy).</description>
    <link>https://dev.to/ajstacy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F685117%2Fc53016b7-32f6-465b-896a-0535123f93b9.jpeg</url>
      <title>DEV Community: Andrew Stacy</title>
      <link>https://dev.to/ajstacy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ajstacy"/>
    <language>en</language>
    <item>
      <title>Implement the New AWS CloudScape Design System into NextJS</title>
      <dc:creator>Andrew Stacy</dc:creator>
      <pubDate>Fri, 29 Jul 2022 02:18:36 +0000</pubDate>
      <link>https://dev.to/ajstacy/implement-the-new-aws-cloudscape-design-system-into-nextjs-2k50</link>
      <guid>https://dev.to/ajstacy/implement-the-new-aws-cloudscape-design-system-into-nextjs-2k50</guid>
      <description>&lt;p&gt;Something exciting has happened recently. AWS has released the design system that they now use for the AWS Console as open-source! The name for the design system in CloudScape and it is as beautiful as it is functional.&lt;/p&gt;

&lt;p&gt;Find CloudScape here: &lt;a href="https://cloudscape.design/"&gt;https://cloudscape.design/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can integrate it with NextJS but you may run into some some problems, so I wrote a blog post about it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.andrewstacy.com/blog/using-cloudscape-with-nextjs/"&gt;https://www.andrewstacy.com/blog/using-cloudscape-with-nextjs/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope it helps! Enjoy CloudScape!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>design</category>
      <category>aws</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What You Should Know About Logging with Micro-Frontends In 2022</title>
      <dc:creator>Andrew Stacy</dc:creator>
      <pubDate>Thu, 07 Jul 2022 02:02:56 +0000</pubDate>
      <link>https://dev.to/ajstacy/what-you-should-know-about-logging-with-micro-frontends-in-2022-1nob</link>
      <guid>https://dev.to/ajstacy/what-you-should-know-about-logging-with-micro-frontends-in-2022-1nob</guid>
      <description>&lt;p&gt;There is a new trend in building enterprise scale applications that is extending the concept of micro-services all the way through to the frontend of applications. We call this concept Micro-Frontends. &lt;/p&gt;

&lt;p&gt;However, when we divide our applications into multiple, smaller applications, challenges arise in regards to how we control our logging in both the development environment and in production.&lt;/p&gt;

&lt;p&gt;First, we'll take a look at a basic micro-frontend architected application and then dive into some logging concepts that are applied in standard back-end environments. After that we will take a look at how we can use the Adze logging library to solve this problem for the frontend.&lt;/p&gt;

&lt;p&gt;To read the rest, go here: &lt;a href="https://andrewstacy.com/blog/logging-with-micro-frontends/"&gt;https://andrewstacy.com/blog/logging-with-micro-frontends/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>microservices</category>
    </item>
    <item>
      <title>How to make your JS/TS app logging better</title>
      <dc:creator>Andrew Stacy</dc:creator>
      <pubDate>Mon, 27 Jun 2022 01:33:04 +0000</pubDate>
      <link>https://dev.to/ajstacy/how-to-make-your-app-logging-better-2edj</link>
      <guid>https://dev.to/ajstacy/how-to-make-your-app-logging-better-2edj</guid>
      <description>&lt;p&gt;I recently released a blog post about implementing &lt;a href="https://adzejs.com/"&gt;Adze&lt;/a&gt; into your web application to vastly improve your logging experience. Check it out!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.andrewstacy.com/blog/better-javascript-logging-with-adze/"&gt;https://www.andrewstacy.com/blog/better-javascript-logging-with-adze/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>typescript</category>
    </item>
    <item>
      <title>I made an Async Service Container for Node/Browser</title>
      <dc:creator>Andrew Stacy</dc:creator>
      <pubDate>Fri, 01 Oct 2021 15:34:05 +0000</pubDate>
      <link>https://dev.to/ajstacy/i-made-an-async-service-container-for-node-browser-1h3o</link>
      <guid>https://dev.to/ajstacy/i-made-an-async-service-container-for-node-browser-1h3o</guid>
      <description>&lt;p&gt;Hey friends,&lt;/p&gt;

&lt;p&gt;Over the years I have implemented service container architecture in many large-scale front-end apps and it has vastly improved their performance and maintainability. I've finally got around to turning it into an open-source library called "Be Our Guest." The name is inspired by the Disney song from Beauty and the Beast and the lyric "put our service to the test."&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what is it "Be Our Guest?"
&lt;/h2&gt;

&lt;p&gt;It is an ASYNC service container that enables your node or browser applications to implement an Inversion of Control architecture for it's modules and dependencies. You may be thinking, "why do I need this?"&lt;/p&gt;

&lt;p&gt;As an example to illustrate it's value, let's say we have a module that handles auth within our application. After you construct and register the module it requires a boot step to send some requests to the backend system to retrieve auth tokens that our other API modules will require. This action is an asynchronous action and we do not want to block initialization of our other modules while this module makes its request. We also need to inject this module into other modules that depend on the auth token. Those modules must await the initialization of our token module before they can be used. As you can see, providing async support for these types of initialization are crucial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not use X other service container library?
&lt;/h2&gt;

&lt;p&gt;There are quite a few other service container libraries out there, but most of them require decorator support for your applications which is not an official JS api and will make adoption into an existing application more difficult (as you will have to do some refactoring). The primary reason they do this is to enable automatic dependency injection. While auto-DI is a nice feature, it's not a hard requirement for an IoC service container to be useful.&lt;/p&gt;

&lt;p&gt;Also, &lt;strong&gt;Be Our Guest&lt;/strong&gt; is completely async. This enables you to more easily register and boot dependencies that require async operations. It also allows the service container to register and boot all of your services without them blocking each other in the process, further increasing your app's performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check it out!
&lt;/h3&gt;

&lt;p&gt;Please take a look at "Be Our Guest" and &lt;em&gt;give us a star&lt;/em&gt; at &lt;a href="https://github.com/AJStacy/be-our-guest"&gt;https://github.com/AJStacy/be-our-guest&lt;/a&gt; .&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>The `any` type in 2021</title>
      <dc:creator>Andrew Stacy</dc:creator>
      <pubDate>Tue, 24 Aug 2021 17:06:18 +0000</pubDate>
      <link>https://dev.to/ajstacy/the-any-type-in-2021-5ea</link>
      <guid>https://dev.to/ajstacy/the-any-type-in-2021-5ea</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UgckkP01--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqen1a259z6t0mp7is72.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UgckkP01--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqen1a259z6t0mp7is72.jpg" alt="any has few uses"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
    </item>
    <item>
      <title>Better JS Logging for Micro-Frontends, Browser, Node</title>
      <dc:creator>Andrew Stacy</dc:creator>
      <pubDate>Fri, 13 Aug 2021 15:22:24 +0000</pubDate>
      <link>https://dev.to/ajstacy/better-js-logging-for-micro-frontends-browser-node-dgl</link>
      <guid>https://dev.to/ajstacy/better-js-logging-for-micro-frontends-browser-node-dgl</guid>
      <description>&lt;p&gt;&lt;strong&gt;Official documentation can be found here:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://adzejs.com"&gt;https://adzejs.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey everyone, I recently released version 1.1 of Adze, a library that solves a lot of the pain points of handling logs in multiple environments and logging with modular systems like micro-frontends.&lt;/p&gt;

&lt;p&gt;As you may already be aware there are a number of other good JS libraries out there to assist with logging. The focus of Adze is to provide a convenient and clean API, provide first-class TypeScript support, and to empower you to take command of your logs rather than pigeon-hole you into a specific way of handling them.&lt;/p&gt;

&lt;p&gt;Here is a list of the features that Adze provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First-class TypeScript support&lt;/li&gt;
&lt;li&gt;Multi-environment support for the Browser and Node&lt;/li&gt;
&lt;li&gt;Wraps and extends the entire standard API&lt;/li&gt;
&lt;li&gt;A fluent, chainable API&lt;/li&gt;
&lt;li&gt;Log Listeners for capturing log data&lt;/li&gt;
&lt;li&gt;Log annotation namespaces, labels, and other meta data&lt;/li&gt;
&lt;li&gt;Attractive styling (EMOJI'S INCLUDED and consistent across major browsers)&lt;/li&gt;
&lt;li&gt;Everything is configurable&lt;/li&gt;
&lt;li&gt;Enables completely custom log levels&lt;/li&gt;
&lt;li&gt;A global log store for recalling logs and overriding configuration (supports micro-frontends and modules)&lt;/li&gt;
&lt;li&gt;Support for Mapped Diagnostic Context&lt;/li&gt;
&lt;li&gt;Convenient unit testing environment controls&lt;/li&gt;
&lt;li&gt;Advanced Log Filtering&lt;/li&gt;
&lt;li&gt;and much more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JZzlzGej--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://adzejs.com/assets/img/demo.ce24f23e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JZzlzGej--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://adzejs.com/assets/img/demo.ce24f23e.png" alt="Default Output Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Beyond the new features that Adze provides you, it also wraps the entire console web standard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ----- setup.js ----- //&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;adze&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;createShed&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;adze&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Adze can be used without any configuration.&lt;/span&gt;
&lt;span class="nx"&gt;adze&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// But you'll likely want to set it up like this...&lt;/span&gt;

&lt;span class="cm"&gt;/* A shed is a global log store used for listeners and caching 
   as well as configuration overrides. */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createShed&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="cm"&gt;/* Let's create a log listener to transport our log data
   to a destination. We'll listen to all log levels. */&lt;/span&gt;
&lt;span class="nx"&gt;shed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="cm"&gt;/* If a log does not render then we will ignore transporting 
     it. */&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do transport logic here.&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Let's create an Adze configuration (or import it from an env file).&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cfg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;logLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Now we'll create a new factory using seal&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;adze&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;foo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;seal&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ----- elsewhere.js ----- //&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;~/setup.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// And now we can create new logs using our new factory&lt;/span&gt;
&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;An error occurred! Oh no!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Another error occurred! Quick! Help!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I won't display because my log level is too high.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>node</category>
      <category>typescript</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
