Code and Stuff
Code and Stuff
  • Видео 38
  • Просмотров 98 561
LiveView JS: The Comprehensive Guide
Unlock the full potential of Phoenix LiveView with this comprehensive guide to LiveView JS commands!
In this video, I’ll cover:
- All 19 LiveView JS commands in detail
- Examples and use cases for each command
- Tips for combining commands to create powerful interactions
- Best practices for using LiveView JS in your projects
Whether you're new to LiveView or looking to level up your skills, this guide has something for everyone. Learn how to create dynamic, responsive user interfaces without writing a single line of JavaScript!
Don't miss this opportunity to master LiveView JS and take your Phoenix applications to the next level.
Links
Screen recording software I use (affiliate): screen.studio/@Y...
Просмотров: 2 047

Видео

Automating Advent of Code Setup with Igniter
Просмотров 1,1 тыс.14 дней назад
This year I’m doing Advent of Code differently by incorporating the Igniter library, from the makers of the Ash framework. With 25 days of coding challenges, there can be a ton of boilerplate to wrestle with. What if I could generate each day’s template on the fly? It turns out, Igniter makes it easy to generate Elixir code! Links Screen recording software I use (affiliate): screen.studio/@Yy75...
Phoenix Analytics: open-source view tracking, in your app!
Просмотров 1,6 тыс.14 дней назад
A brand new Elixir package was just posted that brings analytics directly into your Phoenix applications. Check it out! Links Screen recording software I use (affiliate): screen.studio/@Yy75o Analytics demo site: theindiestack.com/analytics PhoenixAnalytics on GitHub: github.com/lalabuy948/PhoenixAnalytics Author of PhoenixAnalytics: x.com/mrpopov_com
Flavors of OAuth 2.0 - A Visual Guide to Common Flows
Просмотров 74921 день назад
Every developer should know about OAuth. In this video, I break down five key OAuth 2.0 flows: including Authorization Code, PKCE, Device Code, Token Refresh, and Client Credentials. Perfect for developers looking to understand how modern authentication works. Whether you're new to OAuth or looking to refresh your knowledge, this visual explanation will help you grasp the concepts quickly. Idea...
Building a Real-time Collaborative Whiteboard (with live_svelte)
Просмотров 1,5 тыс.Месяц назад
Discover how to create interactive, multiplayer web applications using live_svelte! Combine Svelte's excellent developer experience with Phoenix LiveView's real-time messaging to build collaborative apps-all without relying on third-party services. In this tutorial, you'll learn to: * Set up a live_svelte project * Create a real-time collaborative whiteboard * Implement multi-room functionality...
Read the Room: Measuring Air Quality with Rust and Elixir
Просмотров 2,4 тыс.Месяц назад
Join me as I build a non-trivial air quality measurement app using Rustler, bridging the gap between Rust and Elixir! Along the way, I'll show how GenServers and Phoenix PubSub can help manage state and send the latest measurements to the browser. Links Screen recording software I use (affiliate): screen.studio/@Yy75o Project source repo: github.com/ChristianAlexander/air_sensor Rustler: hexdoc...
A new open source error tracker in Elixir!
Просмотров 1,5 тыс.Месяц назад
A brand new package was just posted that brings Sentry-style error tracking directly into Elixir applications. Check it out! Links Screen recording software I use (affiliate): screen.studio/@Yy75o ErrorTracker on GitHub: github.com/elixir-error-tracker/error-tracker Demo project branch: github.com/ChristianAlexander/open_csp/pull/1/files
Chunked Responses: Scaling File Exports for Production
Просмотров 1,6 тыс.2 месяца назад
While it's possible to build file export features that work on your machine, it's important to keep track of memory usage. Using Elixir's Stream module and chunked responses, it's possible to dramatically reduce memory consumption per request-allowing your application to go further without needing massive servers. In this video, I walk through the process of optimizing a demo app's CSV export f...
Simplify React and Phoenix using Inertia JS: A quick look
Просмотров 4,2 тыс.3 месяца назад
Some of the hardest parts of React development are routing and data fetching. The Inertia JS library, originally from the Laravel community, was recently brought to Phoenix by the folks behind SavvyCal. Join me as I walk through a couple of demos that show how Inertia can fit into modern monolithic applications. Links Screen recording software I use (affiliate): screen.studio/@Yy75o Project sou...
Extending Phoenix LiveView with Hooks
Просмотров 1,6 тыс.3 месяца назад
Phoenix LiveView is typically enough to build an app, but there are times where it is necessary to boost performance or get access to browser-native behavior only available to JavaScript. Luckily, LiveView has an escape hatch for these scenarios: hooks! Join me as I walk through the process of building a simple countdown timer app with LiveView, and then improve it with a little JS. Links Scree...
How fast is your Elixir code? Find out with Benchee!
Просмотров 1,3 тыс.4 месяца назад
Benchee is a common microbenchmarking package used in Elixir and Erlang to measure the performance characteristics of functions. In this video, I show how to use Benchee with real examples-from the new OTP 27 JSON support to sorting algorithms and even Advent of Code solutions. Links Livebook Code: gist.github.com/ChristianAlexander/6c64b2df15f1dec395b341199b416e9a Screen recording software I u...
Native JSON in OTP 27! (Elixir, Erlang, Gleam)
Просмотров 2 тыс.4 месяца назад
Erlang OTP, which runs all Erlang, Elixir, and Gleam apps, now has built-in support for JSON. Soon, this will eliminate the need for third party libraries to use the web's most common data serialization format! Here's a quick preview of what the new JSON support looks like! Links Demo repo: github.com/ChristianAlexander/json-otp-27 Screen recording software I use (affiliate): screen.studio/@Yy75o
GitHub's Secret Blocks
Просмотров 1,8 тыс.4 месяца назад
GitHub's Secret Blocks
How to Track Faces in Live Video with Elixir: Quick Tutorial
Просмотров 1,1 тыс.4 месяца назад
How to Track Faces in Live Video with Elixir: Quick Tutorial
Boost Your AI Projects: Cloud GPUs + Elixir (Step-by-Step)
Просмотров 1 тыс.5 месяцев назад
Boost Your AI Projects: Cloud GPUs Elixir (Step-by-Step)
Transcribe Podcasts with Whisper AI & Elixir in Livebook
Просмотров 1,2 тыс.5 месяцев назад
Transcribe Podcasts with Whisper AI & Elixir in Livebook
Build a React JS Full Text Search - No Backend Needed
Просмотров 1646 месяцев назад
Build a React JS Full Text Search - No Backend Needed
Real-Time Techniques: Polling, Long Polling, Server-Sent Events & WebSockets
Просмотров 3256 месяцев назад
Real-Time Techniques: Polling, Long Polling, Server-Sent Events & WebSockets
Build a GPT Haiku Generator (Simple AI Tutorial)
Просмотров 168Год назад
Build a GPT Haiku Generator (Simple AI Tutorial)
Fine-Tuning GPT 3.5: From Generalist to Specialist
Просмотров 2,4 тыс.Год назад
Fine-Tuning GPT 3.5: From Generalist to Specialist
Building a ChatGPT Slackbot with Javascript
Просмотров 423Год назад
Building a ChatGPT Slackbot with Javascript

