{"id":5649,"date":"2022-05-01T17:09:41","date_gmt":"2022-05-01T15:09:41","guid":{"rendered":"https:\/\/www.angulararchitects.io\/?p=5649"},"modified":"2022-05-01T17:09:41","modified_gmt":"2022-05-01T15:09:41","slug":"angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture","status":"publish","type":"post","link":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/","title":{"rendered":"Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?"},"content":{"rendered":"<div class=\"wp-post-series-box series-angulars-future-without-ngmodules wp-post-series-box--expandable\">\n\t\t\t<input id=\"collapsible-series-angulars-future-without-ngmodules69d61fdcba0f7\" class=\"wp-post-series-box__toggle_checkbox\" type=\"checkbox\">\n\t\n\t<label\n\t\tclass=\"wp-post-series-box__label\"\n\t\t\t\t\tfor=\"collapsible-series-angulars-future-without-ngmodules69d61fdcba0f7\"\n\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t<p class=\"wp-post-series-box__name wp-post-series-name\">\n\t\t\tThis is post 2 of 8 in the series <em>&ldquo;Angular&#039;s Future with Standalone Components&rdquo;<\/em>\t\t<\/p>\n\t\t\t<\/label>\n\n\t\t\t<div class=\"wp-post-series-box__posts\">\n\t\t\t<ol>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\">Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><span class=\"wp-post-series-box__current\">Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?<\/span><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/4-ways-to-prepare-for-angulars-upcoming-standalone-components\/\">4 Ways to Prepare for Angular&#8217;s Upcoming Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/routing-and-lazy-loading-with-standalone-components\/\">Routing and Lazy Loading with Angular&#8217;s Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/angular-elements-web-components-with-standalone-components\/\">Angular Elements: Web Components with Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/the-refurbished-httpclient-in-angular-15-standalone-apis-and-functional-interceptors\/\">The Refurbished HttpClient in Angular 15 &#8211; Standalone APIs and Functional Interceptors<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/testing-angular-standalone-components\/\">Testing Angular Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/tutorial-automatically-migrating-to-standalone-components-in-3-steps\/\">Automatic Migration to Standalone Components in 3 Steps<\/a><\/li>\n\t\t\t\t\t\t\t<\/ol>\n\t\t<\/div>\n\t<\/div>\n<p><strong>Update on 2022-05-01<\/strong>: Texts and examples fully updated to use initial Standalone Components support in <em>Angular 14.0.0-next.15<\/em> (instead of just using a shim for simulating them). <\/p>\n<p><strong>Update on 2022-10-09<\/strong>: Update for <em>Angular 14.2.0<\/em><\/p>\n<p><\/p>\n<p>In the <a href=\"https:\/\/www.angulararchitects.io\/aktuelles\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\">first part<\/a> of this short series, I've shown how Standalone Components will make our Angular applications more lightweight in the future. In this part, I'm discussing options for improving your architecture with them.<\/p>\n<blockquote><p>\nThe <strong>\ud83d\udcc2 source code<\/strong> for this can be found in the form of a traditional <a href=\"https:\/\/github.com\/manfredsteyer\/standalone-example-cli\">Angular CLI workspace<\/a> and as an <a href=\"https:\/\/github.com\/manfredsteyer\/standalone-example-nx\">Nx workspace<\/a> that uses libraries as a replacement for NgModules.\n<\/p><\/blockquote>\n<h2>Grouping Building Blocks<\/h2>\n<p>Unfortunately, the examples shown in the first part of this series cannot keep up with one aspect of NgModules. Namely the possibility of grouping building blocks that are usually used together. <\/p>\n<p>Obviously, the easiest approach for grouping stuff that goes together is using folders. However, you might go one step further by leveraging barrels: A barrel is an EcmaScript file that exports related elements.<\/p>\n<p>These files are often called <code>public-api.ts<\/code> or <code>index.ts<\/code>. The example project used contains such an <code>index.ts<\/code> to group two navigation components from the shell folder:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/barrel.png\" alt=\"Grouping two Standalone Components with a barrel\" \/><\/p>\n<p>The barrel itself re-exports the two components:<\/p>\n<pre><code class=\"language-typescript\">export { NavbarComponent } from &#039;.\/navbar\/navbar.component&#039;;\nexport { SidebarComponent } from &#039;.\/sidebar\/sidebar.component&#039;;<\/code><\/pre>\n<p>The best of this is, you get real modularization: Everything the barrel experts can be used by other parts of your application. Everything else is your secret. You can modify these secrets as you want, as long as the public API defined by your barrel stays backwards compatible. <\/p>\n<p>In order to use the barrel, just point to it with an <code>import<\/code>:<\/p>\n<pre><code class=\"language-typescript\">import { \n    NavbarComponent, \n    SidebarComponent \n} from &#039;.\/shell\/index&#039;;\n\n@Component({\n    standalone: true,\n    selector: &#039;app-root&#039;,\n    imports: [\n        RouterOutlet,\n\n        NavbarComponent,\n        SidebarComponent,\n    ],\n    templateUrl: &#039;.\/app.component.html&#039;,\n    styleUrls: [&#039;.\/app.component.css&#039;]\n})\nexport class AppComponent {\n    [...]\n}<\/code><\/pre>\n<p>If you call your barrel <code>index.ts<\/code>, you can even omit the file name, as <code>index<\/code> is the default name when configuring the TypeScript compiler to use Node.js-based conventions. Something that is the case in the world of Angular and the CLI:<\/p>\n<pre><code class=\"language-typescript\">import { \n    NavbarComponent, \n    SidebarComponent \n} from &#039;.\/shell&#039;;\n\n@Component({\n    standalone: true,\n    selector: &#039;app-root&#039;,\n    imports: [\n        RouterOutlet,\n\n        NavbarComponent,\n        SidebarComponent,\n    ],\n    templateUrl: &#039;.\/app.component.html&#039;,\n    styleUrls: [&#039;.\/app.component.css&#039;]\n})\nexport class AppComponent {\n    [...]\n}<\/code><\/pre>\n<h2>Importing Whole Barrels<\/h2>\n<p>In the last section, the <code>NavbarComponent<\/code> and the <code>SidebarComponent<\/code> were part of the shell's public API. Nevertheless. Angular doesn't provide a way to import everything a barrel provides at once. <\/p>\n<p>In most of the cases, this is the totally fine. Auto-imports will add the needed entries anyway, hence this style of programming is easy. Also, being explicit about what you need helps enables tree-shaking. <\/p>\n<p>However, in some edge-cases where you know that some building blocks <strong>always<\/strong> go together, e. g. because there is a strong mutual dependency, putting them into an  array can help to make our lives easier. For instance, think about all the directives provided by the FormsModule. Normally, we don't even know their exact names nor which of them play together. <\/p>\n<p>The following example demonstrates this idea:<\/p>\n<pre><code class=\"language-typescript\">import { NavbarComponent } from &#039;.\/navbar\/navbar.component&#039;;\nimport { SidebarComponent } from &#039;.\/sidebar\/sidebar.component&#039;;\n\nexport { NavbarComponent } from &#039;.\/navbar\/navbar.component&#039;;\nexport { SidebarComponent } from &#039;.\/sidebar\/sidebar.component&#039;;\n\nexport const SHELL = [\n    NavbarComponent,\n    SidebarComponent\n];<\/code><\/pre>\n<p>Interestingly, such arrays remind us to the <code>exports<\/code> section of NgModules. Please note that your array needs to be a constant. This is needed because the Angular Compiler uses it already at compile time.<\/p>\n<p>Such arrays can be directly put into the <code>imports<\/code> array. No need for spreading them: <\/p>\n<pre><code class=\"language-typescript\">import { SHELL } from &#039;.\/shell&#039;;\n\n[...]\n\n@Component({\n    standalone: true,\n    selector: &#039;app-root&#039;,\n    imports: [\n        RouterOutlet,\n\n        \/\/ NavbarComponent,\n        \/\/ SidebarComponent,\n        SHELL\n    ],\n    templateUrl: &#039;.\/app.component.html&#039;,\n    styleUrls: [&#039;.\/app.component.css&#039;]\n})\nexport class AppComponent {\n    [...]\n}<\/code><\/pre>\n<p>One more time I want to stress out that this array-based style should only be used with caution. While it allows to group things that always go together it also makes your code less tree-shakable.<\/p>\n<h2>Barrels with Pretty Names: Path Mappings<\/h2>\n<p>Just using <code>import<\/code> statements that directly point to other parts of your application often leads to long relative and confusing paths: <\/p>\n<pre><code class=\"language-typescript\">import { SHELL } from &#039;..\/..\/..\/..\/shell&#039;;\n\n@Component ({\n    standalone: true,\n    selector: &#039;app-my-cmp&#039;,\n    imports: [\n        SHELL,\n        [...]\n    ]\n})\nexport class MyComponent {\n}<\/code><\/pre>\n<p>To bypass this, you can define path mappings for your  barrels you import from in your TypeScript configuration (<code>tsconfig.json<\/code> in the project's root):<\/p>\n<pre><code class=\"language-json\">&quot;paths&quot;: {\n &quot;@demo\/shell&quot;: [&quot;src\/app\/shell\/index.ts&quot;],\n  [...]\n}<\/code><\/pre>\n<p>This allows direct access to the barrel using a well-defined name without having to worry about - sometimes excessive - relative paths:<\/p>\n<pre><code class=\"language-typescript\">\/\/ Import via mapped path:\nimport { SHELL } from &#039;@demo\/shell&#039;;\n\n@Component ({\n    standalone: true,\n    selector: &#039;app-root&#039;,\n    imports: [\n        SHELL,\n        [...]\n    ]\n})\nexport class MyComponent {\n}<\/code><\/pre>\n<h2>The Next Logical Step: Workspace Libraries and Nx<\/h2>\n<p>These path mappings can of course be created manually. However, it is a little easier with the CLI extension <a href=\"https:\/\/nx.dev\/\">Nx<\/a> which automatically generates such path mappings for each library created within a workspace. Libraries seem to be the better solution anyway, especially since they subdivide it more and Nx prevents bypassing the barrel of a library.<\/p>\n<p>This means that every library consists of a public -- actually published -- and a private part. The library\u2019s public and private APIs are also mentioned here. Everything the library exports through its barrel is public. The rest is private and therefore a &quot;secret&quot; of the library that other parts of the application cannot access.<\/p>\n<p>It is precisely these types of &quot;secrets&quot; that are a simple but effective key to stable architectures, especially since everything that is not published can easily be changed afterwards. The public API, on the other hand, should only be changed with care, especially since a breaking change can cause problems in other areas of the project.<\/p>\n<p>An Nx project (workspace) that represents the individual sub-areas of the Angular solution as libraries could use the following structure:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/nx-project-structure.png\" alt=\"Structure of an Nx Solution\" \/><\/p>\n<p>Each library receives a barrel that reflects the public API. The prefixes in the library names reflect a categorization recommended by the Nx team. For example, feature libraries contain smart components that know the use cases, while UI libraries contain reusable dumb components. The domain library comes with the client-side view of our domain model and the services operating on it, and utility libraries contain general auxiliary functions.<\/p>\n<p>On the basis of such categories, Nx allows the definition of linting rules that prevent undesired access between libraries. For example, you could specify that a domain library should only have access to utility libraries and not to UI libraries:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/linting.png\" alt=\"Nx prevents unwanted access between libraries via linting\" \/><\/p>\n<p>In addition, Nx allows the dependencies between libraries to be visualized:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/graph.png\" alt=\"Nx visualizes the dependencies between libraries\" \/><\/p>\n<p>If you want to see all of this in action, feel free to have a look at the Nx version of the example used here. Your find the <a href=\"https:\/\/github.com\/manfredsteyer\/demo-nx-standalone\">\ud83d\udcc2 Source Code at GitHub<\/a>.<\/p>\n<p>Also, our <a href=\"https:\/\/www.angulararchitects.io\/aktuelles\/sustainable-angular-architectures-1\/\">article series on Nx and DDD<\/a> (esp. Strategic Design) discusses the underlying ideas in detail.<\/p>\n<h2>Conclusion<\/h2>\n<p>Standalone Components make the future of Angular applications more lightweight. We don't need NgModules anymore. Instead, we just use EcmaScript modules. This makes Angular solutions more straightforward and lowers the entry barrier into the world of the framework. Thanks to the mental model, which regards standalone components as a combination of a component and a NgModule, this new form of development remains compatible with existing code.<\/p>\n<p>For the grouping of related building blocks, simple barrels are ideal for small solutions. For larger projects, the transition to monorepos as offered by the CLI extension Nx seems to be the next logical step. Libraries subdivide the overall solution here and offer public APIs based on barrels. In addition, dependencies between libraries can be visualized and avoided using linting.<\/p>\n<h2>What's next? More on Architecture!<\/h2>\n<p>So far, we've seen that Nx can help to structure Angular-based applications and that it's concepts fit perfectly to the new world of Standalone Components. However, when dealing with Nx, several additional questions come in mind:<\/p>\n<ul>\n<li>According to which criteria can we sub-divide a huge application into libraries and sub-domains?<\/li>\n<li>Which access restrictions make sense?<\/li>\n<li>Which proven patterns should we use?<\/li>\n<li>How can we evolve our solution towards micro frontends?<\/li>\n<\/ul>\n<p>Our free eBook (about 100 pages) covers all these questions and more:<\/p>\n<p><a href=\"https:\/\/www.angulararchitects.io\/book\"><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2022\/12\/cover-5th-small.png\" alt=\"free ebook\"><\/a><\/p>\n<p>Feel free to <a href=\"https:\/\/www.angulararchitects.io\/book\">download it here<\/a> now!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the grouping of related building blocks, simple barrels are ideal for small solutions. For larger projects, the transition to monorepos as offered by the CLI extension Nx seems to be the next logical step.<\/p>\n","protected":false},"author":9,"featured_media":5641,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-5649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","post_series-angulars-future-without-ngmodules"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular&#039;s Future Without NgModules - Part 2: What Does That Mean for Our Architecture? - ANGULARarchitects<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular&#039;s Future Without NgModules - Part 2: What Does That Mean for Our Architecture? - ANGULARarchitects\" \/>\n<meta property=\"og:description\" content=\"For the grouping of related building blocks, simple barrels are ideal for small solutions. For larger projects, the transition to monorepos as offered by the CLI extension Nx seems to be the next logical step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\" \/>\n<meta property=\"og:site_name\" content=\"ANGULARarchitects\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-01T15:09:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/blog02.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Manfred Steyer, GDE\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@daniel\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manfred Steyer, GDE\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\"},\"author\":{\"name\":\"Manfred Steyer, GDE\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951\"},\"headline\":\"Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?\",\"datePublished\":\"2022-05-01T15:09:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\"},\"wordCount\":1190,\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\",\"name\":\"Angular's Future Without NgModules - Part 2: What Does That Mean for Our Architecture? - ANGULARarchitects\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg\",\"datePublished\":\"2022-05-01T15:09:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg\",\"width\":1999,\"height\":1333},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.angulararchitects.io\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"name\":\"ANGULARarchitects\",\"description\":\"AngularArchitects.io\",\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\",\"name\":\"ANGULARarchitects\",\"alternateName\":\"SOFTWAREarchitects\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"width\":644,\"height\":216,\"caption\":\"ANGULARarchitects\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/github.com\/angular-architects\",\"https:\/\/www.linkedin.com\/company\/angular-architects\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951\",\"name\":\"Manfred Steyer, GDE\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g\",\"caption\":\"Manfred Steyer, GDE\"},\"sameAs\":[\"https:\/\/x.com\/daniel\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular's Future Without NgModules - Part 2: What Does That Mean for Our Architecture? - ANGULARarchitects","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/","og_locale":"en_US","og_type":"article","og_title":"Angular's Future Without NgModules - Part 2: What Does That Mean for Our Architecture? - ANGULARarchitects","og_description":"For the grouping of related building blocks, simple barrels are ideal for small solutions. For larger projects, the transition to monorepos as offered by the CLI extension Nx seems to be the next logical step.","og_url":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/","og_site_name":"ANGULARarchitects","article_published_time":"2022-05-01T15:09:41+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/blog02.jpg","type":"image\/jpeg"}],"author":"Manfred Steyer, GDE","twitter_card":"summary_large_image","twitter_creator":"@daniel","twitter_misc":{"Written by":"Manfred Steyer, GDE","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#article","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/"},"author":{"name":"Manfred Steyer, GDE","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951"},"headline":"Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?","datePublished":"2022-05-01T15:09:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/"},"wordCount":1190,"publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/","url":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/","name":"Angular's Future Without NgModules - Part 2: What Does That Mean for Our Architecture? - ANGULARarchitects","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg","datePublished":"2022-05-01T15:09:41+00:00","breadcrumb":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#primaryimage","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/arc-bg.jpg","width":1999,"height":1333},{"@type":"BreadcrumbList","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.angulararchitects.io\/en\/"},{"@type":"ListItem","position":2,"name":"Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?"}]},{"@type":"WebSite","@id":"https:\/\/www.angulararchitects.io\/en\/#website","url":"https:\/\/www.angulararchitects.io\/en\/","name":"ANGULARarchitects","description":"AngularArchitects.io","publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.angulararchitects.io\/en\/#organization","name":"ANGULARarchitects","alternateName":"SOFTWAREarchitects","url":"https:\/\/www.angulararchitects.io\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","width":644,"height":216,"caption":"ANGULARarchitects"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/github.com\/angular-architects","https:\/\/www.linkedin.com\/company\/angular-architects\/"]},{"@type":"Person","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951","name":"Manfred Steyer, GDE","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g","caption":"Manfred Steyer, GDE"},"sameAs":["https:\/\/x.com\/daniel"]}]}},"_links":{"self":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/5649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/comments?post=5649"}],"version-history":[{"count":0,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/5649\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media\/5641"}],"wp:attachment":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media?parent=5649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/categories?post=5649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/tags?post=5649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}