Slide 1

Slide 1 text

Christian Liebel @christianliebel [email protected] Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘

Slide 2

Slide 2 text

https://paint.js.org – Productivity app – Draw images – Lots of actions & tools – Installable – Read/save files – Copy/paste images from/to clipboard – Share files to other apps – Register for file extensions Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Demo App LIVE DEMO

Slide 3

Slide 3 text

Paint PWA Capabilities Progressive Enhancement Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Agenda

Slide 4

Slide 4 text

Browser Support Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Paint Canvas element βœ“ βœ“ βœ“ 2D rendering context βœ“ βœ“ βœ“ Γ  always build apps for the browser

Slide 5

Slide 5 text

Paint PWA Capabilities Progressive Enhancement Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Agenda

Slide 6

Slide 6 text

@christianliebel Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ Responsive Linkable Discoverable Installable App-like Connectivity Independent Fresh Safe Re-engageable Progressive

Slide 7

Slide 7 text

Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Web App Manifest Service Worker

Slide 8

Slide 8 text

Schematic ng add @angular/pwa Angular PWA Support @christianliebel Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ LIVE DEMO

Slide 9

Slide 9 text

Browser Support Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Progressive Web Apps Offline Availability βœ“ βœ“ βœ“ Installability βœ“ (iOS/iPadOS only) (Android only) Push notifications βœ“ macOS: Ventura iOS/iPadOS: 2023 βœ“

Slide 10

Slide 10 text

Paint PWA Capabilities Progressive Enhancemen t Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Agenda

Slide 11

Slide 11 text

Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel

Slide 12

Slide 12 text

Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Capabilities https://goo.gle/fugu-api-tracker

Slide 13

Slide 13 text

Browser Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Capabilities navigator.share({ url: 'http://example.com' }); ShareIntent DataTransferManager … NSSharingServicePicker

Slide 14

Slide 14 text

File System Access API Some applications heavily rely on working with files File System Access API allows you to open, save and overwrite files and directories Supported by Chrome, Edge Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Capabilities

Slide 15

Slide 15 text

API const [handle] = await self.showOpenFilePicker({ multiple: true, types: [{ description: 'PNG files', accept: {'image/png': ['.png']} }] }); Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel File System Access API LIVE DEMO

Slide 16

Slide 16 text

Async Clipboard API Allows reading from/writing to the clipboard in an asynchronous manner Reading from the clipboard requires user consent first (privacy!) Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Capabilities

Slide 17

Slide 17 text

API CopyContent await navigator.clipboard.writeText('foo'); await navigator.clipboard.write(/* data */); Paste Content const content = await navigator.clipboard.readText(); const content = await navigator.clipboard.read(); Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Async Clipboard API LIVE DEMO

Slide 18

Slide 18 text

File Handling API Register your PWA as a handler for file extensions Requires installing the application first Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Capabilities

Slide 19

Slide 19 text

Manifest Extension { "file_handlers": [{ "action": "/", "accept": { "text/plain": [".txt"] }, "icons": [] }] } Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel File System Handling API

Slide 20

Slide 20 text

API if ('launchQueue' in window) { launchQueue.setConsumer(async params => { const [handle] = params.files; // do something with the handle }); } Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel File System Handling API LIVE DEMO

Slide 21

Slide 21 text

Browser Support Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Capabilities Async Clipboard API βœ“ βœ“ (writeText() only) File System Access (Desktop only) β€” β€”

Slide 22

Slide 22 text

Paint PWA Capabilities Progressive Enhancement Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Agenda

Slide 23

Slide 23 text

Overview if ('showSaveFilePicker' in window) { const handle = await window.showSaveFilePicker(); // … } else { // a) fall back to an alternative API (if available) // b) disable/hide functionality } Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Progressive Enhancement

Slide 24

Slide 24 text

Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel VS Code https://vscode.dev/

Slide 25

Slide 25 text

Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Photoshop https://creativecloud.adobe.com/cc/photoshop

Slide 26

Slide 26 text

Capabilities (2021 Γ  2022) Async Clipboard 8.91% Γ  10.10% (percent of desktop websites) File System Access 29 Γ  2,317 (+7889%) (desktop websites) https://almanac.httparchive.org/en/2022/capabilities Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel 2022 Web Almanac

Slide 27

Slide 27 text

πŸ…°πŸ’˜πŸ‘ Building desktop-class productivity apps with Angular and Project Fugu πŸ…°πŸ’˜πŸ‘ @christianliebel Summary

Slide 28

Slide 28 text

Thank you for your kind attention! Christian Liebel @christianliebel [email protected]