<div dir="ltr"><div dir="ltr">Hi Evergreen developers,<br><br>I'd like to propose that for any new Angular components we create, we use the <a href="https://v17.angular.io/guide/standalone-components" target="_blank">standalone component approach</a>. In this approach, you explicitly list the components and angular modules your component depends on. This contrasts with the current approach: organizing angular modules such that each component is within an angular module that supplies the needed dependencies. You can see a few standalone component examples in <a href="https://github.com/evergreen-library-system/Evergreen/tree/main/Open-ILS/src/eg2/src/app/staff/serials" target="_blank">Open-ILS/src/eg2/src/app/staff/serials</a>.<br><br>Pros:<br>* I consider the current angular module approach harmful -- you can see the harm I caused with it in <a href="https://bugs.launchpad.net/evergreen/+bug/2044051" target="_blank">LP2044051</a>. There's not a reliable safety net that will catch you if you don't meticulously trace all uses of each component and confirm that they are within angular modules that provide the correct dependencies (either directly, or through the modules that they depend on, or their dependency's dependencies, and so on). You might get a compile-time error, but you might not and -- in blissful ignorance -- break interfaces completely unrelated to the one that you were working on.<br>* Standalone components require less boilerplate code.<br>* Standalone components are the default in Angular 19, so this could help us get more prepared for that situation.<br>* Personally, I have found the explicit list of a component's dependencies useful, especially when writing component unit tests.<br><br>Cons:<br>* Yet another thing to learn (although tbh, I never totally understood angular modules anyway hahaha)<br>* There will be more inconsistency in the different component approaches within our codebase.<br>* Listing out dependencies could get repetitive for large, complex components.<br>* There may be some legitimate uses for components that are bundled together in a module (perhaps components that can only ever be used together?)<br><br>FYI: for anybody else who uses the `ng generate component` command, you can add the `--standalone` flag to create it as a standalone component.<br><br>Certainly, if you've already written some new components using angular modules, I don't want to block you! But my proposal is that after a certain date TBD, if you create a new component, please make it standalone.<br><br>What do you think? Very happy to receive questions, counterpoints, etc.!<br><br>Thanks!<br><br> -Jane</div>
</div>