QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.47k stars 1.26k forks source link

[✨] Add the option to disable image dev tools #6450

Closed s-voloshynenko closed 3 weeks ago

s-voloshynenko commented 1 month ago

Is your feature request related to a problem?

  1. Not in all scenarios we can define a real width/height of the image. E.g. a dynamic list of logos with different proportions that are limited to a predefined height.
  2. Looks like the image dev tools can't fetch images correctly if they are restricted by basic auth. I was trying to override it by vite proxy config by adding basic auth configuration and it doesn't help.
  3. Add the option for developers to enable/disable dev tools plugins on their own. As an example - clickToSource.

As I can see, there have already been some talks about the ways on how to disable this plugin (discord and https://github.com/QwikDev/qwik/issues/5753).

Describe the solution you'd like

  1. Not sure if it's correct to disable this plugin by default just because someone is have the issues described in the first 2 points above. By default it should be enabled with the option to disable it, so we can make new qwik joiners pay attention to CLS issues from the start.
  2. Some resources can be restricted to public access. Here should be a way to bypass headers configuration.
  3. Despite the issues, as a dev tool - we should have an option to disable it via devTools vite config.

Describe alternatives you've considered

1st: as an alternative, we could specify in the template which images the plugin should ignore using special attributes to make the plugin mandatory. But here it won't work for every case, e.g. when we have a shared web component with no access to the codebase + we have to trim such attributes in prod build. 2nd: add the option to pass a regex in the devTools config, where you can specify the path to images that the plugin should ignore.

Additional context

PR https://github.com/QwikDev/qwik/pull/6427

s-voloshynenko commented 3 weeks ago

Sorry, looks like duplicate of https://github.com/QwikDev/qwik/issues/4773