Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions static/highway.js
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@
} catch (e) {
hwState._rendererDrawFailures += 1;
console.error('renderer draw:', e);
// Self-heal: a plugin whose draw() throws every frame

Check warning on line 1501 in static/highway.js

View workflow job for this annotation

GitHub Actions / ci / lint

File has too many lines (4266). Maximum allowed is 1500
// would otherwise spam the console and leave the canvas
// blank indefinitely. After a short streak of failures,
// revert to the built-in renderer so the user at least
Expand Down Expand Up @@ -4240,6 +4240,21 @@
}
const highway = createHighway();
window.highway = highway; // expose for plugins

// THE FACTORY IS PART OF THE PUBLIC CONTRACT, and a classic script gave it to us for free.
//
// A top-level `function createHighway()` in a CLASSIC script implicitly becomes
// window.createHighway. In a MODULE it does not — module declarations are module-scoped, and
// the name would silently vanish from the global object the moment this file grew a
// type="module" attribute. The constitution names window.createHighway as public extension
// contract (alongside window.playSong / showScreen / feedBack), and plugins that render their
// own highway panel construct a second instance with it. Nothing in-tree calls it, which is
// exactly why this would have shipped: the only consumers are third-party, and I cannot grep
// those.
//
// So it is assigned explicitly now. Same object, same behaviour, no longer an accident of how
// the file happens to be loaded.
window.createHighway = createHighway;
highway.setOnLyricsChange(function(visible) {
const btn = document.getElementById('btn-lyrics');
if (btn) {
Expand Down
2 changes: 1 addition & 1 deletion static/v3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ <h3>Gameplay Settings</h3>
</main>
<!-- /#v3-main -->

<script defer src="/static/highway.js"></script>
<script type="module" src="/static/highway.js"></script>
<script defer src="/static/vendor/lottie.min.js"></script>
<script defer src="/static/lottie-api.js"></script>
<script type="module" src="/static/app.js"></script>
Expand Down
Loading