-
Notifications
You must be signed in to change notification settings - Fork 87
feat: warn if using legacy Template API #2101
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
Conversation
| }; | ||
| }); | ||
|
|
||
| it('should remove template when added after renderer', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a no longer relevant test since we've made the template renderer responsible for throwing such exceptions.
I missed this test while removing the Template API as far as it successfully passes by the reason of another exception (notification._observer.flush() throws an exception as we don't have _observer defined anymore).
069eecc to
d6ce1cc
Compare
d6ce1cc to
793b80d
Compare
| import sinon from 'sinon'; | ||
| import { GridElement } from '@vaadin/vaadin-grid/src/vaadin-grid.js'; | ||
| import { GridColumnElement } from '@vaadin/vaadin-grid/src/vaadin-grid-column.js'; | ||
| import '@vaadin/vaadin-template-renderer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to import the template renderer here while removing the Template API as all the test cases in this file successfully pass regardless of a provided template (reason: tests don't actually use this template).
Missing has become noticeable since we are showing the warning:
packages/vaadin-grid-pro/test/grid-pro.test.js:
🚧 Browser logs:
WARNING: <template> inside <vaadin-grid-pro> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-column> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-pro> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-column> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-pro> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-column> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-pro> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
WARNING: <template> inside <vaadin-grid-column> is no longer supported. Import @vaadin/vaadin-template-renderer to enable compatibility (see https://vaad.in/template-renderer)
| </style> | ||
| <vaadin-combo-box-light | ||
| allow-custom-value="" | ||
| item-label-path="value" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| dir="ltr" | ||
| theme$="[[theme]]" | ||
| > | ||
| <template> [[item.label]] </template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This template is not necessary here as by default the combo-box already renders item.label without any templates. As far as this template is not actually used, it can be removed.
|
Kudos, SonarCloud Quality Gate passed!
|
Description
Since the Template API has been removed, we need to warn the user to import
@vaadin/vaadin-template-rendererif he attempts to use templates inside a component that previously supported the API.Fixes #312, #1970.
Type of change
Checklist
Additional for
Featuretype of change