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

Data type normalization (long-term effort) #86

Open
Tracked by #68
pklaschka opened this issue Oct 18, 2022 · 3 comments
Open
Tracked by #68

Data type normalization (long-term effort) #86

pklaschka opened this issue Oct 18, 2022 · 3 comments

Comments

@pklaschka
Copy link
Contributor

pklaschka commented Oct 18, 2022

Currently, the UXP JS API references don't follow a standard when it comes to declaring data types. A few examples of various ways things are notated in the docs (and, "as the root", the corresponding JS type):

  • number
    • int
    • integer
    • number
    • Number
    • Integer
  • string
    • string
    • String
  • Promise<void>
    • (no type specified at all, "in lieu of" void)
    • Promise
    • void

While this will be a big effort to fix, it currently

  • can cause a lot of confusion ("Is there a difference between these?")
  • disallows for any automated processing (e.g., to generate TypeScript definitions from it)
  • makes the documentation seem much less consistent (and thus, subjectively, harder to work with)
@padmkris123
Copy link
Collaborator

Adding my observations here for inconsistent data types:

  • Boolean, bool, boolean
  • Array array
  • ** any
  • *Object object

Other:

  • Nested angular brackets such as Promise<Array> should be changed to Promise<string[]>.

@pklaschka
Copy link
Contributor Author

@pklaschka pklaschka mentioned this issue Dec 13, 2022
10 tasks
padmkris123 pushed a commit that referenced this issue Dec 15, 2022
padmkris123 added a commit that referenced this issue Dec 20, 2022
* new doc fixes

* updating versions md

* New API: window.Path

* Fixing product name

* Bumping package version number

* removing TODO

* removing extra uxp

* Manually fixing issue #86

* Typos

* Reverting changes

* Addressing issue #86 and adding Object details

* Add more description to Path.md

* review comment - fixing space

* Addressing review comments

Co-authored-by: Padma Krishnamoorthy <[email protected]>
Co-authored-by: Padma Krishnamoorthy <[email protected]>
@pklaschka
Copy link
Contributor Author

Internal note: This now has a page on the internal wiki with best practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants