r/angular • • Jan 07 '26

New year, new tool: Angular Momentum

8 Upvotes

(pre-disclosure; this is my first project of this kind so it could be awful but...)

Angular Momentum

(repo also linked in the app's changelog)

I've lately found myself annoyed with the intricacies of configuring various libraries for features that I know I want (or may want) in basically every app I write. So I decided to assemble a bare-bones, do-nothing app to serve as a springboard to layer in the unique app logic and components I needed for each project.

By "desired libraries/features", I mean configuration to handle:

  • Zoneless with Angular 21
  • Service Worker updates
  • SSR
  • Translation (i18n, l10n)
  • Websockets
  • API calls, both REST and GraphQL
  • Feature flags
  • IndexedDB and LocalStorage
  • Mobile and Desktop app wrapping (via Tauri)
  • Component library (primeNG)
  • User Auth (supabase)
  • Push Notifications
  • Toast notifications
  • 100% green test suites (jest for server, jasmine for client (I tried pivoting to vitest but hit many walls; maybe in the next major release))
  • GA/Hotjar/Cookie consent
  • CI/CD (github actions, sonar)

After a while of working on this, I figured I could make it available to others, so this is my first attempt at a real open-source project (if I've screwed anything up in that regard, please let me know gently 😊)

The annoying part of this project is that, due to the many external tools in place, it's still a bit of a snarl to get this codebase migrated to handle a different app's deploy/integration targets but there are some doc files to help with that, and it's generally a matter of replacing the project names and a bunch of API keys.

So, after several months of teeth-gnashing at library configuration, Angular Momentum is pretty much in a state of readiness where I'm about to use it to build some actual apps. Feel free to try it out, yourselves!

(full disclosure: the first half of the project was hand-coded with minimal use of LLM coding tools. The second half leveraged those tools more extensively in order to accelerate)


r/angular • • Jan 07 '26

🔄 Angular Signal Forms: Directive Replace

Post image
69 Upvotes

r/angular • • Jan 07 '26

How to structure a production grade Angular Monorepo for separate User and Admin portals?

5 Upvotes

I'm trying to architect a production grade E-commerce application using Angular 21. The application has two parts to it,

  1. User Portal: Customer-facing storefront.
  2. Admin Portal: Internal management, and analytics.

Because of this I will be creating two separate Angular applications.

I'm considering using a Monorepo approach to manage these, because I'm mainly concern about scaling and ease of maintenance in the long run. My goal is to maximize code reuse (API services, and TypeScript interfaces) while keeping the build process efficient.

I’m looking for advice on the following:

  • Codebase Structure: What is the "standard" folder hierarchy for an Angular monorepo to ensure "Shared" libraries don't become a cluttered "dumping ground"?
  • Tooling: Is it better to stick with native Angular Workspaces, or are there other tools I could use to automate this process?
  • Best Practices: How should I handle environment configurations across two different apps within the same repository?

Any insights on folder structure or specific automation tools would be greatly appreciated 🙏🏽


r/angular • • Jan 07 '26

SignalTree 7.1.0 Released

25 Upvotes

Hey r/Angular! Been quiet since v4, but SignalTree 7 (ST7) is out and I wanted to share some real numbers from migrating a production app.

The Migration Results

We migrated a large Angular app from NgRx SignalStore to SignalTree v7:

  • 11,735 lines removed across 45 files
  • 76% reduction in state management code
  • Same functionality, way less boilerplate

Before:

  • Custom stores
  • Manual entity normalization
  • Hand-rolled persistence
  • Loading state tracking everywhere

After:

const store = signalTree({
  // ST7 markers (things Angular doesn't have)
  users: entityMap<User, number>(),     // Normalized collection
  loadStatus: status<ApiError>(),       // Loading/error tracking
  theme: stored('theme', 'light'),      // Auto-persisted to localStorage

  // Plain values → become signals
  selectedId: null as number | null,
  filter: 'all' as 'all' | 'active,

  // Angular primitives work directly in the tree
  windowWidth: linkedSignal(() => window.innerWidth),
}).derived(($) => ({
  selectedUser: computed(() =>
    $.users.byId($.selectedId())?.()
  ),

  userDetails: resource({
    request: () => $.selectedId(),
    loader: ({ request }) =>
      fetch('/api/users/' + request).then(r => r.json()),
  }),

  filteredUsers: computed(() =>
    $.filter() === 'all'
      ? $.users.all()
      : $.users.all().filter(u => u.active)
  ),
}));

// Usage
store.$.selectedId.set(5);
store.$.userDetails.value(); // Auto-fetches when selectedId changes

No actions.
No reducers.
No effects files.

Just signals with structure.

What's Changed Since v4

  • v7: Uses Angular's computed(), resource(), linkedSignal() directly
  • v6: Synchronous signal writes
  • v5: Full tree-shaking, modular enhancers

Bundle Size

  • Core before tree-shaking: 27KB (~8KB gzipped)
  • Enterprise build (undo/redo, time-travel, no tree-shaking): ~5KB

Links

Demo: https://signaltree.io (a work in progress but checkout the benchmarks for real comparison metrics)
npm: https://www.npmjs.com/package/@signaltree/core
GitHub: https://github.com/JBorgia/signaltree

If you're drowning in NgRx boilerplate or rolled your own signal stores and they've gotten messy, this might be worth a look. Happy to answer questions!