Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform.is.electron and other properties are undefined #17482

Closed
FKPSC opened this issue Sep 4, 2024 · 3 comments
Closed

Platform.is.electron and other properties are undefined #17482

FKPSC opened this issue Sep 4, 2024 · 3 comments

Comments

@FKPSC
Copy link

FKPSC commented Sep 4, 2024

What happened?

Platform.is.electron returns undefined

same for other properties of is such as Platform.is.kindle

this also applies for $q.platform.is.*

What did you expect to happen?

platform.is.electron to return true or false as advertised by the documentation:

same for other properties of is such as Platform.is.kindle

this also applies for $q.platform.is.*

https://quasar.dev/options/platform-detection#properties

Reproduction URL

https://jsfiddle.net/pt49kcgn/2/

How to reproduce?

  1. Open provided URL
  2. Notice undefined value

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

No response

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@FKPSC FKPSC added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Sep 4, 2024
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Sep 4, 2024
@yusufkandemir
Copy link
Member

As can be seen in the docs here, it would return the relevant properties, not all:
https://quasar.dev/options/platform-detection#usage
image

So, it's natural for Platform.is.electron to be undefined if the app not running on Electron.

Our TypeScript types also reflect this:
image

platform.is.electron to return true or false as advertised by the documentation

The docs don't explicitly say it's true or false. But, I guess you deduce it from the type column mentioning Boolean. So, I am converting this issue to clarify the docs.

@FKPSC
Copy link
Author

FKPSC commented Sep 11, 2024

Right, only nativeMobileWrapper is explicitely mentioned to be potentially undefined
image

If those booleans were initialized as false they would all be present, directly usable and with more simplified typing. That note in the docs could also be removed.

This would be a slight improvement, right?

rstoenescu added a commit that referenced this issue Sep 17, 2024
@rstoenescu
Copy link
Member

Hi,

We were previously not embedding all "false" valued props for a lower js footprint. The one prop (nativeMobileWrapper) was explicitly specified as being "undefined" because it was the only one that is a String, as opposed to all other ones being a Boolean.
However, for consistency, we'll be embedding all Boolean props now (even the ones which should be "false". This will be available in Quasar v2.17+

rstoenescu added a commit that referenced this issue Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants