Vacuous Lies: How the Glint/TypeScript transform works
Chris Krycho and Dan Freeman dig into the gnarly details of how Glint transforms #EmberJS and #GlimmerJS templates into #TypeScript. The Glint project repository: https://github.com/typed-ember/glint The Glint project documentation: https://typed-ember.gitbook.io/glint The “signatures” RFC: https://github.com/emberjs/rfcs/pull/748 Ember.js: https://emberjs.com Glimmer.js: https://glimmerjs.com PR for Signature type guide: https://github.com/ember-learn/guides-source/pull/1960 Phantom types: • In Swift: https://www.swiftbysundell.com/articles/phantom-types-in-swift/ • In Rust: https://doc.rust-lang.org/rust-by-example/generics/phantom.html • In Haskell: https://wiki.haskell.org/Phantom_type The Series: 1: https://www.youtube.com/watch?v=MLpP8D3cY7M&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=1 2: https://www.youtube.com/watch?v=Xhv1jAV5cZI&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=2 3: https://www.youtube.com/watch?v=6-TWGx8j9RU&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=3 4: https://www.youtube.com/watch?v=9RjaREOmFAA&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=4 5: https://www.youtube.com/watch?v=oqIAyLbp6Rc&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=5 6: https://www.youtube.com/watch?v=VUXROd82Ljk&list=PLelyiwKWHHApkoeXQjwKPHPAHgKXZyl3t&index=6 Chapters 0:00 Intro (We're good at this!) 0:50 Mailbag question 6:43 Starting with a very basic `template` 14:12 Adding some dynamic content 17:58 A pretend world 19:04 The `resolve` function 21:41 Why not just normal function calls? 23:21 A gnarlier `resolve` overload 24:29 Our first encounter with environments 26:18 Digging into `HelperLike` and signatures 29:28 `InvokableArgs` – the core of Glint 33:26 `Invokable` and `InvokableInstance` 34:22 Type-only symbols and phantom types 36:00 Putting these pieces together for helpers 42:33 An aside on excess property checking 44:12 The `resolveOrReturn` function 47:40 Helpers in other positions 50:30 Applying attributes 54:20 A bit about auto-import 56:20 Digging into modifiers 59:48 Wrapping up and what’s coming next
Download
0 formatsNo download links available.