The D1 mini V4.0.0 may have removed the diode, but unfortunately it still conducts 5v to the VCC when plugged into USB. The issue with the d1 mini v3 was not the diode itself, that was just a simple way to break continuity from the USB, so it could only be powered by the battery...