-
Notifications
You must be signed in to change notification settings - Fork 94
Type export path is broken on vue 9.0.0-rc0 #6870
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
Comments
The problem is that it is not reexported in A workaround that might work for you: InstanceType<typeof NcButton>['$props']['variant'] |
If you actually mean ButtonHTMLAttributes['type'] It's a built-in type (lib/DOM). |
Or, if you need to use it for a component prop type, then import it from Vue: import type { ButtonHTMLAttributes } from 'vue' |
I think it is the same reason (9.0.0-rc.1): https://github.com/nextcloud/polls/actions/runs/15010629163/job/42178558520?pr=4015
I am not sure, if I understand the discussion right, is there no plan for a quick fix to be able to test the rc? |
@dartcafe Do you mean the same that was discussed here? |
Yes. But I did not expect you remove the enum exports. |
@dartcafe If there is a problem, could you explain it (in the context of the discussion in the PR)? |
Probably in this case @dartcafe its a problem because of the missing type import: - import NcButton, { ButtonVariant } from '@nextcloud/vue/components/NcButton'
+ import NcButton, { type ButtonVariant } from '@nextcloud/vue/components/NcButton' |
Isn't this issue about he missing type exports? What can I more describe than I did before? --> #6870 (comment) Importing of ButtonVariant isn't possible anymore since rc.0.
Unfortunately this does not work out of the box:
|
@dartcafe I don't understand what exact problem you are trying to solve. If you want to have IDE support with autocomplete and check for the NcButton's If you need a type of the variant to use it somewhere else, where you, for example, extend a button, or use NcButton's props in data — you can use If you want to import an object with all the possible variants (for example, to iterate over them) - this is not possible now. In your PR you said that you needed it for the list of possible values, but it is covered by IDE and TypeScript as was said in the PR. |
What problem: I assumed, this issue is about the broken type export and I assumed that this will be fixed, too. How was the journey:
And I sit here and wonder what happens.
I am searching for clarification. If you say, it won't come back: OK, I can live with it, although I prefer using the enums if available. But I do not want to change back and forth again. |
Yes, It will (there is a fixing PR). But could you clarify how you plan to use this type? What problem are you solving with the type?
Yes:
No
No
Yes |
I don't want to solve any problem with enum, I wanted to solve the problem of confusion. As I explained before:
And now I simply wanted to know, what the plan about this. I assumed it was removed unintentionally, but it was obviously not. But you answered my question: No more usage of the enums planned. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
If you are using TS and const { buttonVariant = 'primary' } = defineProps<{
buttonVariant?: ButtonVariant
}>()
`` |
This comment has been minimized.
This comment has been minimized.
I tested this now and it works if: import type { ButtonVariant } from '@nextcloud/vue/components/NcButton' it does not (as expected) by: import type { ButtonVariant } from '@nextcloud/vue' So the question / options:
I personally would say having types in the main entry point will maybe become a mess so we should only export from component module. But I am open for other opinions :) |
I wanted to import
ButtonType
cc @susnux @ShGKme
The text was updated successfully, but these errors were encountered: