Changes since 23.0.4
Breaking changes
-
Avoid duplicated field bindings
Commit · Pull request · IssueIf custom binding is added or completed after the call to Binder.bindInstanceFields the field is bound twice and this may lead to potential multiple application of converters, producing wrong representation and value for the field. This change ignores incomplete bindings during
bindInstanceFields()
process and overwrites existing bindings whenBinding.bind()
is invoked afterbindInstanceFields()
.
New features
-
Add experimental flag for the spreadsheet component
Commit · Pull request -
Clarify "Access denied" message when the view is implicitly treated as @Denyall
Commit · Pull request -
Automatically use available converters in Binder
Commit · Pull requestWhen binding a field and a property which do not have the same value type an exception is thrown. With this change, an attempt is made to automatically pick a suitable converter from the ones provided by the framework. Closes #12881
-
Enable usage of pnpm >5
Commit · Pull requestAllow usage of pnpm 6 by then generating
.pnpmfile.cjs
instead ofpnpmfile.js
Closes #12953 -
Add scrollIntoView method to Component
Commit · Pull requestAdds back a scrollIntoView method that we had in past framework versions. The implementation is a trivial shorthand to the similarly named DOM method, and very handy in UI development.
-
Add Vite support for exported web components
Commit · Pull request · IssueThis PR adds Vite support for exported web components making it possible to build and run them with Vite in development and production modes. A brief overview of the differences between Webpack and Vite implementations: Webpack: When there is any component marked as exported, in addition to
bundle-***.js
, Webpack will build anexport-***.js
chunk that containsgenerated-flow-imports
. The Flow client will be generated by Flow as a separate script. Once an exported web component is requested,WebComponentBootstrapHandler
is the one that is in charge of generating a bootstrap script to initialize this web component. The current Webpack implementation ofWebComponentBootstrapHandler
is based onBootstrapHandler
. It dynamically builds an HTML bootstrap document injecting all the scripts required for the exported web component to work to the document's head. There is where it will inject the Flow client as a separate script and theexport-***.js
chunk, getting it from the chunk stats file. Eventually, the handler serializes the head of the resulting HTML document into a set of javascript instructions and sends them to the browser as a result. Vite: When there is any component marked as exported, Vite will buildvaadin-web-component.ts
and inject it toweb-component.html
. It is worth noting thatvaadin-web-component.ts
includes bothgenerated-flow-imports
and the Flow client. For Vite, theWebComponentBootstrapHandler
logic was modified such that it instead takesweb-component.html
as an initial bootstrap document. The bootstrap document already contains the actual link tovaadin-web-component.ts
which is injected by Vite. All the other scripts required for the exported web component to work, such as the@Push
annotation script, the handler injects dynamically. An advantage of this approach is that it doesn't require any chunk stats so that it works pretty much the same way asIndexHtmlRequestHandler
. Eventually, the handler serializes the head of the resulting HTML document into a set of javascript instructions and sends them to the browser as a result. -
Add an offline property to the PWA annotation
Commit · Pull requestThe offline property allows you to disable creation and use of a service worker. By default, the property is true so everything works as before.
Fixes
-
Always register EndpointController
Commit · Pull requestThis allows the controller to return 404 when no endpoints are registered instead of letting the index html handler return an HTML page
-
Upgrade Vite to v2.9.1
Commit · Pull request · Issue -
Enable skipLibCheck in the default TS config
Commit · Pull request -
Make the Vite config respect PWA offline property
Commit · Pull request