Current version of devtools backend is built with assumption that application is running in browser environment. It assumes global variable window and attaches DOM elements and events to document.
This makes it difficult to use devtools in with NativeScript and other environments rendering Vue applications.
Problems:
window (window is not defined)document is not defined)As a quick hack I replaced window with global, toast with nativescript-toast, socket.io-client with nativescript-socket.io, dropped highlight element, removed instance scan (explicitly set rootInstances).
But we need to structure the backend API for a stable solution. I feel dependence on globals like window and global makes backend very brittle. May be we can move such dependencies in one place and have a concrete well defined backend API where things like showToast or highlightElement or SocketClient can be overridden.
/cc @yyx990803 @Akryum @michalsnik
Most helpful comment
As a quick hack I replaced
windowwithglobal, toast withnativescript-toast,socket.io-clientwithnativescript-socket.io, dropped highlight element, removed instance scan (explicitly setrootInstances).But we need to structure the backend API for a stable solution. I feel dependence on globals like
windowandglobalmakes backend very brittle. May be we can move such dependencies in one place and have a concrete well defined backend API where things like showToast or highlightElement or SocketClient can be overridden./cc @yyx990803 @Akryum @michalsnik