Skip to content

Commit

Permalink
Update branch (#9665)
Browse files Browse the repository at this point in the history
* test: Fix duplicate registration (#9233)

Lock the registry when registering
dynamic route in serviceInit to not have
a race where 2 inits note that path is not
registered and then try to register the route.

Fixes #9223

* refactor: Remove log usage in embedded components (#9254)

8d012f7 removed some log and converted others into debug
but log in disconnectedCallback was left.

* refactor: expose the items count API to components (#9257)

Exposes DataCommunicator::getDataProviderSize to the components, in order to get the items count taking into account the countCallback, if it has been set previously.

Related-to: vaadin/flow-components#282

* chore: unit test for devmode-not-ready page contents and type (#9266)

* chore: do not depend on commons.lang3 (#9271)

* chore: fix typo (#9272)

Fix typo in DataCommunicator::getDataProviderSize() javadoc.

* fix: Sync HierarchicalDataCommunicator's expand state with client side (#9275)

HierarchicalDataCommunicator's expanded state were not being synchronised with client side and TreeGrid's expanded nodes were being collapsed after re-attaching.

Warranty: Sync TreeGrid expanded items state with the client side when detaching and reattaching

Fixes: #9175

* chore: Bump version to 6.0-SNAPSHOT (#9279)

* refactor: make web browser immutable (#9298)

* feat: Create Flow plugins for webpack (#9295)

* feat: Create Flow plugins for webpack

Moved stats file handling to a custom plugin.
Added feature for copying custom Flow plugins
for use with webpack.

Fixes #9283

* fix: AppShellConfigurator is now considered for theme endpoint (#9332)

AppShellConfigurator is now also considered when
scanning for annotations and deciding theme.

Fixes #9110

* fix: fix TreeGrid updating wrong expanded items state on setDataProvider (#9336)

Fixes: #9328
Details: HierarchicalDataProvider's reset method was called before recreating the HierrarchyMapper in setDataProvider. This was creating wrong updates for the client side.

* feat!: Theme annotation should be only on AppShellConfigurator (#9313)

Having the `@Theme` annotation on Flow views or router layouts will not be allowed anymore, it should be on `AppShellConfigurator` instead.

Fixes #9092

* test(TypeScript): ensure CSRF token is updated when session is invalidated (#9329)

* test(TypeScript): ensure CSRF token is updated when session is invalidated

Fixes #9164

* add log message

* fix: increase threshold for performance test (#9381)

* fix: hide loading indicator when endpoint call fails (#9380)

* feat: tree-shakeable ES imports for TS form validators (#9374)

- Use tree-shakeable ES imports for TS form validators based on the latest version of validators lib.
- Add missing `return` in the `submit()` method

* feat: Theme can be defined as string or class (#9349)

Add a string definition for theme that matches the "application theme" in the theme folder inside /frontend/theme/, loading the css automatically from there. This is based on Lumo theme, always.
Change old class based theme to use themeClass for theme selection.

Fixes #9281

* fix!: Use data view filter and sorting only to that component (#9315)

In-memory filtering and sorting are now stored directly in component, which gives an opportunity to change it through the data view API for a certain component separately from other components bound to the same data provider.

Fixes #8655

* fix: support Range requests with either start or end byte index omitted (#9368)

Supports headers of the type Range: -123 and Range: 123-.

Fixes #9083.

* refactor: revert 'Use data view filter and sorting only to that component' (#9390)

Revert the changes for #8655 to be able to bump the version of components and avoid compile errors.

* chore: remove test module test-subcontext (#9394)

This module is subsumed by test-router-custom-context.

* chore: update readme with discord link (#9382)

* test: remove Theme annotation from demo helpers module (#9395)

* feat: Do not allow themeClass and themeName in same annotation (#9389)

Theme Class and Theme Name is not supported in
the same Theme annotation as theme name builds
on the Lumo theme.

test-themes is now for testing the Application theme only.
Old theme test was moved into test-misc.

Fixes #9370

* fix!: Use data view filter and sorting only to that component (#9315)

In-memory filtering and sorting are now stored directly in component, which gives an opportunity to change it through the data view API for a certain component separately from other components bound to the same data provider.

Fixes: #8655

* feat: Only use one theme and fail for duplicates (#9406)

Now we only handle the theme with the name inside the Theme annotation.

Fixes #9383

* Read stats.json content as a bundle resource in OSGi
Read token file as a bundle resource in OSGi

Fixes #9146
Fix NPE
Revert logic back to the previous state
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendUtils.java
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/OSGiAccess.java

* Refactor Instantiator and resources access

Fixes #9185
Exclude non-serializable classes
Drop dependency to flow-push from flow-server
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
#	flow-server/src/test/java/com/vaadin/flow/server/connect/generator/endpoints/model/OSGiInstantiatorFactory.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/generator/endpoints/model/OSGiResourceProvider.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/typeconversion/StringConversionTest.java

* Remove flow-osgi dep from flow-push, increase osgi cmpn version
# Conflicts:
#	flow-push/pom.xml
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/VaadinBundleTracker.java

* Correct unit tests after refactoring: make them compiling
Mock VaadinServlet in MockVaadinServletService
Adapt unit tests for refactored code
Adapt more unti tests and add one more new SPI method
Fix serializable test, proceed with unit tests adaption
Adapt unit tests for classes in com.vaadin.flow.server
Adapt unit tests in the com.vaadin.flow.server.communication package
* Adapt more unit tests

* Make sure that ServletContextInitializers are executed after
LookupInitializer
Fix OSGi presence check to be able to run unit test
Adapt servlet deployer unit tests
Exclude OSGi related classes from test
Exclude all OSGi impl classes from serializable test
# Conflicts:
#	flow-polymer-template/src/test/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParserTest.java
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/ApplicationRouteRegistry.java
#	flow-server/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
#	flow-server/src/test/java/com/vaadin/flow/component/InvalidUrlTest.java
#	flow-server/src/test/java/com/vaadin/flow/component/UITest.java
#	flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerDependenciesTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/DeploymentConfigurationFactoryTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/I18NProviderTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/MockServletServiceSessionSetup.java
#	flow-server/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinServiceTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinServletConfigurationTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinServletServiceTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinSessionTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/PushHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/FrontendUtilsTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTestBase.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/EnableOSGiRunner.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/ServletDeployerTest.java

* Fix OSGi Lookup related issues
Fix OSGi related unit test one more time

# Conflicts:
#	flow-osgi/src/main/java/com/vaadin/flow/osgi/support/OSGiResourceProvider.java
#	flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/OSGiAccess.java
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/VaadinBundleTracker.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/LookupInitializer.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/EnableOSGiRunner.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/OSGiInitApplicationRouteRegistryTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/webcomponent/OSGiWebComponentConfigurationRegistryTest.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/osgi/Activator.java

* Correct the resource access for VaadinService

* Extend SPI, provide javadocs some unit tests fixes
Minor code corrections, javadocs
Correct unit test
# Conflicts:
#	flow-polymer-template/src/test/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParserTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java

* test: add unit tests

# Conflicts:
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/osgi/Activator.java

* test: make it possible to run felix-jetty in npm mode
# Conflicts:
#	flow-tests/servlet-containers/felix-jetty/pom.xml
#	flow-tests/test-root-context/pom-npm.xml

* Make httpclient dependency optional for now. (#9262)

* refactoring: move OSGi resource provider impl to flow-server (#9268)

OSGi ResourceProvider impl should be available as a service at the moment when Vaadin WAB register a servlet.
It's not possible without extra unclear config to make sure that the service is registered if it's in the flow-osgi : the bundle may be activated at any moment regardless of servlet registration.
The issue doesn't appear if the service is registered at the flow-bundle start phase.

* refactor: review fixes for OSGi (#9289)

* refactoring: review fixes

* chore: add a comment about Jar packaging in test-root-context module

* fix: ensureServletContext should be always called

* fix: fix review comments
# Conflicts:
#	flow-tests/test-root-context/pom-npm.xml

* refactor: get rid of cmpn osgi dependency (#9307)

Not needed for flow-server.

* refactoring: App classpath resources should be access via
ResourceProvider (#9278)

Fixes #9269
# Conflicts:
#	flow-polymer-template/src/main/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParser.java
#	flow-server/src/main/java/com/vaadin/flow/server/BootstrapUtils.java

* test: update unit tests

* refactor: fix various OSGi related issues

* add back lost classes during cherry-picks
* fix unit tests
* rewrite polymer template RPC

* fix: fix javadocs after merge conflicts

* fix: fix mocks in unit tests

* test: Correct activator

* refactor: correct lookup initializer filtering code

* fix: fix javadocs (SQ)

* refactor: Remove OSGi related ITs and osgi module from the repo

* fix: fix some review comments

* fix: test unstable test

* refactor: get rid of OSGiClientStaticResource (#9277)

* fix: use content parameter in the activate method

* fix: Make OSGi incompatible vaadin-connect dependencies optional

* fix: make Spring deps optional

* fix: make a workaround for broken Route registry API

* fix: avoid not-breaking exception ojn loading class from another bundle

* fix: workaround for possible bug in route registry (like #9360).

* [OSGi] - Cleanup BudleActivator and Service registration, Update bnd and osgi deps (#9361)

refactor: OSGi improvements 

* update bnd-version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* update osgi dependency and version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix mocking osgi-classes

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* OSGiResourceProvider uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* VaadinBundleTracker uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* Remove `empty` BundleActivator

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* use constants for osgi.http.whiteboard.servlet.pattern

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix unregister Service PolymerPublishedEventRpcHandler

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* registers PolymerPublishedEventRpcHandler as a declarative service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix: add explanation why OSGi Component annotation is safe to use

* fix: code review fixes

* fix: return back accidentially removed method and call init for service

* fix: remove non-existent class pattern from test

* fix: fix import order

* fix: extract code to a separate method

* fix: correct unit test

* fix: fix unit test

* refactor: simplify list merging

* fix: return back lost code after review

* fix: imports order

* fix: revert bnd version

* fix: imports order, review comments

* fix: restore lost test method

* fix: import orders

* fix: revert not working deployment of test-root-context ui classifier

* fix: check if Url contains directory change in Dev Mode (#9392)

Checks whether the Url contains a directory change and a double encoding in Dev Mode. Returns 403 Forbidden immediately and skip the request handling, if does.

* fix: preserve filter to not lose it between page requests (#9421)

Data communicator's filter removal, which has been introduced for components with internal filtering (like a ComboBox), may lead to filter loss during the items scrolling. This fix reverts the filter removal and the components should implement this feature on their side, if necessary.

Related-to: vaadin/flow-components#388

* chore: Update issue template with discord link (#9426)

* chore: update chrome expectation to 87 (#9445)

* fix: revert changes which broke route registration (#9432)

Need to active the tracker from an servlet context initializer because @activate doesn't work on CTOR with parameter

* chore: fix outdated AppShell javadoc (#9453)

* test: add test for setting global font (#9436)

Fixes #9409

* fix race-condition in IT-Tests (#9416)

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix: mark tests that should not be executed in OSGi (#9456)

* fix: mark tests that should not be executed in OSGi

* fix: don't use push in route not found error page in OSGi

* fix: avoid route with wildcard parameter which doesn't work in OSGi

* fix: exclude wildcard parameter IT and devmode IT

* fix: exclude "context" resource IT from OSGi tests

* fix: make annotation packages optional in OSGi (#9465)

Also fix test to first open page before checking client.

fixes #9463

* fix: made VaadinRequest available in endpoint (#9442)

* fix: made vaadinrequest available in endpoint

* clear VaadinRequest instance after endpoint call

* chore: remove mentions of “Connect” (#9151)

* Rename “Connect” to “Fusion”

* Remove “Fusion” naming

* feat: Serve theme static files from VAADIN/static (#9451)

Static files in META-INF/VAADIN/static will now be served
on request to VAADIN/static.
Added new webpack loader that changes app theme
css urls targeting ./ and ../ to be VAADIN/static/ instead.
Where ../ can not go outside of the application theme folder.

Fixes #9405

* refactor: Remove OSGi code from flow-server (#9472)

* refactor: Remove OSGi code from flow-server

Fixes #9219

* chore: update Flow versions description (#9469)

* feat: Theme component with app theme. (#9418)

Added the feature that you can theme components
with the app theme by creating a css file in
'frontend/theme/myTheme/components' with the
component tag name e.g. 'my-field'  should have 'my-field.css'

Fixes #9348

* fix: check whether class implements an interface first directly (#9486)

Part of #9480

* fix: remove instance field from singleton IndexHtmlRequestHandler (#9475)

* fix: remove instance field from singleton IndexHtmlRequestHandler

* apply code review suggestions

* Stop logging error when updating dev dependencies (#9476)

As there is a conflict with the dependencies and prevent adding
the flow-dev-dependencies package to the platform (#9345), this will hide
the unavoidable error that was logged for Vaadin apps.
 
Fixes #9251

* fix: optimize handling of requests containing Range header (#9484)

More efficient parsing of the header value. Also, range count is capped at 16
(additional will be ignored) and overlapping ranges at 2 (request will be denied
if above).

* fix: Correct regexp to only match when digit first (#9496)

Use Matcher::find instead of Matcher::matches as matches never matched.

Fixes #9494

* test: add test that external urls are not touched (#9482)

Added test that we don't touch external
urls (relative or abosolute).
Moved flow to be under path so we can have
jetty serve "external" resources.

Fixes #9430

* fix: Add polyfill for constructable stylesheets (#9489)

Add the constructable stylesheets polyfill so
app theme also works with non chrome based browsers.

Fixes #9488

* fix: Initialize VaadinServlet after Lookup is available (#9500)

fix: don't initialize Vaadin servlet until Lookup is not available

* feat: Enable adding assets from node_modules (#9495)

* feat: Enable adding assets from node_modules

It is now possible to import resources from
installed node_modules by adding the asset to
theme/my-theme/theme.json

Fixes #9468

* Add comment to doc on copyStaticAssets

* Fix url expectation after merge

* format lines

* test: add unit test for clear all in the servlet init method (#9507)

* Fix: fix file system traversal of theme-loader to stop at root (#9505)

The theme-loader recursion for themeFolder should stop
at the root level. Also if no theme folder found we should
not spend time on replacement.

* fix: enable PlainScriptViaJavaScriptIT in OSGi (#9520)

fixes #9461

* fix: enable PushRouteWildcardParameterIT in OSGi (#9518)

fixes #9459

* fix: enable BaseHref IT back (#9515)

Fixes #9458

* chore: Add information on logging in webpack (#9527)

Added information on log levels
with webpack loaders and plugins.

* test: fix test class and register view servlet with a context in OSGi (#9528)

Part of vaadin/osgi#5

* fix: removed `hasClientIssue("8236")` guard as ITs now pass (#9536)

* Fix: Update Lit bundle parser regex. (#9546)

Now the pattern will not fail with a StackOverflowException
as we will search from the start character accepting
any characters until we reach the caught start character with ;

* fix: Enable lit css importing (#9550)

Fixes #9532

* fix: use provided executor for frontend tools (#9553)

fixes vaadin/spring#691

* feat: Resource handling to not need plugin copying (#9558)

Fixed the url handling so that theme resources
get prepended with theme/[themeName] while
having the correct absolute path. With this we can handle
these url resources with the css-loader which in turn
leads to file-loader gettign the files for copying.

External url are still not touched in any way.

part of #9410 and #9533

* fix: file-loader name for windows execution (#9575)

Windows file path separator \ should not
be used as it will result in %0B when it should
be /

* test: Fixed flaky tests caused by variable ui in ValidatorTestBase.java (#9524)

Added a ui variable in the ValidatorTestBase class to attach strong reference, in order to avoid garbage collecting it during the test run.

* refactor: get Executor service from Lookup instead init params (#9572)

fixes #9570

* fix: Add missing refreshAll method to data view

Adds the missed refresh all method to data view API.

Fixes: #9574

* chore: Update contributing guide with setup info (#9576)

The contribution guide was missing the project setup information.

There were outdated instructions in the readme, which was on the other hand not up to date and only had instructions for Eclipse. Now everything is in contribution guide and readme is short and simple, pointing to contribution guide for those who want to work with the project.

* fix!: Make VaadinService.dependencyFilters unmodifiable

While the change is backwards compatible from API perspective, it could be considered a behavior change although there is quite low risk of exposure in apps. Thus targeting 2.5 for the LTS and the recently released 5.0.

* fix: encode attribute value during transfer from embedded web app (#9583)

encode attribute value during transfer from embedded web app

* chore: move fusion endpoint code to fusion-endpoint module (#9499)

Fixes: #9354
move fusion code to a separate fusion-endpoint module, so that the fusion dependencies which are not OSGi compatible can be removed from the flow-server module.

- move the code in the connect package  to fusion-server
- removed the non OSGi compatible packages from the bnd file in flow-server
- change  `TaskGenerateOpenApi` and `TaskGenerateConnect` to interfaces in flow-server, have the implementations in fusion-endpoint since they are using code inside the connect package
- Move endpoint related tests:
   - from NodeTasksTest to  NodeTasksEndpointTest, 
   - from DevModeInitializerTest to DevModeInitializerEndpointTest 
- Add a `LookupImpl` class in the `flow-maven-plugin` module for finding endpoint services.
- Introduce a `isInstantiableService`method in `ReflectTools`

* feat: Embedded component appTheme support (#9588)

Add support for application theme with
embedded components.

Fixes #8564

* feat: Enable importing CSS from node_modules (#9543)

Enable using CSS files from installed node_modules by adding 'importCss' to theme/my-theme/theme.json.

Fixes #9410

* refactor: simplify ResourceProvider (#9609)

fixes #9605

* chore: add internal classes to access classloader and init context (#9618)

* chore: add internal classes to access classloader and init context

related to #9601 : needed to restore OSGi resource provider

* fix: loading indicator visible and isActive true while endpoint fetch (#9593)

* fix: loading indicator visible and isActive true while endpoint fetch

* Clarified code and added test

* fix: theme files can now be referenced as theme/theme-name (#9590)

Theme files are now copied under theme/[theme-name]
and can be referenced by theme/them-name/path/file.ff
even though they are located at VAADIN/static

Fixes: #9405 and #9535

* Fix: Generated theme.js is now named theme.generated.js (#9616)

my-theme.js is now generated as my-theme.generated.js

Fixes #9595

* Feat: Check that npm resources are available (#9617)

Check that we have named npm resources
available or throw an exception informing
the user to install it using a NpmPackage
annotation or manually with (p)npm i

Fixes #9615

* refactor: rename the app-theme root folder from theme to themes (#9626)

Fixes #9611

* refactor: refine renaming and incorrect paths in ThemeIT (#9634)

* rename app-theme root folder to themes

* chore: fix flaky tests that depends on mock count (#9631)

* chore: create deepClean profile (#9311)

Using the deepClean profile one can
clean up all the generated files and
node_modules folders from all test modules.

* test: add document.css level styles tests (#9646)

Adds a tests for checking that the document.css file is injected to the document scope and not injected to embedded element shadow root.

Fixes #9552

* refactor: extract common config functionality and introduce add config (#9635)

refactor: extract common config functionality and introduce add config

part of #9417

Co-authored-by: caalador <mikael.grankvist@gmail.com>
Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Co-authored-by: Johannes Eriksson <joheriks@vaadin.com>
Co-authored-by: Soroosh Taefi <taefi.soroosh@gmail.com>
Co-authored-by: Denis <denis@vaadin.com>
Co-authored-by: Artem Godin <fluorumlabs@users.noreply.github.com>
Co-authored-by: Anton Platonov <anton@vaadin.com>
Co-authored-by: Haijian Wang <30408303+haijian-vaadin@users.noreply.github.com>
Co-authored-by: Pekka Hyvönen <pekka@vaadin.com>
Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com>
Co-authored-by: Stefan Bischof <33224746+stbischof@users.noreply.github.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jialin Shao <jialin_shao@outlook.com>
Co-authored-by: Tan Bui <tan@vaadin.com>
  • Loading branch information
16 people committed Dec 16, 2020
1 parent b9074f2 commit 8c75d58
Show file tree
Hide file tree
Showing 569 changed files with 11,482 additions and 3,421 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--
Please read these instructions through before submitting an issue, Thank You!
Please READ these instructions & USE the issue template below, Thank You!
Only use GitHub issues for bugs and feature requests.
For general support from the community, use https://vaadin.com/forum or https://gitter.im/vaadin/flow instead.
For general support from the community, use https://vaadin.com/forum or Vaadin discord chat https://discord.gg/MYFq5RTbBn instead.
NOTE: Issues concerning certain component should go to the corresponding components repository like [vaadin/vaadin-grid-flow](https://github.com/vaadin/vaadin-grid-flow).
NOTE: Issues concerning certain UI components should go to the components repository https://github.com/vaadin/vaadin-flow-components .
For feature requests, always include your use case - what are you trying to achieve and why.
Good quality bug report increases the likelihood to get the bug fixed. Please use the following template to report bugs.```
Good quality bug report increases the likelihood to get the bug fixed. A bad quality one will likely be just closed. Please use the following template to report bugs.
-->
### Description of the bug
### Description of the bug / feature
<!-- Explain briefly what is broken or what you want to achieve -->
### Minimal reproducible example
<!-- What are the steps to reproduce the issue, example project or a code snippet without dependencies -->
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ yarn.lock

flow-client/src/main/resources/META-INF/resources/frontend/FlowClient.js
flow-tests/**/types.d.ts
/flow-tests/**/*.generated.js

291 changes: 247 additions & 44 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

98 changes: 5 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/flow#?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
<a target="_blank" href="https://discord.gg/MYFq5RTbBn"><img src="https://discord.com/assets/e4923594e694a21542a489471ecffa50.svg" width="100" alt="Join the discussion in Vaadin Flow Discord"></img></a>

Vaadin Flow
======
*[Vaadin Flow](https://vaadin.com/flow) is the Java framework of Vaadin Platform for building modern web sites 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 starter packs for Vaadin 14 with Flow](https://vaadin.com/start) or [the documentation](https://vaadin.com/docs/flow/Overview.html).

To contribute, first refer to [Contribution Guide](/CONTRIBUTING.md) for general instructions and requirements for contributing code to Flow.
**To contribute, first refer to [Contribution Guide](/CONTRIBUTING.md) for general instructions and requirements for contributing code to Flow.**

Flow EAP discussion in Gitter IM at https://gitter.im/vaadin-flow/Lobby
Join Vaadin Flow community chat in https://discord.gg/MYFq5RTbBn

Instructions on how to set up a working environment for developing the Flow project follow below.

The `master` branch is the latest version (5.0) that will at some point be released in the [Vaadin platform 18.0](https://github.com/vaadin/platform). See other branches for other framework versions:
The `master` branch is the latest version (6.0) that will at some point be released in the [Vaadin platform 19.0](https://github.com/vaadin/platform). See other branches for other framework versions:

| Branch | [Platform Version](https://github.com/vaadin/platform/releases) | [Flow Version](https://github.com/vaadin/flow/releases) |
|--------|-----------------------------------------------------------------|---------------------------------------------------------|
Expand All @@ -27,91 +25,5 @@ The `master` branch is the latest version (5.0) that will at some point be relea
| 3.0 | 15.0.x | 3.0.x |
| 3.1 | 16.0.x | 3.1.x |
| 4.0 | 17.0.x | 4.x |


Setting up Eclipse to Develop Flow
=========

Import the Project into the Workspace
------------
1. Do *File* -> *Import* -> *General* -> *Existing Maven Project*
1. Select the *flow* folder (where you cloned the project)
1. Ensure all projects are checked
1. Click “finish” to complete the import
1. Disable HTML and XML validation in the workspace to avoid validating Bower dependencies
1. Eclipse preferences -> *Validation*
1. Uncheck *Build* for *HTML Syntax Validator*
1. Uncheck *Build* for *XML Validator*


Note that the first compilation takes a while to finish as Maven downloads dependencies used in the projects.

Compiling the Client Engine
--------
Compile the client engine by executing the Eclipse build configuration *Compile ClientEngine* in *flow-client/eclipse*

Set up extra workspace preferences
--------
The following preferences need to be set to keep the project consistent. You need to do this especially to be able to contribute changes to the project.

1. Open *Window* -> *Preferences* (Windows) or *Eclipse* -> *Preferences* (Mac)
1. Go to *General* -> *Workspace*
1. Set *Text file encoding* to *UTF-8*
1. Set *New text file line delimiter* to *Unix*
1. Go to XML -> XML Files -> Editor
1. Ensure the settings are follows:
<pre><code>Line width: 72
Format comments: true
Join lines: true
Insert whitespace before closing empty end-tags: true
Indent-using spaces: true
Indentation size: 4
</code></pre>

Running tests
=====
The unit tests for the projects can be run using
<pre><code>mvn test</code></pre>

IT tests can be run with
<pre><code>mvn verify</code></pre>

To run IT tests locally, you'll need a [Testbench](https://vaadin.com/testbench) license and a Chrome browser installed (currently this is the only browser that IT tests are run in).
If you don't have the license, it's ok, our CI system will run those tests for you after you create a pull request.
Refer to the [contribution guide](/CONTRIBUTING.md) for details.

When running IT tests locally, by default, local Chrome is used to run tests, make sure it's installed.

Building a package
=====
The distribution package is built and installed into the local Maven repository by doing

1. mvn install

Running SuperDevMode
=====
Some flow internals use GWT in the client code. superDevMode allows to reload GWT changes on the fly, but it requires some setup first.

To start superDevMode do the following:

1. Get flow source code
1. If you are planning to launch the mode for the external application based on flow, first make sure that flow source code is of the same version as the application uses.
If it's not true, either update the application dependencies or check out the corresponding flow tag and rebuild both flow and the application.
1. Navigate to flow-client package in flow project
1. Run `mvn -Psdm clean install gwt:compile gwt:run-codeserver -DskipTests`
1. Start the application server
1. Open the application page and use the bookmarks to control dev mode
If you have no bookmarks, navigate to http://localhost:9876 to setup them.

In eclipse run .launch files from flow-client/eclipse in the order:

1. Compile ClientEngine.launch
2. Super Dev Mode.launch

> NOTE! SuperDevMode should be compiled before the application server is launched,
> also, flow version should match with the application one
> as else the application won't be able to run SDM and you will receive the
> exception `Can't find any GWT Modules on this page.`
More info about SuperDevMode: http://www.gwtproject.org/articles/superdevmode.html
| 5.0 | 18.0.x | 5.x |

2 changes: 1 addition & 1 deletion build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>5.0-SNAPSHOT</version>
<version>6.0-SNAPSHOT</version>
</parent>
<artifactId>flow-buildtools</artifactId>
<name>vaadin-buildhelpers</name>
Expand Down
18 changes: 9 additions & 9 deletions drivers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<root>
<windows>
<driver id="googlechrome">
<version id="86.0.4240.22">
<version id="87.0.4280.20">
<bitrate thirtytwobit="true" sixtyfourbit="true">
<filelocation>https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_win32.zip</filelocation>
<hash>5bc302d49dd4afdbc538f026e56bc1c1ddb9d1c8</hash>
<filelocation>https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_win32.zip</filelocation>
<hash>bc1c5b8cd8225364144a1b2cd9198e929daa7492</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
</windows>
<linux>
<driver id="googlechrome">
<version id="86.0.4240.22">
<version id="87.0.4280.20">
<bitrate sixtyfourbit="true">
<filelocation>https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_linux64.zip</filelocation>
<hash>b8b531e4560e6c749daecbceb7584c5f0e6ae4da</hash>
<filelocation>https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_linux64.zip</filelocation>
<hash>e249b148dab9f9c9073a965d4b2dffc022a001e8</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
</linux>
<osx>
<driver id="googlechrome">
<version id="86.0.4240.22">
<version id="87.0.4280.20">
<bitrate sixtyfourbit="true">
<filelocation>https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_mac64.zip</filelocation>
<hash>3cbbd63803df46cea1cbc1eb5fb753de69248279</hash>
<filelocation>https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_mac64.zip</filelocation>
<hash>fe58bfb60769638e48334d49821079b2dc6f3ab7</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
Expand Down
7 changes: 6 additions & 1 deletion flow-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>5.0-SNAPSHOT</version>
<version>6.0-SNAPSHOT</version>
</parent>
<artifactId>flow-bom</artifactId>
<packaging>pom</packaging>
Expand All @@ -18,6 +18,11 @@
<artifactId>flow-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>fusion-endpoint</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-polymer-template</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions flow-client/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ Bundle-Name: Flow Client Engine
Bundle-Version: ${osgi.bundle.version}
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Import-Package: !*, com.vaadin.flow.client, org.osgi.framework, \
org.osgi.service.http, com.vaadin.flow.osgi.support
Import-Package: !*
Export-Package: !*
2 changes: 1 addition & 1 deletion flow-client/intern.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"tunnelOptions": {
"version": "3.141.59",
"drivers": [
{"name": "chrome", "version": "86.0.4240.22"}
{"name": "chrome", "version": "87.0.4280.20"}
]
},
"plugins": {
Expand Down
4 changes: 2 additions & 2 deletions flow-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"dependencies": {
"lit-html": "^1.2.1",
"@types/validator": "10.11.3",
"validator": "12.0.0"
"@types/validator": "13.1.0",
"validator": "13.1.17"
}
}
4 changes: 2 additions & 2 deletions flow-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.vaadin</groupId>
<artifactId>flow-project</artifactId>
<version>5.0-SNAPSHOT</version>
<version>6.0-SNAPSHOT</version>
</parent>
<artifactId>flow-client</artifactId>
<name>Flow Client</name>
Expand Down Expand Up @@ -68,7 +68,7 @@

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<artifactId>osgi.core</artifactId>
<version>${osgi.core.version}</version>
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class EndpointResponseError extends Error {
}

/**
* An exception that gets thrown when the Vaadin Connect backend responds
* An exception that gets thrown when the Vaadin backend responds
* with not ok status.
*/
export class EndpointError extends Error {
Expand Down Expand Up @@ -107,7 +107,7 @@ export class EndpointError extends Error {
}

/**
* An exception that gets thrown if Vaadin Connect backend responds
* An exception that gets thrown if Vaadin endpoint responds
* with non-ok status and provides additional info
* on the validation errors occurred.
*/
Expand Down Expand Up @@ -235,7 +235,7 @@ export type Middleware = MiddlewareClass | MiddlewareFunction;
/**
* Vaadin Connect client class is a low-level network calling utility. It stores
* a prefix and facilitates remote calls to endpoint class methods
* on the Vaadin Connect backend.
* on the Vaadin backend.
*
* Example usage:
*
Expand All @@ -256,7 +256,7 @@ export type Middleware = MiddlewareClass | MiddlewareFunction;
*/
export class ConnectClient {
/**
* The Vaadin Connect backend prefix
* The Vaadin endpoint prefix
*/
prefix: string = '/connect';

Expand Down Expand Up @@ -352,10 +352,11 @@ export class ConnectClient {
const fetchNext: MiddlewareNext =
async(context: MiddlewareContext): Promise<Response> => {
this.loading(true);
return fetch(context.request).then(response => {
this.loading(false);
return response;
});
try {
return await fetch(context.request);
} finally {
this.loading(false);
}
};

// Assemble the final middlewares array from internal
Expand Down
40 changes: 27 additions & 13 deletions flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export class Flow {
// @ts-ignore
container : HTMLRouterContainer;

// flag used to inform Testbench whether a server route is in progress
private isActive = false;
private isActiveCount = 0;

private baseRegex = /^\//;
private appShellTitle: string;

Expand Down Expand Up @@ -307,15 +307,18 @@ export class Flow {
});
}

// flag used to inform Testbench whether a server route is in progress
get isActive(): boolean {
return this.isActiveCount > 0;
}

private showLoading() {
// Make Testbench know that server request is in progress
this.isActive = true;
$wnd.Vaadin.Flow.loading(true);
}

private hideLoading() {
// Make Testbench know that server request has finished
this.isActive = false;
$wnd.Vaadin.Flow.loading(false);
}

Expand Down Expand Up @@ -385,16 +388,27 @@ export class Flow {
let timeout2nd: any;
let timeout3rd: any;
$wnd.Vaadin.Flow.loading = (action: boolean) => {
clearTimeout(timeout2nd);
clearTimeout(timeout3rd);
loading.classList.remove('second');
loading.classList.remove('third');
// true if we should reveal indicator (first loading starting)
const show = action && this.isActiveCount === 0;
// true if we should hide indicator (last loading finished)
const hide = !action && this.isActiveCount === 1;
if (action) {
loading.removeAttribute('style');
timeout2nd = setTimeout(() => loading.classList.add('second'), 1500);
timeout3rd = setTimeout(() => loading.classList.add('third'), 5000);
} else {
loading.setAttribute('style', 'none');
this.isActiveCount++;
} else if (this.isActiveCount > 0) {
this.isActiveCount--;
}
if (show || hide) {
clearTimeout(timeout2nd);
clearTimeout(timeout3rd);
loading.classList.remove('second');
loading.classList.remove('third');
if (show) {
loading.removeAttribute('style');
timeout2nd = setTimeout(() => loading.classList.add('second'), 1500);
timeout3rd = setTimeout(() => loading.classList.add('third'), 5000);
} else {
loading.setAttribute('style', 'none');
}
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export class Binder<T, M extends AbstractModel<T>> extends BinderNode<T, M> {
* It's a no-op if the onSubmit callback is undefined.
*/
async submit(): Promise<T|void>{
if(this[_onSubmit]!==undefined){
this.submitTo(this[_onSubmit]);
if (this[_onSubmit] !== undefined) {
return this.submitTo(this[_onSubmit]);
}
}

Expand Down

0 comments on commit 8c75d58

Please sign in to comment.