wallabyjs / console-ninja

Repository for Console Ninja questions and issues
https://console-ninja.com
Other
385 stars 22 forks source link

[Feature]: Qwik Support #93

Closed snips-dev closed 1 year ago

snips-dev commented 1 year ago

Describe the feature you'd like.

Should be great having a Qwik framework support.

smcenlly commented 1 year ago

Just want to confirm, I assume you're referring to: https://qwik.builder.io?

EamonHeffernan commented 1 year ago

Just want to confirm, I assume you're referring to: https://qwik.builder.io?

I'd assume they are. Just to give some background on why it currently doesn't work, although Qwik uses Vite, Qwik requires all functions that are called within "QRL" scopes to be exported. This is so that Qwik can access the function in order to split the code into smaller chunks. The error that shows up when trying to use console.log in Qwik is Reference to identifier declared at the root 'oo_oo'. It needs to be exported in order to be used inside a Qrl($) scope.

EamonHeffernan commented 1 year ago

Doing something like this works, however the logs show up on the line in this function, as would be expected.

export const log = (message?: any, ...optionalParams: any[]) => {
    console.log(message, ...optionalParams);
};
EamonHeffernan commented 1 year ago

Doing something like this works, however the logs show up on the line in this function, as would be expected.

export const log = (message?: any, ...optionalParams: any[]) => {
  console.log(message, ...optionalParams);
};

I've managed to get it working as would be expected by replacing function oo_oo with export function oo_oo in the output from console-ninja

EamonHeffernan commented 1 year ago

@smcenlly Hi, I just wanted to draw your attention to this issue if you had not seen it.

smcenlly commented 1 year ago

Thanks for letting us know how you go it working.

Console Ninja v0.0.75+ now supports Qwik framework.