Code Monkey home page Code Monkey logo

flow's Introduction

Join the discussion in Vaadin Flow Discord

Vaadin Flow

Vaadin Flow is the Java framework of Vaadin Platform for building modern websites that look great, perform well and make you and your users happy.

For instructions about developing web applications with Vaadin Flow, please refer to the documentation.

To contribute, first refer to Contribution Guide for general instructions and requirements for contributing code to Flow.

For issues related to Hilla, please refer to the https://github.com/vaadin/hilla repository.

Join Vaadin Flow community chat in https://discord.gg/MYFq5RTbBn

Since Vaadin platform 23.0, Flow major and minor versions are aligned with platform versions:

Branch Platform Version Flow Version
1.0 10 (LTS) 1.0
2.10 14.11.x (LTS) 2.10.x
23.4 23.4 (LATEST free with Java 11+ support and Servlet 3) 23.4
23.5 23.5 (LATEST commercial with Java 11+ support and Servlet 3) 23.5
24.3 24.3 (LATEST release, Java 17+, Jakarta EE 10, Spring-boot 3) 24.3
24.4 24.4 (Vaadin 24.4 pre-release) 24.4
main 24.5 (Vaadin 24.5 preparations) 24.5

flow's People

Contributors

ahie avatar ansku avatar artur- avatar caalador avatar dependabot[bot] avatar emarc avatar gilberto-torrezan avatar haijian-vaadin avatar jdahlstrom avatar johndevs avatar jojule avatar jouni avatar legioth avatar magi42 avatar manolo avatar marcinvaadin avatar mcollovati avatar mshabarov avatar mstahv avatar pekam avatar platosha avatar pleku avatar saulis avatar sissbruecker avatar someonetoignore avatar tepi avatar tltv avatar ujoni avatar zch avatar zhesun88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flow's Issues

@Bower annotation doesn't resolve html files that don't have folder's name

Example directory structure:
bower_components
----\iron-icons\
---------\iron-icons.html
---------\social-icons.html

@bower({"iron-icons"}) loads iron-icons.html fine, but any of the following don't work:

@bower({"social-icons"})
@bower({"iron-icons\social-icons"})
@bower({"iron-icons\social-icons.html"})

You can use
@html("/VAADIN/bower_components/iron-icons/social-icons.html")
to get around the problem so it's not a big issue.

Optimize Template.getElementById

Currently loops through the whole template. Should store ids while parsing the template to be able to provide them instantly.

Add support for delayed events

There are many cases where client side events are fired very often but you only want to send some of the events to the server, either with a delay or every Nth event or similar. The <trix-editor> demo is one example, where the editor itself sends change events for every keypress and you would want to delay them a bit before sending them to the server. The required feature is the same as TextField needs to implemented TextChangeListener

@TemplateEventHandler methods should be able to return (async) values

Currently, methods with the @TemplateEventHandler annotation will not return any value to the UI. Returning values should be possible asynchronically, using for example the following syntax:

Java:

@TemplateEventHandler
String getValue() {
  return "value";
}

Template html:

<button (click)="var promise = server.getValue(); promise.success(function(data) { console.log("ok response: " +data); } ).error(function(data, status) { console.log("error happened: " + status) }).finally(function(){ console.log("this always prints to the log")});"></button>

There could also be a different annotation for methods that return a promise.

Change JSON library

We should move away from Elemental JSON because

  • It's GWT and we don't want to profile ourselves as GWT dependent
  • The API is primarily made for client side usage which sometimes shine through
  • The server side classes are not serializable

Unable to use arrays in the model

To create grid like structures, it would be useful to be able to use e.g.

int[][] data

in the model and something like

<span *ng-for="#rowdata of data" class="row"> 
    <span *ng-for="#cell of rowdata" class="cell"> 
        // render something for the cell
    </span>
</span>

in the template

Enable single script linker

ClientEngineLinker / ClientEngine.gwt.xml is disabled because SelectionScriptLinker uses com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js, which in turn does document.write. This is not compatible with loading the script using defer

Fix hummingbird-client/pom.xml when resolved

error stack trace org.eclipse.jetty.io.EofException

Recently I seem to be getting this Jetty error in stdout (regardless of which demo project I run):
lokakuuta 20, 2015 11:36:29 AP. com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
org.eclipse.jetty.io.EofException

Everything seems to be working ok regardless.

Full stack trace in attachment
jetty-error.txt

script tags cause TemplateParser to fail

If there's a non-empty < script> tag in a template, TemplateParser will fail. The createTemplate method throws a RuntimeException; node type for scripts is org.jsoup.nodes.DataNode.

Show error to user if trying to bind to undefined model property

To help debugging, we should log an error if a template uses a binding to foo.bar but foo is not defined.

We can't do the same for bindings to just foo, since that's a valid case evaluating to false in a boolean context (e.g. <div [class.something]="foo">).

Support setting attribute/property/attributeOrProperty

