vaadin / vaadin/framework

Allow specify custom theme version to solve browser cache issues

Open
#11,242 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

When modifying custom themes between app releases, browser cache prevent loading the latest version which could mess a lot the vaadin app.
Same thing for widgetset generated JS if the app embed modified custom widgets.
To solve this we should be able to programmatically setup application version and/or theme version so that vaadinBootstrap.js tells the browser to download the latest versions.

For example for theme:
You could replace line 233 in vaadinBootstrap.js:

loadTheme(themeUri, versionInfo && versionInfo['vaadinVersion']);

with

if (versionInfo && versionInfo['themeVersion'])
    loadTheme(themeUri, versionInfo['themeVersion']);
else
    loadTheme(themeUri, versionInfo && versionInfo['vaadinVersion']);

And allow to programmatically set themeVersion somewhere (SystemVersionsProvider like SystemMessagesProvider ?)

For widgetset we could use applicationVersion within versionInfo object.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with vaadinBootstrap.js around the loadTheme call and trace how the versionInfo object is produced. Then inspect SystemVersionsProvider and SystemMessagesProvider for the proposed configuration pattern; done means custom theme and application/widgetset versions can be supplied and used for cache-busting.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.