If you compare the first revision of the ESP32 Development board to the current version you will see that the ESP32 module doesn’t extend past the edge of the printed circuit board as it did before. I extended the PCB and had the area under the antenna routed out. This serves two purposes. The ESP32 module is designed to have the antenna sit out in free space. The antenna is not supposed to sit on top of the PCB, the design guide by Espressif makes that very clear. The measurements that they did and documented show clearly that there is a significant loss in performance when the antenna sits on top of the PCB. The module’s PCB is much thinner than the standard 1.6mm PCB and they obviously designed the antenna for the thin pcb. User reviews of some of the other ESP32 boards on the market confirm that the ones where the module sits completely on top of the PCB have poor RF performance.
The second purpose of having the PCB extend all the way to the top of the module’s PCB is to allow me to manufacture the boards in a panel. If the module extends past the PCB then you can only place them next to each other in the panel. This leads to a long and narrow panel which bends in the reflow oven preventing the modules from sitting flush with the PCB. I ended up breaking the panels in half to get a less flexible panel. An additional benefit is that the thicker PCB protect the module’s PCB during shipping.