Diffraction and the HUP are related because they have the same mathematical description.
The Fourier transform to the canonical commutation relationship and the Heisenberg uncertainty principle. The FT is the unitary (norm and inner product preserving, i.e. probability-preserving) transformation between position co-ordinates and momentum co-ordinates, and it can be shown that, given any pair of quantum observables $\hat{X}$ and $\hat{P}$ that fulfill the canonical commutation relationship $X\,P-P\,X=i\,\hbar\,\mathrm{id}$, the transformation between co-ordinates wherein $\hat{X}$ and $\hat{P}$ are simple multiplication operators is precisely the Fourier transform. I show how this must be true in this answer here. This leads to the Heisenberg inequality through the pure mathematical properties of the FT as I discuss in this answer here and here. A special case observation that summarises the behaviour intuitively is that a function and its FT cannot both have compact support (domain wherein they are nonzero): if you confine a wavefunction (i.e. quantum state) to a small range of positions, its Fourier transform is the same quantum state written in momentum co-ordinates, so the spread over momentums increases as you confine the positions more and more.
The analogy with diffraction is direct. Huygens's principle, or whatever method you want to use to explain diffraction is explained in detail in my answer here, this one here, this one here, or here. But a summary is this. A plane wave running orthogonal to a plane means that the phase on that plane is uniform. AS the wave tilts, its phase variation on the plane is of the form $\exp(i\,\vec{k}\,\cdot\,\vec{x})$, where $\vec{k}$ is the wavevector and $\vec{x}$ the transverse position on the plane. So, to find out what spread of directions you have in a light wave, you take its Fourier transform over the plane. The Fourier transform at point $k_x,\,k_y$ is simply the superposition weight of the plane wave component with direction defined by $k_x,\,k_y$. The more spread out in Fourier space a wave is, the wider the spread of propagation directions are important, and the more swiftly it will diffract. So a wavelength size pinhole in a screen means that the spread of directions will be wide, simply by dent of the Fourier transform uncertainty product. Indeed, for small diffraction angles, $\sqrt{k_x^2+k_y^2}/k \approx \theta$, where $\theta$ is the angle the plane wave component makes with the normal to the plane. Indeed the basic uncertainty product for FTs shows that $\Delta x\,\Delta k_x = \Delta x\,\Delta \theta\,k \geq \frac{1}{2}$ where $\Delta x$ is the slit width and $\Delta \theta $ the angular spread of diffracted light.
Strictly speking, the physics of diffraction cannot be explained as the HUP (i.e. as arising from the canonical commutation relationships) because there is no position observable $\hat{X}$ for the photon, so you can't think of $\Delta\,x\,\Delta p$. There are most certainly pairs of canonically commuting observables: for example the same components of the electric field and magnetic field observable for the second quantised electromagnetic field are conjugate observables. The reason HUP descriptions work is the mathematical analogy I have described above.