[Evergreen-dev] [Eg-newdevs] Proposal: new angular components should be standalone

Ruth Davis rdavis at evergreencdi.org
Thu Feb 27 12:55:56 EST 2025


Jane,

As a nondeveloper with development intersections, I'm going to add in my
two cents FWIW.

First off, thank you for bringing this up. It's very intriguing and,
honestly, exciting to think about. There has been talk about what exactly
calls for a switch to 4.0. With the switch to 3.0, there was a fundamental
shift from a downloadable application to a web-based application.  Perhaps,
this fundamental shift could serve as a watershed moment in the evolution
of the Evergreen ILS.

Next, I'd like to speak to the cons that you've listed. As a tragically
optimistic person (mostly), I instantly want to reframe the "cons" as
"considerations" or "opportunities for growth." So, sorry about that to
anyone who immediately wants to resist my tragic optimism.

   - I'm never going to presume on anyone to learn something new. With that
   said, it seems like there has been a lot of "learning something new" in
   this community. As you say, " Standalone components are the default in
   Angular 19, so this could help us get more prepared for that situation."
   - In terms of inconsistency, I wonder if something like a "style guide"
   might help to provide guidance for consistency.
   - When listing out dependencies for large, complex projects, it might be
   repetitive, but that's when boilerplate becomes useful - have the
   repetition in the listing, rather than in repetitive code.
   - In terms of bundled components and when it might be appropriate, the
   aforementioned "style guide" might also include some guidance for this
   decision making.

Thanks for indulging me. Please chuck any nonsense thoughts I've shared
into the wastebasket of irrelevance.

*Ruth Frasur Davis, Coordinator*
*Evergreen Community Development Initiative*
https://evergreencdi.org
(650) 265-1193


On Thu, Feb 27, 2025 at 9:10 AM Jane Sandberg via Eg-newdevs <
eg-newdevs at list.evergreen-ils.org> wrote:

> Hi Evergreen developers,
>
> I'd like to propose that for any new Angular components we create, we use
> the standalone component approach
> <https://v17.angular.io/guide/standalone-components>.  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 Open-ILS/src/eg2/src/app/staff/serials
> <https://github.com/evergreen-library-system/Evergreen/tree/main/Open-ILS/src/eg2/src/app/staff/serials>
> .
>
> Pros:
> * I consider the current angular module approach harmful -- you can see
> the harm I caused with it in LP2044051
> <https://bugs.launchpad.net/evergreen/+bug/2044051>.  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.
> * Standalone components require less boilerplate code.
> * Standalone components are the default in Angular 19, so this could help
> us get more prepared for that situation.
> * Personally, I have found the explicit list of a component's dependencies
> useful, especially when writing component unit tests.
>
> Cons:
> * Yet another thing to learn (although tbh, I never totally understood
> angular modules anyway hahaha)
> * There will be more inconsistency in the different component approaches
> within our codebase.
> * Listing out dependencies could get repetitive for large, complex
> components.
> * There may be some legitimate uses for components that are bundled
> together in a module (perhaps components that can only ever be used
> together?)
>
> FYI: for anybody else who uses the `ng generate component` command, you
> can add the `--standalone` flag to create it as a standalone component.
>
> 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.
>
> What do you think?  Very happy to receive questions, counterpoints, etc.!
>
> Thanks!
>
>   -Jane
> _______________________________________________
> Eg-newdevs mailing list
> Eg-newdevs at list.evergreen-ils.org
> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/eg-newdevs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-dev/attachments/20250227/2c0d5945/attachment.htm>


More information about the Evergreen-dev mailing list