Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PROPOSAL]: Re-write with native TypeScript support #112

michealroberts started this conversation in Ideas
Discussion options

Firstly, looks like an awesome library. Some of the visualizations on the website are amazing. 🚀 Props to you @graphieros


However, the dist bundled types are awkward to work with. They seem to be correct, however, not being able to, e.g.,:

import { type Config, VueUiXy } from "vue-data-ui";

Is leading to some tense situations with the TS language tools and compiler, e.g.: I've copied the base graph example from the builder here: https://vue-data-ui.graphieros.com/chart-builder

However, the types are awkward to derive:

Screenshot 2024年10月23日 at 17 07 21

So, it leaves me in a quandry. Use a second rate library with first class TypeScript support, e.g., @unovis, or request that we discuss migrating the codebase to use .ts rather than a declaration file which is awkward to maintain and prone to breaking between minor and patch versions.

I am more than happy to offer up my services to help do this, as well as reconfigure the build process to output .d.ts and .cjs/.mjs/.js files.

Let me know your thoughts ...

You must be logged in to vote

Replies: 8 comments

Comment options

Hey @michealroberts :)

Before I answer, have you tried importing the proper types for this use case ?

import { VueUiXy, type VueUiXyConfig, type VueUiXyDatasetItem } from "vue-data-ui" 
You must be logged in to vote
0 replies
Comment options

Yes, I have also tried the above ... but certain values from the documentation are missing:

Screenshot 2024年10月23日 at 17 30 22
You must be logged in to vote
0 replies
Comment options

Yeah, that attribute is missing from the type def.
I would need to recheck the whole .d.ts file

But without this kind of mishap wouldn't it be sufficient ?

You must be logged in to vote
0 replies
Comment options

Yeh it's an awesome library ... I just think these mishaps happen because of the lack of explicit types close to the code ... the minute you have to maintain something external to where something is, the more problematic it will become ...

You must be logged in to vote
0 replies
Comment options

I'm more than happy to dedicate a day to this effort ...

You must be logged in to vote
0 replies
Comment options

To check the .d.ts file, or to use lang="ts" on all components ? The latter is a massive undertaking

You must be logged in to vote
0 replies
Comment options

@michealroberts listen I'm gonna start by cleaning up the .d.ts. There are quite a bunch of mishaps.
Maybe we can talk about your proposal through a different medium ?

You must be logged in to vote
0 replies
Comment options

@michealroberts v2.3.37 was published, with major type cleanup.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
enhancement New feature or request typing TS type is wrong or badly formatted
Converted from issue

This discussion was converted from issue #89 on November 10, 2024 13:02.

AltStyle によって変換されたページ (->オリジナル) /