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

Add readonly type to renderers prop in JsonForms.vue #1860

Merged

Conversation

rokiyama
Copy link
Contributor

Fix #1859

This PR adds the readonly type to renderers props in JsonForms.vue.

According to the README of jsonforms/vue, renderers may be the value of Object.freeze. So it might be better that renderers also accept readonly types.

@CLAassistant
Copy link

CLAassistant commented Dec 23, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rokiyama, thank you very much for the contribution! ❤️

Your PR solves the issue for the renderers but it would be even nicer if it could be solved for the remaining registries too.

I would like to suggest introducing a MaybeReadonly type, e.g.

type MaybeReadonly<T> = T | Readonly<T>;

and using that for the props renderers, cells and uischemas

@coveralls
Copy link

Coverage Status

Coverage remained the same at 84.242% when pulling 5b98584 on rokiyama:fix-renderers-type-error-in-vue into 075bbc4 on eclipsesource:master.

@rokiyama
Copy link
Contributor Author

rokiyama commented Feb 8, 2022

@sdirix Sorry for my late reply. I read your commit 5b98584 , it would help me if this change is merged.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and fixed the type issue when using the Volar VS Code extension

@sdirix sdirix merged commit 1703de6 into eclipsesource:master Apr 7, 2022
@rokiyama rokiyama deleted the fix-renderers-type-error-in-vue branch April 8, 2022 01:29
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

Successfully merging this pull request may close these issues.

TypeScript error in jsonforms/vue: renderers cannot be assigned to 'JsonFormsRendererRegistryEntry[]'
4 participants