Комментарии

  • @ett9812
    @ett9812 11 часов назад

    Thanks for the great tutorial! Answered my questions about how to add a little custom JS to the front-end in a maintainable way.

  • @samulevy
    @samulevy 2 дня назад

    Awesome video!

  • @gonzadev
    @gonzadev 2 дня назад

    Your videos are great! Thanks for share!

  • @tubedudedude
    @tubedudedude 3 дня назад

    This is cool stuff! Thanks 🙏

  • @RicoTrevisan
    @RicoTrevisan 3 дня назад

    Excellent. Why no modal in the next version of Phoenix?

    • @CodeAndStuff
      @CodeAndStuff День назад

      Looks like it's part of an effort to simplify the code generated by mix phx.gen.live. github.com/phoenixframework/phoenix/pull/5900

  • @ashrodan
    @ashrodan 4 дня назад

    Why the decision to use inline render method and not have the dom elements in heex files?

    • @CodeAndStuff
      @CodeAndStuff 4 дня назад

      It just simplifies the visuals for teaching.

  • @whit6119
    @whit6119 4 дня назад

    Great video! I have been looking into LiveView JS functionality to see if these pieces you show could be used for optimistic UI updates. Can those JS commands you show respond to the server? and could they be used for this use case shown in this video from time 3:05:26 ruclips.net/video/jXyTIQOfTTk/видео.htmlsi=QrgTSO9dm-A47jf9&t=11126 Or would you need to use something like Live Svelte?

    • @CodeAndStuff
      @CodeAndStuff 3 дня назад

      That's a bit of a tricky one. There's some documentation on optimistic UIs in the liveview docs (here: hexdocs.pm/phoenix_live_view/syncing-changes.html), but it doesn't directly cover the optimistic create use case. If you strictly want the exact same behavior as that tutorial-updating the UI with a page-local state-you probably should use something like Live Svelte or build a traditional SPA (but you can still use Phoenix Channels with it to make the comms go over a websocket and enable server-to-client push). Technically, this could be written as a phx hook, but I imagine it'd be more complicated than it would be worth. If your requirements are a bit more flexible, look at async assigns (docs: hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#module-async-operations). In my experience, most of the time spent waiting for a create operation isn't a result of a slow network link. With async assigns, you can create a placeholder assignment on the socket with a loading and error state. The server can immediately push a patch to the page to show a loading indicator or optimistic item in a table, then when the processing finishes it can patch to look like a complete entry. I'm considering making a video on async assigns in the future because it's a pretty interesting solution to things like this. Let me know if you end up pursuing any of these paths!

    • @whit6119
      @whit6119 3 дня назад

      @@CodeAndStuff Thanks so much for the reply and info. I will look into the info you have provided. I would love to see a video on the async assigns. I am wondering if there are ways to make live view sites feel as snappy as SPAs. I find navigating live view sites a bit slow compared to spa.

  • @harrisonrichardson2687
    @harrisonrichardson2687 4 дня назад

    By far the best overview I've ever seen!

  • @jaredelfaz2558
    @jaredelfaz2558 4 дня назад

    I found this through Harrison Richardson's LinkedIn post, and I'm so glad I did. Thank you so much-it was definitely worth checking out!

  • @abessesmahi4888
    @abessesmahi4888 4 дня назад

    @CodeAndStuff Thank you for this great tutorial. Please do a tutorial about Ash's Spark library, next time.

    • @CodeAndStuff
      @CodeAndStuff 3 дня назад

      Thanks! I'll consider it in the future

  • @ignasiespi
    @ignasiespi 4 дня назад

    really good! the repo is super useful as well. Thanks :) as suggestions for future videos I'd be interested in phoenix streams or forms, in case it helps

  • @Kevin-hk4fv
    @Kevin-hk4fv 5 дней назад

    Great stuff thank you! Really want to learn Elixir at some point, LiveView + Svelte looks like my endgame stack

  • @solvm1652
    @solvm1652 5 дней назад

    🔥

  • @尼古拉丝土豆
    @尼古拉丝土豆 6 дней назад

    LV makes JS front-end more chaotic

  • @olafurbjarkibogason7148
    @olafurbjarkibogason7148 6 дней назад

    Thank you for all the great tutorials. Would you prefer doing it this way for future applications opposed to bringing in something like livesvelte?

    • @CodeAndStuff
      @CodeAndStuff 6 дней назад

      I'm glad you've enjoyed the videos! It depends. I'd choose livesvelte or inertia if the project strictly requires a library that only plays well with a framework like Svelte or React, or if the team working on it has deep experience with those frameworks and timelines are tight. The best stack is the one that a team is most productive with, and tradeoffs are unavoidable. That being said, you can get a ton out of the box with LiveView JS-bailing out to hooks when / if needed. I'd definitely recommend trying out a LiveView-first approach and seeing if it meets your needs, knowing you have options.

  • @TheTwyker
    @TheTwyker 6 дней назад

    this is so fucking cool, thanks man!

  • @Ketupia
    @Ketupia 6 дней назад

    at 12:47 you make the comment that the next version of phoenix won't include a modal by default. Where can I read more about that plan?

    • @CodeAndStuff
      @CodeAndStuff 6 дней назад

      x.com/rootcert/status/1836035549377003551

    • @CodeAndStuff
      @CodeAndStuff 6 дней назад

      github.com/phoenixframework/phoenix/pull/5900

  • @QuentinDurot
    @QuentinDurot 6 дней назад

    Thank you so much!!

  • @aviagarwal3011
    @aviagarwal3011 6 дней назад

    Excellent overlap of introductory information and high-quality production!

  • @webspaceadam
    @webspaceadam 6 дней назад

    this is awesome. great job

  • @reinettetinekerr219
    @reinettetinekerr219 6 дней назад

    Are you hacking my brain? How do you always know what I want to know 😅

  • @juliolinarezescobar
    @juliolinarezescobar 6 дней назад

    Awesome project.

  • @guglielmobartelloni
    @guglielmobartelloni 6 дней назад

    Yours are the best tutorials on elixir man. I would really love to work with elixir instead of java :(

    • @CodeAndStuff
      @CodeAndStuff 6 дней назад

      Thanks! I’d love to write Elixir at work too, but companies love their JS, Python, Ruby, etc… Some day Elixir will catch on!

  • @webspaceadam
    @webspaceadam 14 дней назад

    Your channel is such a gem for the elixir community. High production value, great scripting and a admirable host. Like it a lot

    • @CodeAndStuff
      @CodeAndStuff 12 дней назад

      Thank you! I've been having a lot of fun sharing projects with this community. Comments like these keep me motivated!

  • @ream88
    @ream88 16 дней назад

    Alright, I’ve finally hit the notification bell for you!

  • @guglielmobartelloni
    @guglielmobartelloni 16 дней назад

    Cool man thank you. Always helpful

  • @delamberty
    @delamberty 16 дней назад

    I am a big fan of Ash. Now, will be looking into Ash.

  • @ashframework
    @ashframework 16 дней назад

    Such a well made video 🤩

  • @CashCatz
    @CashCatz 18 дней назад

    I don't love the DuckDB dependency. Why not just use Postgres? At least as an option.

    • @CodeAndStuff
      @CodeAndStuff 17 дней назад

      You're not alone! In fact, Postgres is coming soon: github.com/lalabuy948/PhoenixAnalytics/pull/10

  • @becs-ps1bb
    @becs-ps1bb 19 дней назад

    not just some piece of text?

    • @CodeAndStuff
      @CodeAndStuff 19 дней назад

      I’m not sure I understand, are you wanting to reverse a blob of text character-by-character?

    • @becs-ps1bb
      @becs-ps1bb 19 дней назад

      @@CodeAndStuff Sorry, I explained myself poorly. Imagine two lines: on the first line we have wheelright::volumeup, and on the second line we have wheelleft::volumedown. Is it possible to swap only wheelleft and wheelright to get wheelright::volumedown and wheelleft::volumeup?

    • @CodeAndStuff
      @CodeAndStuff 19 дней назад

      Oh, that makes sense. Definitely not something supported by the extension in its current state since it considers each selection in isolation.

    • @becs-ps1bb
      @becs-ps1bb 19 дней назад

      @@CodeAndStuff . oh thanks! any suggestions? is there any extension that does what i ask that you know of?

    • @CodeAndStuff
      @CodeAndStuff 18 дней назад

      Looks like this one might do it: marketplace.visualstudio.com/items?itemName=SSDiver2112.SwapSelection Edit: just saw that it’s a visual studio extension, not VS Code. This would be pretty easy to build though!

  • @desireco
    @desireco 20 дней назад

    Awesome, excellent resource

  • @dhonydev
    @dhonydev 20 дней назад

    Awesome. I’ve been studying the DuckDB for a while and this is a perfect fit for it.

  • @joga9665
    @joga9665 20 дней назад

    Really nice video. I will probably share this link quite often :D

  • @guglielmobartelloni
    @guglielmobartelloni 20 дней назад

    This is so useful

  • @felipe-rodriguees
    @felipe-rodriguees 20 дней назад

    Thanks for sharing.

  • @PhilKingstonByron
    @PhilKingstonByron 20 дней назад

    Great!

  • @DanielBergholz
    @DanielBergholz 20 дней назад

    Very cool! Thanks for sharing!

  • @anatolydyatlov963
    @anatolydyatlov963 21 день назад

    How do you manage large projects in Phoenix without expressive types for your Ecto queries, which would provide IntelliSense hints? In general, when passing events with payloads between the frontend and backend, I can't imagine not having something as basic as a list of properties for those payloads when inspecting them in the editor. It's almost like working blindfolded. Honestly, I don't get the hype around Phoenix and Elixir. The developer experience is significantly worse compared to using React with RTK-Query and auto-generated RTK API definitions.

    • @CodeAndStuff
      @CodeAndStuff 20 дней назад

      There's a similar discussion going on right now on the Elixir subreddit: www.reddit.com/r/elixir/comments/1fcn0v0/how_do_you_manage_without_intellisense_especially/ There are always tradeoffs with any technology choice. Elixir provides trivial near-real-time messaging, the strength of the beam VM, and a very welcoming community. With the three current language server implementations in Elixir joining forces, I think we'll see great advancements in editor hints. It's possible to build great apps without leaving Elixir, but when there's a ton of frontend interactivity it may be necessary to introduce a JS UI. If type annotations are critical in an app-as they might be when there are many contributors-it's not hard to define types somewhere in a .d.ts file. It won't automatically be updated, but hopefully the type system isn't the only source of testing in the app. If you find React + RTK-Query to be productive, use it! If you need to sprinkle in some websocket interactions and want a scalable backend to support it, consider layering in Elixir or relying on a third party like Pusher. At the end of the day customers care more that you shipped, not what stack you used to ship it.

    • @anatolydyatlov963
      @anatolydyatlov963 18 дней назад

      ​@@CodeAndStuff I really appreciate you taking the time to respond, thank you! Funnily enough, I'm the author of that reddit thread. I decided to ask in a few places at the same time, expecting either to be ignored or receive unhelpful responses. However, I was very pleasantly surprised when the exact opposite happened. The Elixir community turned out to be incredibly welcoming and helpful. You're totally right - everyone has their own approach to development. In my case, I wanted to try something new and fell in love with Phoenix's features and philosophy. At the same time, the sudden lack of immediate feedback from IntelliSense was very jarring. Nevertheless, the plans to improve the language server give me hope. With that in mind, I've decided to stick with Phoenix and work on overcoming my reliance on type hints for now. Im looking forward to seeing how the DX evolves, and I have to admit, it seems that shipping new features in this stack will be much faster when compared to what I was used to. Thanks again for your insights <3

  • @theowenmccarthy
    @theowenmccarthy 23 дня назад

    This is an awesome overview!

  • @ethicalpap
    @ethicalpap 23 дня назад

    I love this, very well done! 🔥

  • @conradtaylor29
    @conradtaylor29 24 дня назад

    Great example of combining Elixir with Rust!!!!!

  • @omarsayed6344
    @omarsayed6344 29 дней назад

    First time commenting on any RUclips video, but I love your style! Please do more cool elixir stuff.

  • @nullzeon
    @nullzeon Месяц назад

    this channel is so useful, Elixir so underrated!

  • @abessesmahi4888
    @abessesmahi4888 Месяц назад

    Great tutorial as always, Thank you so much for your efforts.

  • @ignasiespi
    @ignasiespi Месяц назад

    Great video as always!

  • @choptran
    @choptran Месяц назад

    Really great video. Thank you <3

  • @kalogs13
    @kalogs13 Месяц назад

    Awesome video! Thanks

  • @JoelKallstrom-jp6gr
    @JoelKallstrom-jp6gr Месяц назад

    This was great!

  • @samulevy
    @samulevy Месяц назад

    Really cool. Keep it coming, this channel has a huge potential!

  • @joemartinez3218
    @joemartinez3218 Месяц назад

    We not gonna talk about how it's 80 degrees in his office!

    • @CodeAndStuff
      @CodeAndStuff Месяц назад

      Haha, it’s hard to record with the AC background noise and it was like 110 degrees F outside!