The docs are not incorrect in that aspect. You just didn't follow the Event Handlers section.
Your bootstrap.php should actually look like this:
<?php
use Illuminate\Contracts\Events\Dispatcher;
use Flarum\Event\ConfigureClientView;
return function (Dispatcher $events) {
$events->listen(ConfigureClientView::class, function (ConfigureClientView $event) {
if ($event->isForum()) {
$event->addAssets(__DIR__.'/js/forum/dist/extension.js');
$event->addBootstrapper('johnsmith/flarum-ext-myapp/main');
}
});
};