Revert "REF: remove JoinUnit.shape (#43651)"
This reverts commit bb9a9852265915a4688f772dd062d3fcf4159a32.

This is also included in https://github.com/pandas-dev/pandas/pull/47372/, but reverting this single commit separately will make it easier to backport the other PR, since this is the only commit that was not already included in 1.4, but was only done in 1.5 (cc @simonjayhawkins)

sure