Repository navigation
DO NOT MERGE: first experimental prototype of Lit based versions - #5301
web-padawan wants to merge 3 commits into
Conversation
d89d288 to
18a0fc3
Compare
| import { buttonStyles } from './vaadin-button-styles.js'; | ||
|
|
||
| /** | ||
| * LitElement based version of `<vaadin-button>` web component. |
There was a problem hiding this comment.
Not source code related, but wanted to create discussion without endless comments within the main PR about one topic.
Something to consider from an outsiders perspective: As far as I understand the codebase and communication to the community, all usage of Lit element instead of polymer is a internal detail thanks to the removal of the public API, allowing to gradually do this within minor releases(?). Otherwise it could literally take years to get this on the road, looking at the public available comments that with the new and simplified release model of the platform the amount of major releases should be reduced. Vaadin 24 had to be pushed because of external factors like the Jakarta Namespace and Spring Boot / ecosystem end of life. I (hopefully) don't see any other big problem in the next 1 or even 2 years justifying another major release - which in turn would move this change (if it has to be done within a major release) to like 2024/2025.. leaving us/you with three options:
- pushing at least some components to lit in 24 to get early Feedback like components as button, layouts and non-complex stuff and gradually move the others afterwards in minors to come (with the experience you get from Feedback of 24.0's components)
- doing all of this within minor versions of 24.x
- Having this transformation wait for the next big release (25.0) with no definitive timeline
With the official removal / payed support of PolymerTemplate in flow for 24.0 - I think it would be the perfect timing to get this done / on the road.
There was a problem hiding this comment.
What knoobie said.
And also, what and where and who can I pay to increase velocity on this?
I've already talked to my team JS wizard @anoblet about contributing some of our time here, but we could find more budget.
There was a problem hiding this comment.
Thanks for your opinions! This is exactly the kind of discussion that I'd like to have.
all usage of Lit element instead of polymer is a internal detail thanks to the removal of the public API, allowing to gradually do this within minor releases(?). Otherwise it could literally take years to get this on the road
Yes, this is what the original plan was back in the day, described in the blog post from 2019 that I linked above.
I totally agree that from Java / Flow developer's point of view, these changes are purely internal refactorings.
However, we also need to consider Hilla and web components users who build their applications with Lit.
As now when we have React wrappers, not breaking them is also something that we have to consider.
Essentially, changing the library used under the hood is a behavior altering change, because of switching from sync DOM rendering / updates (Polymer) to async (Lit) - see my additions of await nextFrame() in unit tests.
Overall, I feel like this change is long overdue. We definitely shouldn't postpone it till 2024 or further.
303e794 to
f7b4649
Compare
17c3b92 to
9798001
Compare
|
Are these drop-in compatible with their Polymer cousins? Testable in current Vaadin 23 or 24-based Storybooks and apps? |
The idea is to achieve it where possible. As discussed with @vursen we might even want to implement some mechanism for Polymer-style sync rendering, even if that would mean extra complexity. However, there is no decision on this yet. |
b851d0b to
6b0fd8c
Compare
d522fd5 to
e332871
Compare
|
I saw merges into 24.0 branch? Some kind of official experimentation strategy got decided? |
We agreed to proceed with necessary refactorings, like extracting reusable mixins, template and CSS literals. On top of that, I'll be spending 10% of time on Lit conversion (every second Friday starting from today). Please note, we still have no ETA on when the full Lit conversion will be actually delivered by the team. There's a chance that this will be mostly done during the summer, so my target is Q3-Q4 this year. |
Sounds awesome. Accordion and Context Menu I think would enable us 100% Lit! |
How would I go about testing this on my package - does this PR #5301 branch |
|
@lkraav No, this PR is going to be closed after all the prototypes are merged. It was just a discussion opener. From now on, all the experiments will be merged to the |
e332871 to
47526c3
Compare
Aha, looking closer at one of the merged PRs, it looks like they will co-exist for however long, and I will need to specifically import the Lit version. I'm a bit unclear on how I replace my |
47526c3 to
dada928
Compare
|
SonarCloud Quality Gate failed.
|
|
Closing this PR as stale. We have added a bunch of Lit based component versions (still not published to npm for now). |








Description
TL;DR: this is not our first step towards moving to Lit - but now it's an attempt to get it done.
Type of change
Background
There has been a discussion on Vaadin Discord server recently about our plans to remove Polymer in 2023.
This is a very long-lasting idea that I've been trying to pursue since 2018 - which is almost 5 years now:
lit-componentsproject using 0.x in May 2018;component-mixinsresearch project - most of its code is now incorporated to this repo;rendererfunction;PolylitMixin- first, as as personal project. Later we moved it to this repo and improved logic;ThemableMixin,DirMixinand other mixins / controllers;lit-htmlusage tovaadin-upload,vaadin-avatar-groupandvaadin-message-list.That said, we still don't have any web component that
extends LitElementand people are disappointed about it.This PR proposes one possible solution for moving forward with Lit support without exposing it publicly (yet).
Proposal
ButtonMixin,ItemMixin,ProgressMixinetc.<style>tag inside the template to acsstagged literal from thelitpackage;src/vaadin-lit-button.jsusing the samevaadin-buttontag name;src/vaadin-lit-button.jsfrom"files"inpackage.jsonto NOT publish them to npm.Components
Currently, this PR covers the following web components as an illustration of the suggested approach:
vaadin-detailsvaadin-itemvaadin-radio-buttonI'm planning to gradually update this PR with adding more simple components, and rebase as necessary.
This is going to be my main focus for "Community Friday" at Vaadin (every two weeks including today).
Some complex components are not supposed to be covered by this PR:
vaadin-date-pickeris only partially converted to Lit - see the WIP branch with two updated components;vaadin-grid,vaadin-grid-proandvaadin-crudwere converted by @tomivirkki in this branch.Next Steps
We are going to have a meeting to clarify our plans related to web components Lit conversion in early February.
So we'll discuss this within a team and decide what to do next. Then we will hopefully share more updates.
10.02 Update
The following experiments have been merged to
mainand24.0branches and this PR is now updated: