Slide 1

Slide 1 text

Best Javascript Is No Javascript Radoslav Stankov

Slide 2

Slide 2 text

!

Slide 3

Slide 3 text

I ❤

Slide 4

Slide 4 text

I ❤

Slide 5

Slide 5 text

I ❤

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Radoslav Stankov @rstankov rstankov.com

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Product Hunt Architecture

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

TypeScript Migration

Slide 13

Slide 13 text

Next.js Migration

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

# Side project

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Angry Building Architecture $ % Ruby on Rails & No JavaScript ' No custom CSS, use Tailwind ( Extensive e2e tests ) Focus on domain

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

* How to avoid writing code checklist + reduce scope, by adjusting business requirement , use build-in feature of the browser - use feature from core platform - Next / React / Angular ... . use type system / move to logic backend 0 (only when I really have to) use 3rd party library (browser edition)

Slide 20

Slide 20 text

* How to avoid writing code checklist + reduce scope, by adjusting business requirement , use build-in feature of the browser - use feature from core platform - Next / React / Angular ... . use type system / move to logic backend 0 (only when I really have to) use 3rd party library (browser edition)

Slide 21

Slide 21 text

HTML CSS JavaScript

Slide 22

Slide 22 text

Plain HTML/CSS Plain HTML/CSS Everything with JS

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

:hover

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

function MyButton() { const [isHovered, setIsHovered] = useState(false); const className = isHovered ? 'button button-hover' : 'button'; const onMouseEnter = () => setIsHovered(true); const onMouseLeave = () => setIsHovered(false); return ( Button ); }

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

System Requirements

Requires a computer running an operating system. The computer must have some memory and ideally some kind of long-term storage. An input device as well as some form of output device is recommended.

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text


 ... ... 


Slide 36

Slide 36 text


 ... ... 


Slide 37

Slide 37 text

details[open] .open-hidden { display: none; } details:not([open]) .open-visible { display: none; }

Slide 38

Slide 38 text

Responsive Table

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 44

Slide 44 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 45

Slide 45 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 46

Slide 46 text

@media (max-width: 640px) { .table-component, .table-component thead, .table-component tbody, .table-component tfoot, .table-component tr { display: block; } .table-component tbody td { display: flex; } .table-component tbody td:not(.actions):before { content: attr(title); flex: 0 1 35%; display: block; white-space: nowrap; } }

Slide 47

Slide 47 text

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

1 Accessible 2 Mobile friendly 3 All batteries include ➡ No extra code 5 Single date, no range 5 Style doesn't match our site

Slide 52

Slide 52 text

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

1 Accessible 2 Build-in backdrop 3 Auto handling of forms (example: auto-focus) 6 Stops scrolling of back page 7 Auto handle of ESC 8 Style as you wish 5 JavaScript to trigger the modal version 5 JavaScript need to close dialog when click backdrop

Slide 56

Slide 56 text

import { setEventListners } from './utils'; setEventListners(document, { '[data-dialog]:click': (e) => { document .getElementById(e.target.closest('[data-dialog]').dataset.dialog) ?.showModal(); }, 'dialog:click': (e) => { if (e.target.tagName === 'DIALOG') { e.target.close(); } }, });

Slide 57

Slide 57 text

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

https://chat.openai.com/share/2d4606ad-c764-4db8-9ed5-158e90e8e391

Slide 63

Slide 63 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; }

Slide 64

Slide 64 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; } ... and the code fits on a slide 9

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; }

Slide 67

Slide 67 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px);

Slide 68

Slide 68 text

/* Tooltip base styles for any element with a title attribute */ [title] { position: relative; cursor: pointer; display: inline-block; } /* Hidden before hover */ [title]::before, [title]::after { visibility: hidden; opacity: 0; pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap;

Slide 69

Slide 69 text

pointer-events: none; } /* Tooltip text styling */ [title]::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-5px); white-space: nowrap; z-index: 10; padding: 8px; border-radius: 4px; background-color: black; color: white; text-align: center; font-size: 14px; line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before {

Slide 70

Slide 70 text

line-height: 1.2; transition: opacity 0.3s, visibility 0.3s; } /* Tooltip arrow */ [title]::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(5px); border-width: 5px; border-style: solid; border-color: black transparent transparent transparent; transition: opacity 0.3s, visibility 0.3s; } /* Show tooltip on hover */ [title]:hover::before, [title]:hover::after { visibility: visible; opacity: 1; }

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

https://open-ui.org

Slide 77

Slide 77 text

https://open-ui.org/components/selectlist

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

... in 2024/2025 :

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

https://rstankov.com/appearances