  The atmospheres of small, close-in exoplanets are vulnerable to rapid
mass-loss during protoplanetary disc dispersal via a process referred to as
`boil-off', in which confining pressure from the local gas disc reduces,
inducing atmospheric loss and contraction. We construct self-consistent models
of planet evolution during gaseous core accretion and boil-off. As the
surrounding disc gas dissipates, we find that planets lose mass via subsonic
breeze outflows which allow causal contact to exist between disc and planet.
Planets initially accrete of order $\sim 10\%$ in atmospheric mass, however,
boil-off can remove $\gtrsim 90\%$ of this mass during disc dispersal. We show
that a planet's final atmospheric mass fraction is strongly dictated by the
ratio of cooling timescale to disc dispersal timescale, as well as the planet's
core mass and equilibrium temperature. With contributions from core cooling and
radioactivity, we show that core luminosity eventually leads to the transition
from boil-off to core-powered mass-loss. We find that smaller mass planets
closest to their host star may have their atmospheres completely stripped
through a combination of boil-off and core-powered mass-loss during disc
dispersal, implying the existence of a population-level radius gap emerging as
the disc disperses. We additionally consider the transition from
boil-off/core-powered mass-loss to X-ray/EUV (XUV) photoevaporation by
considering the penetration of stellar XUV photons below the planet's sonic
surface. Finally, we show that planets may open gaps in their protoplanetary
discs during the late stages of boil-off, which may enhance mass-loss rates.
