The deal
Mavericks get: Forward Josh McRoberts, second-round pick
Heat get: Center AJ Hammons
Dallas Mavericks: B-

The relatively small price the Mavericks extracted for taking on McRoberts' $6 million this season -- it's unclear which pick Dallas is getting, but Miami doesn't have a second-rounder to trade until 2022 at earliest -- suggests to me the Mavs may think they can get some production from him this season.
McRoberts remains a skilled big man -- when he can stay on the court. Over the first three seasons of the four-year, $22-plus million contract McRoberts signed when Miami was hoping he could help complement a potentially re-signed LeBron James (how long ago that seems now!), he has managed to play just 81 games and 1,272 minutes. A stress fracture in McRoberts' left foot ended his 2016-17 campaign before New Year's Day.
Given how poorly McRoberts has played in limited action the past two seasons, and the series of injuries, I'm dubious he can still help an NBA team. We'll see.
Of course, part of the value for the Mavericks is getting off the remaining two guaranteed years on the contract Hammons signed as the No. 46 pick of last year's draft. Hammons played just 163 minutes during his rookie season and wasn't particularly effective in the G League, so it's understandable that Dallas would want to move on.
One technical note here is the Mavericks will likely complete this swap using the trade exception generated in last spring's Andrew Bogut trade. That would allow Dallas to stay over the cap and use the non-taxpayer midlevel exception, which is worth more ($8.4 million) than the cap space the Mavericks would have remaining after acquiring McRoberts and re-signing Dirk Nowitzki to a reported two-year, $10 million deal (a little less than $7 million).
Miami Heat: A-

Moving McRoberts' salary gave the Heat enough cap space to re-sign forward James Johnson after agreeing with former Boston Celtics big man Kelly Olynyk earlier Thursday night. Time will tell whether those contracts are worth it, but the price for Miami was modest. (At this point, the Heat may never keep a second-round pick.)
Miami has the roster spots to keep Hammons around as a third center, though the Heat also have the option of waiving him and stretching his remaining $2.9 million in salary over the next five seasons.