The framework right now tries to guess whether an "attribute" (as it's called on the server) can be applied as an attribute or a property. Some names are hard coded and may or may not be correct.

There should be explicit support for

  • setAttributeOrProperty (default, can be used as attribute in pre-rendering and property later on)
  • setAttribute (always set/read as an attribute)
  • setProperty (always set/read as a property, not included in pre-rendering)

Sending can be done e.g. as

  • setAttribute("foo","bar") sent as
    • put "-foo","bar" (no property name can start with -)
  • setProperty("foo","bar") can be sent as
    • put " foo","bar" (no attribute name can start with +)
  • setPropertyOrAttribute("foo","bar") can be sent as
    • put "foo","bar" (like today)

Missing server method called in JS error message

When a server.foo() function is called in JS and a @TemplateEventHandler foo() method doesn't exist in the Template class, no error is recorded on server. Only "server.foo is not a function" in UI.

Optimize away "put + remove" for new properties

If a put("foo","bar") and remove("foo") during the same transaction, there is no way for the optimizer to know whether it can delete the remove("foo") change or not, as it does not know what the value of the property was before the put, or even if the property existed.

The following TransactionLogBuilderTest test should pass when this is implemented

    @Test
    public void addRemoveAddList() {
        List<Object> l = node.getMultiValued(LIST_KEY);
        l.add("bar");
        l.remove("bar");
        node.remove(LIST_KEY);
        l = node.getMultiValued(LIST_KEY);
        l.add("foo");
        commit();
        assertOptimizedChanges(new ListInsertChange(0,LIST_KEY,"foo"));
    }

Import reconnect dialog and system notifications theme

Reconnect dialog is a communication related feature which can demonstrate what you get for free with Hummingbird and not with a client side framework such as Angular. Currently the text displayed on top of the app in one corner is not very convincing

vaadin-grid and vaadin-charts with light DOM do not work in a template

You cannot use <vaadin-grid> or <vaadin-xyz-chart> together with a light DOM in a template. Both components will read and take into account the light DOM only when the element is upgraded, i.e. immediately when doing document.createElement("vaadin-grid"); (provided the HTML has been imported). As long as Template does createElement and then creates inner elements for it, the light DOM will be ignored. The only way I can think of to make this work would be to set the whole template contents as inner HTML to the root and then configure possibly remaining parts through JS

Private member Components in Template shouldn't always be initialized automatically

Currently it's not possible for a Template subclass to have a (private) member Component that does not have a corresponding element in the DOM during bindComponents. Having one causes the exception IllegalStateException("No component found to bind to field " + memberField.getName());. Sometimes it would be useful to have, for example, a member subtemplate that is initialized later after something happens in the UI. Automatic initialization is still a handy feature to have, but maybe it could only happen for non-private members or members with an @id annotation.

Nested lists cannot be used in the model

As a workaround for the missing array support, it would be useful to be able to use nested Lists in the model:

public List<List<Boolean>> getData();
public void setData(List<List<Boolean>> data);

Portlet support

@PreserveOnRefresh was removed. Portlet support is likely 100% broken because of this

Incompatible bower dependencies are hard to debug

The framework has no good way of notifying the user if the server-side implementation of a component is not compatible with the client-side version that the user has defined (or got transiently) through bower.

Grid event listeners

Event listeners don't work in Grid. For example, with
grid..addItemClickListener( event -> { System.out.println("Clicked");});
should print "Clicked" to the console when an item is clicked.

Support retrieving value from other elements for event

Checkbox is currently broken because the main element has been changed to a but the value change listener tries to include "element.checked" in the event. It really wants to include the input elements "checked" state, no matter if you click on the label or the input

Event data should not be sent for each element instance separately

Adding 10 buttons with click listeners on a page will send the following kind of update to the client side, for each button separately

{
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 0,
                   "value": "event.button"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 1,
                   "value": "event.clientX"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 2,
                   "value": "event.clientY"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 3,
                   "value": "event.type"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 4,
                   "value": "event.altKey"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 5,
                   "value": "event.metaKey"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 6,
                   "value": "event.ctrlKey"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 7,
                   "value": "event.shiftKey"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 8,
                   "value": "event.relativeX"
               },
               {
                   "id": 6,
                   "type": "listInsert",
                   "key": "click",
                   "index": 9,
                   "value": "event.relativeY"
               },

Verify that @JavaScriptModule interface matches what the script exports

We could evaluate the module script on the server the first time it is accessed and see what it exports to the module variable. This requires that the script doesn't do any static initialization that isn't compatible with Nashorn. The exported methods would still not be run on the server, so they could still contain anything as longs as it's syntactically correct.

Support binding template elements to components

It should be possible to have a template with

<vaadin-grid id="myGrid" />

and in the Java file for the template do

private Grid myGrid;
...
myGrid.setContainerDataSource(...);

Binding should be done based on id matching with fieldName or with an @Id("myGrid") annotation if present.

Grid is broken if addColumn/addRow is used

Rows are pushed to the client only when the data source is set. If you do

g = new Grid();
g.addColumn("foo");
g.addRow("bar");

you get an empty grid. The client side does even try to fetch any rows either.

HTML imports block pre-rendering in Chrome

HTML imports by design blocks rendering (paint) of the page. For apps which can be fully pre-rendered, e.g. TodoMVC, this delays showing of the UI to the user until all HTML imports have completed (not scripts inside HTML imports, these are considered deferred). Today this is a problem only in Chrome which has native support for HTML imports. Other browsers need the webcomponentsjs polyfill before starting imports, and the polyfill is loaded deferred so there is no way that HTML imports can block rendering

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.