-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the documentation structure
Fixes #1698 Moves all files around to make sure content is aligned into preferable reading order. Also adds a very shallow introduction / architecture page.
- Loading branch information
Showing
92 changed files
with
376 additions
and
276 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...neous/tutorial-dependency-filter.asciidoc → ...anced/tutorial-dependency-filter.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...laneous/tutorial-dynamic-content.asciidoc → ...dvanced/tutorial-dynamic-content.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Dynamic Content | ||
order: 3 | ||
order: 5 | ||
layout: page | ||
--- | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...ider/tutorial-flow-data-provider.asciidoc → ...data/tutorial-flow-data-provider.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...rial-component-with-dependencies.asciidoc → ...al-component-lifecycle-callbacks.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 120 additions & 0 deletions
120
flow-documentation/introduction/introduction-overview.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
title: Overview | ||
order: 1 | ||
layout: page | ||
--- | ||
|
||
= Introduction to Flow | ||
|
||
This chapter gives an overview to Vaadin Flow Architecture and introduces Flow's basic concepts. | ||
|
||
== Architecture | ||
|
||
Working with low-level web technologies is time consuming and hard. | ||
In Vaadin 10, all user interface elements are componentized into Web Components, | ||
meaning that they are de-coupled and sandboxed making web development easier than ever before. | ||
As part of Vaadin 10, Flow provides a type safe Java server-side API to use these Web Components. | ||
Flow provides automated bi-directional communication between the server and the browser giving Java developers full access to all of the modern web | ||
and makes it easier to connect the UI to data via a robust Java backend than using traditional REST based communication. | ||
|
||
image:images/v10-architecture.png[Vaadin 10 Architecture,1200,430] | ||
|
||
With Vaadin Flow you can access browsers APIs, Web Components, or even simple DOM-elements, directly from the server-side Java. | ||
When using Vaadin Flow, you do not need to understand how the client to server communication or the Web Components work. | ||
You can just focus on using and creating Components, which work at a much higher abstraction level. | ||
|
||
image:images/dom-to-java.png[dom-to-java,500,432] | ||
|
||
If necessary, you are also able to take full control over what gets send through the wire when creating components based on HTML templates. | ||
Flow provides two-way data binding so that when the UI is changed on the client or the server, it is automatically reflected to the other side. | ||
|
||
== Building UIs with Components | ||
|
||
The core of Vaadin Flow is UI Components, that are used to build interactive web apps and websites. | ||
On top of ready made components, there are powerful abstraction layers that can be used to create new components. | ||
|
||
=== Vaadin Components | ||
|
||
On the high abstraction layer, you will be super productive and build your UI using the Java APIs of Vaadin Components based on the Vaadin Elements Web Components. | ||
This way you don't have to write or understand any JavaScript or HTML, and CSS is only necessary to give your App the look and feel you want to. | ||
|
||
// CODE SNIPPET // | ||
|
||
// LINK TO ACTUAL CHAPTER // | ||
|
||
=== Composing new Components in 100% Java | ||
|
||
On the next abstraction layer you can easily create new components by customizing and mixing existing components, | ||
made possible by light-weight component architecture and access to the DOM and browser APIs from server side. | ||
This allows you to work out issues and customize things, while still staying on the server side | ||
and leveraging Flows automated communication layer between the browser and the server. | ||
|
||
// CODE SNIPPET // | ||
|
||
// LINKS TO CHAPTERS // | ||
|
||
=== Integrating a Web Component | ||
|
||
With Vaadin Flow you can take any Web Component, and create the Java API for them and start using them in your projects. | ||
|
||
// CODE SNIPPET // | ||
|
||
// LINK TO CHAPTER // | ||
|
||
=== Building Components with HTML Templates | ||
|
||
On the lowest level, it is possible to take full control of the DOM and the communication, by creating components as HTML templates, | ||
and creating a server side Java class that encapsulates them into reusable components with a high-level API. To help build the templates, Flow provides: | ||
|
||
* a Model that allows you to share and synchronize data between the Java and the HTML template | ||
* a server side representation of the client-side DOM tree to dynamic modifications to the template | ||
* a type-safe Java RPC API for interacting with JavaScript in the browser. | ||
|
||
// CODE SNIPPET // | ||
|
||
// LINK TO CHAPTER // | ||
|
||
// == Router TODO should provide short intro to router and links // | ||
|
||
== How Flow Components Work | ||
|
||
Flow allows Java code to control the DOM in the user's browser by having a server-side representation of the same DOM tree. | ||
All changes are automatically synchronized to the real DOM tree in the browser. | ||
|
||
The DOM tree is built up from `Element` instances, each one representing a DOM element in the browser. | ||
The root of the server-side DOM tree is the `Element` of the `UI` instance, accessible using `ui.getElement()`. | ||
This element represents the `<body>` tag. | ||
|
||
Elements on the server are implemented as flyweight instances. | ||
This means that you cannot compare elements using `==` and `!=`. | ||
Instead, `element.equals(otherElement)` should be used to check whether two instances refer to the same DOM element in the browser. | ||
|
||
=== Element Hierarchy | ||
|
||
A web application is structured as a tree of elements with the root being the element of the `UI` instance. | ||
An element can be added as a child of another element using methods such as `element.appendChild(Element)` for adding an element to the end of a parent's child list or `element.insertChild(int, Element)` for adding to any position in the child list. | ||
|
||
The element hierarchy can be navigated upwards using `element.getParent()` and downwards using `element.getChildCount()` and `element.getChild(int)`. | ||
|
||
=== Component Hierarchy | ||
The component hierarchy provides an higher level abstraction on top of the element hierarchy. | ||
A component consists of a root element and can optionally contain any number of child elements. | ||
Components can be added inside other components using methods such as `UI.add(Component)`, provided the parent component supports child components. | ||
|
||
Composite is a special kind of component which does not have a root element of its own but instead encapsulates another component. | ||
The main use case for a composite is to combine existing components into new components while hiding the original component API. | ||
|
||
The component hierarchy can be navigated upwards using `component.getParent()` and downwards using `component.getChildren()`. | ||
The component hierarchy is constructed based on the element hierarchy, so they are always in sync. | ||
|
||
=== Templates | ||
Instead of writing Java code for building the DOM from individual elements, | ||
it's also possible to use the `Template` component to define the overall DOM structure in an HTML template file and then use a model to control the contents of the elements. | ||
|
||
In addition to giving a clearer overview of the structure of a Component, the template functionality does also help improve performance – | ||
the same template definition is reused for all component instance using the same template file. This means that less memory is used on the server and less data needs to be sent to the browser. | ||
|
||
== Hello World in Flow | ||
|
||
<<tutorial-hello-world#,The next page>> shows the simples possible way of building a Hello World application with Flow. | ||
|
File renamed without changes.
Oops, something went wrong.