Skip to content

Commit 22776ba

Browse files
authored
docs: reorganize categories
Work on #13 Close #16
1 parent 041973d commit 22776ba

File tree

9 files changed

+151
-62
lines changed

9 files changed

+151
-62
lines changed

docs/browser-engine/browser-engine.md

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,70 @@ slug: /browser-engine
55

66
# Overview
77

8-
Cross-platform technologies that use a browser engine (also called rendering engine) to render
9-
their UI have been around for many years, more precisely since 2009. Chrome was released the year
10-
before and it was already the
11-
fastest browser thanks to its new [V8] JavaScript engine. The web platform is becoming faster and
12-
sites more interactive. At the same time, iPhone (2007) and Android (2008) devices are becoming more
13-
and more popular, but it is complicated to find experienced developers, let alone for both.
8+
Developers of this category use mainly HTML, CSS, and JavaScript to create their applications,
9+
which are executed on a "browser engine". There are currently 3 actively maintained browser engines:
10+
11+
* [Gecko]
12+
* [WebKit]
13+
* [Chromium]
14+
15+
These browser engines power not only "web browsers", but also any technology that uses these
16+
language to create a User Interface ("Embedded browser engine"). While the foundation might be the
17+
same, there are some key differences between these two sub-categories.
18+
19+
<!-- Venn diagram of browser engines, web browsers, embedded browser engine -->
20+
21+
## Web browsers
22+
23+
With more than 4 billion internet users and 1.7 billion websites, the web is one (if not the most)
24+
popular platform.
25+
26+
While websites started as a way to render documents back in 1990, they have come a long way. They
27+
provide rich experiences with real time communication, video, and 3D graphics. They also adapt
28+
dynamically to any form factor, work offline, send notifications, and more.
29+
With all these new features and capabilities, browsers have had to evolve and become more like mini
30+
OSes, protecting users from malicious attacks and poorly written code.
31+
32+
Tthe [most used ones][statcounter] are [Chrome] ([Chromium]), [Safari] ([WebKit]), and [Firefox]
33+
([Gecko]). But even though they all are considered modern engines, they are not the same. Even for
34+
the same browser there can be significant differences accross platforms (more notably on iOS where
35+
they are force to be a wrapper around the WebKit's WebView).
36+
37+
As with all other technologies, there are pros and cons that developers need to evaluate. The main
38+
questions to ask are around:
39+
40+
* Feature requirements and platform support
41+
* Distribution and infrastructure
42+
43+
### Feature requirements and platform support
44+
45+
As mentioned earlier, the Web API has become richer over the last few years. Yet there are features
46+
that are still not available (nor they will be, like platform specific features).
47+
48+
It is important for developers to know what are the required features and if there is an API to
49+
enable that. The [capabilities status][Project Fugu] website is a good place to learn about what is
50+
already available or in development. Not all these APIs are supported by all browsers at the same
51+
time, so developers need to additionally take into account what does their user base look like, if
52+
there are alternatives that could be use, or if the experience they are planning could be
53+
[progressively enhanced][Progressive enhancement] instead of rely entirely on it.
54+
55+
### Distribution and infrastructure
56+
57+
:::caution
58+
59+
This sections needs to be written. Some talking points are:
60+
61+
* _Talk about server vs install file_
62+
* _Requiring a web server to deliver the app_
63+
64+
:::
65+
66+
## Embedded browser engine
67+
68+
This sub-category has been around since 2009. Chrome was released the year before and it was already
69+
the fastest browser thanks to its new [V8] JavaScript engine. The web platform is becoming faster
70+
and sites more interactive. At the same time, iPhone (2007) and Android (2008) devices are becoming
71+
more and more popular, but it is complicated to find experienced developers, let alone for both.
1472

1573
To fill this opportunity [Apache Cordova] is created (formerly PhoneGap): a mobile development
1674
platform that uses the platforms’ WebView control (a control that allows you to render web content
@@ -44,7 +102,7 @@ main technical questions can be grouped in the following categories:
44102
* Hosting language, features and hotpaths
45103
* Inter-Process Communication layer
46104

47-
## Platform support and Rendering engine
105+
### Platform support and Rendering engine
48106

49107
At first it can be a bit surprising to group "Platform support" and "Rendering engine". The reason
50108
is that they are intertwined and one impacts the other (and vice-versa). Technologies that bundle
@@ -54,7 +112,7 @@ Because iOS devices do not allow that, their teams usually limit themselves to d
54112
to reach more platforms (i.e.: mobile as well), at the expense, in some cases, of quirks between the
55113
different platforms or if the device is running an older version of the control.
56114

57-
## Hosting language, features and hotpaths
115+
### Hosting language, features and hotpaths
58116

59117
One common thing to this category is that most of the UI, if not all, is created using web
60118
technologies (HTML, CSS and JavaScript). But the host could use a completely different language
@@ -76,10 +134,10 @@ A few questions that can help us make a decission are:
76134
fastest possible version of an algorithm on the host and still have poor results if that
77135
communication is done in an efficient way.
78136

79-
## Inter-Process Communication layer
137+
### Inter-Process Communication layer
80138

81139
While there are many browsers and cross-platform technologies, the reality is that there are not
82-
that many browser enginges (more about this in [Web and PWA]). In fact, most of the technologies
140+
that many browser enginges as we have seen before. In fact, most of the technologies that render web
83141
rely on Chromium or WebKit. Unsurprisingly, when using the same engine and the same web content all
84142
these technologies show similar performance characteristics (memory, processes, threads...). It
85143
makes sense, the cost of running a browser engine is considerably larger than any “overhead” that
@@ -130,10 +188,20 @@ There are many strategies in here, each one with its pros and cons:
130188
[Blazor Desktop]: https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-1/#blazor-desktop-apps
131189
[Capacitor]: https://capacitorjs.com/
132190
[CEF]: https://bitbucket.org/chromiumembedded/cef/wiki/Home
191+
[Chromium]: http://www.chromium.org/Home
192+
[Chrome]: https://www.google.com/chrome/index.html
193+
[Edge]: https://www.microsoft.com/en-us/edge
133194
[Electron]: https://www.electronjs.org
134195
[Fetch API]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
196+
[Gecko]: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko
197+
[Firefox]: https://www.mozilla.org/en-US/firefox/new/
135198
[NW.js]: https://nwjs.io/
199+
[Progressive enhancement]: https://developer.mozilla.org/en-US/docs/Glossary/Progressive_Enhancement
200+
[Project Fugu]: https://web.dev/fugu-status/
201+
[Safari]: https://www.apple.com/safari/
202+
[statcounter]: https://gs.statcounter.com/browser-market-share
136203
[Tauri]: https://tauri.studio/
204+
[Types of technologies]: ../types.md
137205
[V8]: https://en.wikipedia.org/wiki/V8_(JavaScript_engine)
138-
[Web and PWA]: ../web/web.md
206+
[WebKit]: https://webkit.org/
139207
[WebSockets]: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API

docs/browser-engine/electron.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Groups].
1616
Electron applications use Chromium as the shell to render the User Interface. Developers
1717
use HTML, CSS and JavaScript to build their apps, which means they can use the libraries and tools
1818
available to the web community such as React, webpack, Babel, etc. One of the main differences with
19-
other technologies under the _[browser-engine]_ category, is that JavaScript is used to access the
19+
other technologies under the _[Browser engine]_ category, is that JavaScript is used to access the
2020
Operating System features as well. This is because Electron applications come with [Node.js]
2121
support. At a high-level, [Electron adds the Node.js layer to Chromium's JavaScript engine
2222
V8][electron-node]. This means that developers can leverate all its ecosystem and also write C/C++
@@ -66,7 +66,7 @@ the needs of a particular company or product.
6666
| :------------- | :----: |
6767
| Website | [{{technologies.electron.url}}]({{technologies.electron.url}}) |
6868
| Platforms | Desktop |
69-
| Type | [browser-engine] |
69+
| Type | [Browser engine] |
7070
| Software type | OSS |
7171
| License | [MIT] |
7272
| Copyright | [OpenJS Foundation][electron-foundation] |
@@ -99,7 +99,6 @@ would be Rust, which can be run via [Neon].
9999
<!-- Ref links -->
100100

101101
[Apple Store policy 2.5.6]: https://developer.apple.com/app-store/review/guidelines/
102-
[browser-engine]: ./browser-engine.md
103102
[chrome release cycle]: https://blog.chromium.org/2021/03/speeding-up-release-cycle.html
104103
[Discord]: https://discord.com/
105104
[electron-foundation]: https://openjsf.org/blog/2019/12/11/electron-joins-the-openjs-foundation/
@@ -113,5 +112,6 @@ would be Rust, which can be run via [Neon].
113112
[release timeline]: https://www.electronjs.org/docs/tutorial/electron-timelines
114113
[Slack]: https://slack.com/
115114
[Visual Studio Code]: https://code.visualstudio.com/
115+
[Browser engine]: ./browser-engine.md
116116
[WhatsApp]: https://www.whatsapp.com/
117117
[Working Groups]: https://github.com/electron/governance#working-groups

docs/compiled/compiled.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/direct-drawing/direct-drawing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
id: overview
3+
slug: /direct-drawing
4+
5+
---
6+
7+
# Direct drawing
8+
9+
TBD

docs/javascript-projection/javascript-projection.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
id: overview
3+
slug: /platform-controls
4+
5+
---
6+
7+
# Platform controls
8+
9+
TBD

docs/types.md

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,73 @@ title: Types of technologies
44

55
# Types of technologies
66

7-
As mentioned earlier, there are many types of cross-platform technologies. The most common types
8-
are:
9-
10-
* **[Web]**: Web browsers are available in a wide range of devices (like some smart appliances).
11-
While in the past they have been limited on what hardware features they could use, these has
12-
change over the last few years thanks to [Progressive Web Apps] and [Project Fugu]: File System,
13-
USB, Bluetooth...Not all web browsers implement the same set of features. The browsers based on
14-
[Chromium] (like [Chrome] and [Edge]) expose significant more features compared to those based on
15-
[Gecko] ([Firefox]) or [WebKit] ([Safari]).
16-
* **[Browser engine]**: These technologies use a browser engine to render their user interface. This
17-
means that HTML, CSS, and JavaScript are most likely the main technologies to drive use
18-
interaction. Some examples are [Electron], [Chromium Embedded Framework], [NW.js], [Tauri], etc.
19-
* **[JavaScript projection]**: In this case, most (if not all) of the app logic and UI is written
20-
using JavaScript. One significant difference with _Browser engine_ is that instead of using the
21-
web DOM to draw the UI, it uses other UI primitives and controls. These primitives and controls
22-
could be provided by the Operating System or by another graphical framework. [React Native],
23-
[NativeScript], and [NodeGui] are some examples of this category.
24-
* **[Compiled]**: These technologies have a compilation step that transform the code closer to the
25-
CPU. The languages are usually not web related, like C#, Dart, or C++. Some of them use the OS
26-
provided controls, while in others they take care of paining all the pixels in the screen. Some
27-
examples are [Flutter], [Xamarin], [Qt]
7+
There are many types of cross-platform technologies. At a high-level, they all work by exposing a
8+
common API to the developers and then taking care of the underlying specific code for each platform.
9+
The main difference is where that common API is implemented and what is exposed to the developers.
10+
It could be an abstraction to how to access common OS features, how to draw in the screen or
11+
anything in between.
12+
13+
In this website we have decided to categorize the technologies by the type of User Interface (UI)
14+
rendering strategy. This is the classification we found creates the less groups and overlappin, and
15+
is easier to rationalize. If you believe there is a better way, please [let us know][GitHub]!
16+
17+
* **[Browser engine]**: This is the category of technologies that use HTML, CSS, and JavaScript to
18+
render the UI. This includes not only web browsers, but also any other technology
19+
that users a browser engine to render the content (like [Chromium Embedded Framework], [Electron],
20+
[Ionic], etc.). There are currently 3 main browser engines that are actively maintained:
21+
* [Gecko], used by [Firefox]
22+
* [WebKit], used by [Safari]
23+
* [Chromium], used by [Chrome]
24+
25+
While in the past browsers have been limited on what hardware features they could use, these has
26+
change over the last few years thanks to [Progressive Web Apps] and [web capabilities
27+
project][Project Fugu] (known also as Project Fugu 🐡). Web developers
28+
can now access the File System, USB, Bluetooth, and more. It is worth calling out that not all web
29+
browsers implement the same set of features. Browsers based on [Chromium] expose significant more
30+
features compared to the rest.
31+
But there are still features not exposed via the Web API or particular to a given platform. In
32+
those situations developers need to look at other technologies that use a browser engine to render
33+
the UI but allow direct access to the platform. Some examples of these technologies are [Electron]
34+
(used by VS Code), [Chromium Embedded Framework] (used by Spotify), [Apache Cordova], [Ionic],
35+
[NW.js], [Tauri], etc.
36+
37+
* **[Platform controls]**: In this category the technology uses the controls (buttons, inputs, etc.)
38+
provided by the Operating System, and provides an abstraction to create these interfaces for all
39+
the supported platforms. The languages used in this category are diverse. For example,
40+
[React Native] and [NativeSript] use JavaScript, [Xamarin] uses C# and/or XAML, and so on.
41+
Applications built using these technologies usually adopt the look and feel of the platform where
42+
they are running, and thus look different depending on where they are running (e.g.: iOS and
43+
Android).
44+
45+
* **[Direct drawing]**: In here, the technologies use low-level APIs provided by the Operating
46+
System to draw directly on the screen. This means that they are also responsible for implementing
47+
any controls developers might need. For that reason, applications in this category usually have a
48+
consistent look and feel regardless of where they are running. Some of the technologies here are
49+
[Qt] and [Flutter].
2850

2951
<!-- TODO: Add a diagram representing the above -->
3052

53+
[Apache Cordova]: https://cordova.apache.org/
3154
[Browser engine]: ./browser-engine/browser-engine.md
3255
[Chromium]: http://www.chromium.org/Home
3356
[Chrome]: https://www.google.com/chrome/index.html
3457
[Chromium Embedded Framework]: https://bitbucket.org/chromiumembedded/cef/wiki/Home
35-
[Compiled]: ./compiled/compiled.md
58+
[Direct drawing]: ./direct-drawing/direct-drawing.md
3659
[Edge]: https://www.microsoft.com/en-us/edge
3760
[Electron]: https://www.electronjs.org
3861
[Firefox]: https://www.mozilla.org/en-US/firefox/new/
3962
[Flutter]: https://flutter.dev/
4063
[Gecko]: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko
41-
[JavaScript projection]: ./javascript-projection/javascript-projection.md
64+
[GitHub]: https://github.com/crossplatform-dev/crossplatform.dev
65+
[Ionic]: https://ionicframework.com/
4266
[NativeScript]: https://nativescript.org/
43-
[NodeGui]: https://docs.nodegui.org/
4467
[NW.js]: https://nwjs.io/
68+
[Platform controls]: ./platform-controls/platform-controls.md
69+
[Progressive Web Apps]: https://web.dev/progressive-web-apps/
70+
[Project Fugu]: https://web.dev/fugu-status/
4571
[Qt]: https://www.qt.io/
4672
[React Native]: https://reactnative.dev
4773
[Safari]: https://www.apple.com/safari/
4874
[Tauri]: https://tauri.studio/
49-
[Web]: ./web/web.md
5075
[WebKit]: https://webkit.org/
5176
[Xamarin]: https://dotnet.microsoft.com/apps/xamarin

docs/web/web.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
type: 'doc',
2424
docId: 'intro',
2525
position: 'left',
26-
label: 'cross-platform development',
26+
label: 'Why?',
2727
},
2828
// {to: '/blog', label: 'Blog', position: 'left'},
2929
{

0 commit comments

Comments
 (0)