Dave's Notebook

Optimizing Angular For Speed

I was recently asked how I would optimize an Angular site for speed. Interestingly, I’ve never written about this explicitly even though I’ve done a lot of work related to this issue.

For the purposes of this article, I’m going to assume you have already implemented most of the things that Angular gives you “for free.” For example, we won’t discuss “Tree Shaking” or “AOT.” Those are given.

Here are my 30 or so tips on how to optimize an Angular application for speed.

Read More

Navigating Work Relationships

Sharing experiences with a friend has highlighted the complexities we all face in the workplace. Together, we’ve often speculated on how work life could unfold more smoothly. It’s a captivating dance we all do, navigating through life’s ever-changing rhythms.

I’ve cultivated a daily ritual—tiny reminders that influence my perspective and guide my daily interactions. These cues become the cornerstone of my morning, offering a touch-point for clarity. They may resonate with you or maybe not, and that’s perfectly fine. Feel free to create your own set of reminders that evolve over time. After all, our beliefs can always use a gentle reality check.

Read More

Avoiding NgRx Boilerplate

One of the recurring complaints I hear about NgRX is that it requires too much boiler plate code. But, it doesn’t have to be this way. In fact, I’ve been working on a project that has a lot of NgRX code and I’ve been able to reduce the amount of boilerplate code to a minimum and gain features in the process.

Read More

Clean State Management with NgRx

Once again I’ve run into a situation where the code I’m looking at doesn’t resemble how the code was meant to be written.

I’ve spent the last month fixing bugs that can all be summarized by the following problems:

  • Reducers updating nested data.
  • Storing data manipulations that Selectors could perform
  • Using Effects as Selectors
  • Components doing too much data manipulation
  • Too many actions and indirection

Read More

NgZones Performance Impact

I’ve been working on this article for a month, off and on. When I started, I set out to demonstrate the performance impact of change detection in Angular. In particular, I wanted to demonstrate that turning zones off would have a significant impact on performance even if you followed all my other advice regarding performance optimization.

That is, if you had:

Read More

Every Programming Issue Solved

As I’ve considered all the issues I’ve seen over the years and, as I’ve talked with and interviewed with other developers, I’ve come to the conclusion that our industry has two main problems. Fix these and all the other issues we face will solve themselves.

Read More

Rethinking Action Names (Redux/NgRX)

If you’ve been using some form of Redux, you are familiar with the basic flow of data through the Redux loop. Central to this flow are Actions, the messages that trigger code in our Reducer or Effect/Epic/Saga (depending on what flavor of Redux you are using).

The model allows us to disconnect our code so that it only cares that an action was triggered in some way. That is, “when this action occurs, I will run this code.”

Because of this, we can create an action that triggers multiple code blocks to run. Our only concern is that the code that gets triggered can’t depend on each other.

In fact, much of the official literature encourages this practice.

And, this is where all our troubles begin.

Read More