~/talk

Advanced patterns for v2 addons

Talkat EmberFest 2023 · 2023-09-21..09-22· [ember, frontend-architecture]
slides:none on file

v2 addons are static npm packages using a pull-based v2 addons approach instead of V1’s push model, so nothing ships unless the app imports it. CSS and images are imported from the addon and an import yields a public, fingerprinted URL — with a webpack/Vite loader that returns a JS module exposing that URL (import returns fingerprinted URL). Lazy loading works by dynamic-importing addon modules (example: threejs scene becomes a separate chunk). Build-time processing ships as separate webpack/Vite loaders (example: responsive-image uses sharp and emits resized files). For conditional compile-time behavior use embroider macros: dependency-satisfies, import-sync which strip dead code.

AI-written summary · about

  1. 0:00Introduction to V2 addons
  2. 6:54Pull-based vs push-based approach
  3. 7:14Importing CSS in V2 addons
  4. 10:06Importing static assets
  5. 14:43Lazy loading dependencies
  6. 28:22Build plugins for apps
  7. 34:23Embroider macros for dynamic code
  8. 38:00Resources and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.