Skip to content

Migrate component styling to registerStyles for Vaadin 25 compatibility#7

Merged
javier-godoy merged 3 commits into
masterfrom
issue-21
Feb 13, 2026
Merged

Migrate component styling to registerStyles for Vaadin 25 compatibility#7
javier-godoy merged 3 commits into
masterfrom
issue-21

Conversation

@paodb

@paodb paodb commented Feb 12, 2026

Copy link
Copy Markdown
Member

This upgrade is needed to fix FlowingCode/WhatsappButton#21

As the upgrade is done in order to be able to support also Vaadin 25, the version was updated to 2.1.0.

Summary by CodeRabbit

  • Chores
    • Bumped package version to 2.1.0
    • Updated copyright headers

@paodb paodb requested a review from javier-godoy February 12, 2026 20:16
@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown

Walkthrough

This update bumps the package version to 2.1.0 and refactors the fc-custom-button component to adopt Vaadin's themable mixin for styling instead of Polymer template-based styles. Manifest entries are pruned, and copyright years are updated across relevant files.

Changes

Cohort / File(s) Summary
Manifest & Version Updates
custom-elements.json, package.json
Removed static template field from FcCustomButton and pruned non-source coverage modules from manifest exports. Version bumped to 2.1.0.
Component Styling Refactor
src/fc-custom-button.js
Replaced Polymer html-based template styling with Vaadin registerStyles and css imports; removed in-class template definitions. Copyright year updated to 2026.
Metadata Updates
src/fc-whatsapp-button.ts
Copyright year updated from 2022-2024 to 2022-2026.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: migrating component styling to registerStyles for Vaadin 25 compatibility, which is clearly reflected in the src/fc-custom-button.js refactoring.
Linked Issues check ✅ Passed The PR addresses issue #21 by refactoring component styling to use registerStyles (replacing Polymer html template-based styling) and updating to version 2.1.0, directly resolving the Vaadin 25 style compatibility issues reported.
Out of Scope Changes check ✅ Passed All changes align with the stated objective: styling migration (src/fc-custom-button.js), version bump (package.json), copyright updates, and custom-elements.json manifest cleanup are all related to the Vaadin 25 compatibility effort.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-21

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

34-41: ⚠️ Potential issue | 🟠 Major

Update @vaadin/ dependencies from 24.x to 25.x* for Vaadin 25 compatibility.

All @vaadin/* packages are pinned to ^24.4.0, but Vaadin 25 uses 25.x versions (e.g., @vaadin/button@25.0.4). Update the following dependencies in lines 35-39:

  • @vaadin/button: ^24.4.0^25.0.0
  • @vaadin/dialog: ^24.4.0^25.0.0
  • @vaadin/icon: ^24.4.0^25.0.0
  • @vaadin/progress-bar: ^24.4.0^25.0.0
  • @vaadin/vaadin-themable-mixin: ^24.4.0^25.0.0
🧹 Nitpick comments (1)
src/fc-custom-button.js (1)

23-37: Consider whether the :host([part='custom-button']) selector is necessary.

The :host([part='custom-button']) selector on line 24 only matches when the part attribute is set on the host element. Since registerStyles already scopes these styles exclusively to fc-custom-button elements, a plain :host selector would suffice — unless you intend to have some fc-custom-button instances without part="custom-button" that should not receive these styles. If all instances should be styled, simplify to :host.

♻️ Suggested simplification
 registerStyles('fc-custom-button', css`
-   :host([part='custom-button']) {
+   :host {
     border-radius: 6px;
     box-shadow: 0 4px 9px `#00000024`;

@javier-godoy javier-godoy merged commit c64dd61 into master Feb 13, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Feb 13, 2026
@paodb paodb moved this from Pending release to Done in Flowing Code Addons Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Vaadin 25: style issues

2 participants