angularday report
Tags: angular, javascript, programming, productivity
Published: 2021-11-18 19:40:39

November 2021, seems that pandemic situation is still not getting better but on the other hand several frontend or javascript focused conferences provide online attendance. So, why not visit the Italian one and meet several known and impressive people from the dev community :-)

## [AngularDay](https://twitter.com/angularday)

This Italian Angular international conference was organized by [GrUSP community](https://twitter.com/grusp) on November 12th 2021. The event happened online, on [Hopin](https://hopin.com/) easy-to-use web platform for conferences.

There were various known speakers from the Angular community and also the official Angular Core Team joined ([Emma Twersky](https://twitter.com/twerske), [Mark Thompson](https://twitter.com/marktechson), [Jessica Janiuk](https://twitter.com/@thepunderwoman)) in the last part.

The atmosphere of the conference was easy going and was moderated by [Giulia Tosato](https://twitter.com/giuliatosato), [Tomas Trajan](https://twitter.com/tomastrajan) and also [Tracy Lee](https://twitter.com/ladyleet) joined in the last part.

I decided to highlight the top points per talk which impressed me and I’ll briefly explain why.

## State of Angular, [Maxim Salnikov](https://twitter.com/webmaxru)

Maxim talked about the current status and future roadmap of the Angular framework. He summarized highlights of the improvements in [Angular v13 that was released on November 5th 2021](https://blog.angular.io/angular-v13-is-now-available-cce66f7bc296).

The top improvements which impressed me were following topics:

### “Ivy Everywhere”

View Engine renderer is no longer available. In the case of our project, it means faster compilation and eventually faster builds.

### Component API updates



* Better forms - Enable/disable validators dynamically (maxlength example)
* Simpler API for creating dynamic components

### End of IE11 support

Solution for old school clients would be to run MS Edge and set IE11 mode.

### Angular CLI improvements

* Big improvement in build cache - basically faster builds
* [Typescript v4.4 support](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html)
* [RxJS 7.4 support](https://rxjs.dev/6-to-7-change-summary)
* Automatic cleanup with Testbed - we can expect faster, less memory intensive and more optimized tests

### What’s next topic



* [Standalone components](https://github.com/angular/angular/discussions/43784)
* Strongly typed forms

Resources:
[The Status of Angular Slides](https://slides.com/webmax/angular-status-13)

[Angular v13 is now Available](https://blog.angular.io/angular-v13-is-now-available-cce66f7bc296)

## NoSQL Data Modeling for FE Developers, [Stanimira Vlaeva](https://twitter.com/StanimiraVlaeva)

This topic was mostly about data modeling in the context of MongoDB, a NoSQL document database. That was quite a different topic from Front-end, but for someone who is also interested in server side technologies that could be also beneficial. 

While this topic had nothing to do with front-end I would highlight following points which impressed me:



* NoSQL document database approach in general, which is non-relational nor tabular
    * no tables, different data model from relational DB approach
    * Documents - js or json object. Additional types in json, schema is flexible, every doc has own schema
* When to use Referencing and when Embedding - pros and cons
* Managing duplication and staleness with batch updates

## Create Smart Angular Apps Using Azure Computer Vision - [Ankit Sharma](https://twitter.com/ankitsharma_007)

Very interesting topic about integration of [Microsoft Cognitive Services Computer Vision APIs](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/) with Angular app. While there was no talk about some specific Angular techniques, this speech showed how easy it could be to implement a text recognition feature by using easy-to-use services provided by Azure Cloud. I was impressed. Now I am familiar with following aspects:



* Computer Vision, OCR API, Image Analysis API, Spatial Analysis
* How to set up easily Smart Angular app that has ability to recognize text from pictures

Resources:

[Smart Angular app Github](http://bit.ly/smart-angular-app)

[Ankit Sharma Blog](https://ankitsharmablogs.com)

## Betterer: Incremental Improvement, [Craig Spence](https://twitter.com/phenomnominal)

Craig spoke about something that was completely new for me. And that was a tool called Betterer. Wow wow I was so fascinated how he explained topics like Genetic Algorithms, Evolutionary Architecture, which inspired Betterer to make incremental improvement to our codebases easier.

**[Betterer](https://phenomnomnominal.github.io/betterer/)**

It’s basically a test runner that is similar to Jest or Mocha. But output from Betterer tells you if your new implementation made the codebase/workspace better, worse or  of whether this state is the same in comparison with the stored state in your main branch.

That tool enables you to lock the quality of your codebase and what you can do is to go just in one direction and move closer towards a better solution.

![Betterer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x23mzpje45dippqs9wtq.png)


**Betterer possible use cases**

The typical use case would be when you want to introduce some stricter rule to your codebase - for example migrate JS to TS, replacement of an old component with a new component or just check if the number of eslint warnings is not increasing.

So if you’ve introduced new errors/warnings that are bad and it will throw an error, if you’ve fixed some it keeps letting you fix them until eventually there are none.

Betterer comes with many built-in tests, and of course [Angular tests](https://phenomnomnominal.github.io/betterer/docs/angular-test) are supported, let's check [others](https://phenomnomnominal.github.io/betterer/docs).

Resources:

[Meetup with Craig at AngularNation](https://www.youtube.com/watch?v=BCdDEhNWpUU&ab_channel=AngularNation)

[Betterer site](https://phenomnomnominal.github.io/betterer/)

## The best way to Architect Your Angular Libraries, [Tomas Trajan](https://twitter.com/tomastrajan)

Very helpful and useful tips from Tomas about this topic. Great live coding, during which he demonstrated how useful [Angular Schematics](https://material.angular.io/guide/schematics) are and how it could generate output without writing any code. He focused by showing an example of how to architect the library and how to get the smallest possible bundle size by avoiding specific mistakes.

Everything is well described in the [youtube video](https://www.youtube.com/watch?v=2vHJ3_Om_gU) or in his [article](https://tomastrajan.medium.com/the-best-way-to-architect-your-angular-libraries-87959301d3d3) about this topic. 

**CommonJS dependencies**

Tomas showed how CommonJS dependencies in our library module could affect our final bundle size. In specific cases Ivy just doesn’t know if it should tree-shake it, even though it has not been consumed in our code.

**Destroying code splitting in lazy loaded modules**

There was an example of how easily we can break code splitting of our lazy loaded modules. The library module that was consumed just in the lazy loaded module finally landed in main.js file. It is described in this [scenario](https://tomastrajan.medium.com/the-best-way-to-architect-your-angular-libraries-87959301d3d3#0b90).

**Using [Sub-Entries architecture](https://tomastrajan.medium.com/the-best-way-to-architect-your-angular-libraries-87959301d3d3)**

This technique solves the problem with code splitting of used library modules across our lazy loaded modules. Then everything is tree-shaken properly even though we use CommonJS dependencies in our library modules.

Resources:

[Tomas Trajan - The Best Way To Architect Your Angular Libraries](https://www.youtube.com/watch?v=2vHJ3_Om_gU)

[Tomas Trajan Medium - Angular In depth articles](https://tomastrajan.medium.com/)

[The Best Way To Architect Your Angular Libraries](https://tomastrajan.medium.com/the-best-way-to-architect-your-angular-libraries-87959301d3d3)

## Destructuring frontend monoliths with Micro Frontends, [Trishul Goel](https://twitter.com/trishulgoel)

Trishul explained the general architecture behind Micro Frontends. That tells you how a common enterprise app monolith can be broken into smaller micro front-end parts. He showed an example in Angular which uses the Module federation approach.

I summarized the basic concepts of it in the following points.

**AppShell**



* load and serve the specific Micro Frontend, for example loading the home page micro front-end
* can encapsulate header, footer, global config or shared business logic which could be shared among Micro Frontends

**Communication**

How the communication is handled between Micro Frontends and AppShell will rely on your tech stack. It will be easy in Angular with Angular cases, but worse in Angular using other frameworks. We can communicate by the following techniques



* passing data as an argument of the function
* as a route parameter or pass the function and data as an argument of the module
* custom DOM events

**[Module federation](https://www.angulararchitects.io/en/aktuelles/the-microfrontend-revolution-part-2-module-federation-with-angular/)**

Webpack 5 feature allows you to reference remote modules which are not available or known to the compiler at the compile time. These modules are known only at the run time. Let’s say that we can split our architecture and our AppShell module will encapsulate some remote Micro Frontend modules, then the deployment of them is decoupled.

**Angular side**

We have to set the host and remote module federation configuration file (each per remote). It is done via [ModuleFederationPlugin](https://webpack.js.org/plugins/module-federation-plugin/). Where we say which dependencies will be used from the host, what should be shared between remotes and also remotes references.

**[Tenpureto](https://github.com/tenpureto/tenpureto)**

As each individual Micro Frontend has its own setup, Trishul’s team uses Tenpureto templating engine for initializing new Micro Frontend. Whenever they need a new Micro Frontend it wraps up a new repository according to the specified template with all settings and scripts.

Resources:

[Destructuring frontend monoliths with Microfrontends - By Trishul Goel](https://www.youtube.com/watch?v=nBqUCkQHJu0)

[Tenpureto](https://github.com/tenpureto/tenpureto)

## Who needs Inheritance and composition, when you can copy paste the same code in every class!, [Kate Sky](https://twitter.com/KateSky8)

This talk focused on identifying



* when to use composition
* how to apply Decorator Pattern
* how to take dynamic behavior of the components and refactor them into directives

Kate emphasized that custom directives are another way of refactoring things out of our components. And this idea is based basically on Angular code in itself, wherever the Decorator Pattern can be used.

The goals of these concepts are to make our Angular code



* well-organized and maintainable
* cleaner, easier to change and easier to read
* with great design that minimizes the duplication of code

Resources:

[AngularDay demo app](https://github.com/katesky/angular-day-it)

[AngularAir - Using composition over inheritance in building Angular Components with Kate Sky](https://www.youtube.com/watch?v=50ALR6JRNrk)

## Summary

… aaaand summary. As I gather my impressions and learnings from that conference, the best talks, from my perspective were 



* Maxim Salnikov where he clearly explained what's new and where it goes
* Tomas Trajan, that cool guy who always does live coding and so far was the only participant to try that during a conference. So I appreciate his courage, despite that he had some connection problems. That was a really beneficial introduction to sub-entries architecture in the angular libraries. I will head straight for that in future
* Craig Spence - the creator of Betterer. It's amazing what this guy has done for the whole community. This tool is worth consideration in every project. It tries to solve problems of Angular projects (at least from my experience). Betterer has so much potential