I'm flying From Heathrow to San Francisco with a stopover in Dublin. The flights were booked as one ticket, both Aer Lingus. However, as Dublin has US Preclearance, will I need to claim my luggage at Dublin and recheck it? Or will it be sent from Heathrow to San Francisco? Is it now mandatory to pre-clear at Dublin?
Taking things in reverse order:
Is it now mandatory to pre-clear at Dublin?
Yes, it is. All US-bound passengers must go through pre-clearance at Dublin. The plane then lands as a "US-Domestic" flight in the states, with you just stepping out into the terminal.
will I need to claim by luggage at Dublin and recheck it?
No, you won't, as long as it is tagged through to your final destination at checkin in Heathrow. (Verify this at checkin!). When you get to the US pre-clearance area, you'll give them your baggage tags (the little receipt-y barcode sticky tags) along with your passport. The CBP officers will then pull up a photo of your bags on their screen, and ask you to identify that they've correctly worked out which are yours. They'll then ask you some questions about the bags.
If they are interested in the bags, they'll then push some buttons and have the bags sent to a special inspection area in the pre-clearance zone for you and them to check. Otherwise, once they're happy for the bags to enter the USA, they'll send them onwards to the plane