In development mode, the Vaadin client prints many messages to the console, but is quiet in production.
I want the same for my own javascript, and so far the thing I came up with is:
const w = (window as any)
const flowAppIds: Array<String> = w.Vaadin.Flow.getAppIds()
this.debug = flowAppIds.filter((id) => w.Vaadin.Flow.getApp(id).getConfig("debug") === true).length > 0
But it seems as if there should be a better way… is there any?
Ok, after looking a little more, I think, that variable should not be defined there. (a) this interface is not exported from components-base/custom_typings, and (b) there’s already a module that takes care of checking the devmode: @vaadin/vaadin-development-mode-detector. This module is the place wherewindow.Vaadin.developmentMode is set.