From 34dff14246e354ca7b78a061aec7bdb73fa80fe7 Mon Sep 17 00:00:00 2001 From: Eric Hwang Date: Tue, 30 Apr 2024 18:42:28 -0700 Subject: [PATCH] Use new AppForClient in derby@4 if present (#29) derby@4 moves client-only logic into a new AppForClient subclass, so the derby-webpack override of _views() needs to happen on the subclass. This falls back to using App for backwards compatibility. --- lib/browser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/browser.js b/lib/browser.js index 4784a98..17a13b4 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1,5 +1,7 @@ if (process.title === 'browser') { - const App = require('derby/App').App; + const AppModule = require('derby/App'); + // AppForClient introduced in derby@4 + const App = AppModule.AppForClient || AppModule.App; App.prototype._views = function () { const appName = this.name;