Repository navigation
Description
Description
I'm developing a React implementation of components in vaadin/react-components. I use extensive generation based on web-types.json information which allowed me to spot some issues among components.
Non-public files
Several web-types.json files provide information about files that looks like not supposed to be public. Here they are:
@vaadin\charts\src\vaadin-chart-series.js@vaadin\upload\src\vaadin-upload-file.js@vaadin\crud\src\vaadin-crud-edit.js@vaadin\crud\src\vaadin-crud-edit-column.js
Some of them don't have d.ts files so if I import them in generated file, TypeScript compiler starts to complain about it.
Broken event map
To support all events in React correctly, I use the information about events stored in web-types.json. However, time to time events are missing in TypeScript declaration.
AccordionPanel. This component doesn't provide an event map completely.AppLayout.close-overlay-drawer
Checkboxvalue-changed
ComboBoxvaadin-combo-box-dropdown-closedvaadin-combo-box-dropdown-opened
ComboBoxLightvaadin-combo-box-dropdown-closedvaadin-combo-box-dropdown-opened
Gridsize-changeddata-provider-changed
GridProsize-changeddata-provider-changedenter-next-row-changedsingle-cell-edit-changed
GridProEditColumneditor-type-changed
LoginFormaction-changeddisabled-changederror-changedno-forgot-password-changedi18n-changed
LoginOverlaydescription-changedaction-changeddisabled-changederror-changedno-forgot-password-changedi18n-changed
RadioButtonvalue-changed
Typings errors and lack of similarity
Working with many components, I found that some of them have types different from others. It could probably be an issue.
@vaadin/notification.
Specifies renderer in the following way
type NotificationRenderer = (root: HTMLElement, notification?: Notification) => void;Looks like a bug because Lit implementation doesn't care about nullability of notification:
export type NotificationLitRenderer = (notification: Notification) => TemplateResult;Among component properties, the renderer is specified in the following way:
type NotificationProps = {
renderer: NotificationRenderer | undefined;
}However, for @vaadin/grid all renderers are specified as Renderer | null | undefined.
@vaadin/grid
Specifies the renderer in the following way:
export type GridRowDetailsRenderer<TItem> = (
root: HTMLElement,
grid?: Grid<TItem>,
model?: GridItemModel<TItem>,
) => void;Again, the nullability for grid and model seem to be a mistake because Lit doesn't consider it.
@vaadin/virtual-list
As in @vaadin/notification, the renderer prop misses null as an acceptable value.
type VirtualListProps = {
renderer: VirtualListRenderer | undefined;
}@vaadin/context-menu
As in @vaadin/grid, it has nullable model and element in renderer.
export type ContextMenuRenderer = (
root: HTMLElement,
contextMenu?: ContextMenu,
context?: ContextMenuRendererContext,
) => void;@vaadin/dialog
As in @vaadin/grid, it has nullable element in renderer.
export type DialogRenderer = (root: HTMLElement, dialog?: Dialog) => void;Public components that are declared as private
@vaadin/chart
This component uses the library which has an imperative interface to update the series etc. So for make it declarative, there is a ChartSeries component. However, it doesn't have a place in the package's root, so the algorithm ignores it because considers it private. Could we put it to the root to make sure it is public?
Expected outcome
(see description)
Minimal reproducible example
(see description)
Steps to reproduce
(see description)
Environment
Vaadin version(s): 23.3.0-alpha3
OS: Windows
Browsers
Issue is not browser related
Activity
web-padawan commentedon Nov 3, 2022
Thanks for the issue. I can say that at least some properties using
notify: truewhere this shouldn't be needed.Will go through the list tomorrow and submit some PRs for individual components to add / fix event maps.
web-padawan commentedon Nov 7, 2022
The following issues have been resolved and released in v23.3.0-alpha5:
Also, fixed event types for
LoginFormandLoginOverlay: either added, or removednotify: truewhere not needed.web-padawan commentedon Nov 7, 2022
Here are some things that I would consider "won't fix":
This event is not fired on the component itself, but on the
windowobject.And it can be considered internal, as users are not supposed to listen to it.
These events are internal, and actually we might want to deprecate them.
This property is there by mistake: the
valueis not supposed to be changed in both components.We could consider removing
notify: truefrom theInputMixinand moving it to other mixin.yuriy-fix commentedon Nov 8, 2022
Let's keep it in triage to follow the progress and check if we need extra actions.
Lodin commentedon Nov 8, 2022
Thanks!
I have just checked the changes. There are still some issues left:
Typings errors and lack of similarity
@vaadin/selectIt looks like I forgot to include it to the issue.
As in
@vaadin/notification, the renderer definition accepts anundefinedoriginal element.Broken event map
There are still some components that are not declared as "won't fix" but still lacks event maps:
CrudEdit(this one appeared in recent updates)editGridsize-changeddata-provider-changedGridProsize-changeddata-provider-changedenter-next-row-changedsingle-cell-edit-changedGridProEditColumneditor-type-changedplatosha commentedon Nov 16, 2022
One more typing issue:
MultiSelectListMixinTypeScript declaration does not list types fromMultiSelectListMixinClass. As a result,ListBoxclass does not specify themultipleproperty.web-padawan commentedon Dec 30, 2022
Most of these issues have been fixed. I'll check the remaining issues related to events, as well as some other TS inconsistencies later, and maybe create a new issue later on as a follow-up.
cromoteca commentedon Mar 21, 2023
@web-padawan while documenting React components for Hilla, I found some properties that are reported as missing, yet they are used in the examples. How can I ask for them to be added? Should I list here, open another issue, or an issue for each?
platosha commentedon Apr 18, 2023
Found one more event definition missing:
@vaadin/multi-select-combo-boxopened-changedinMultiSelectComboBoxEventMapweb-padawan commentedon Mar 7, 2025
Issues reported above have been fixed. Closing this issue, please create a new one if there are some more missing properties.