dxos-deprecated / sdk

DXOS SDK and tools.
GNU Affero General Public License v3.0
0 stars 2 forks source link

feat: Expose the app's debug object to devtools #476

Closed dboreham closed 3 years ago

dboreham commented 3 years ago

@Marik-D can you take a look and let me know how I can do this properly in TS? I'd like to just pass a reference to the return value from require('debug') in the debug property on __DXOS__. In JS this just works if you import debug from 'debug' then add that debug variable to the object. TS allows that code, but compiles it to debug.default, which isn't what I want. For now I'm, explicitly grabbing the enable and disable exported functions that I'm calling, but I'd like to simply expose the entire debug object with all its properties and methods. Thanks.

dmaretskyi commented 3 years ago

try doing

import * as debug from 'debug'

if this fails to grab the default export try

import * as debug, default as debugDefault from 'debug'
dboreham commented 3 years ago

Suggested import scheme works, fix committed.

rzadp commented 3 years ago

Continued in https://github.com/dxos/sdk/pull/490