- Видео 170
- Просмотров 541 819
Daniel Bergholz
Бразилия
Добавлен 27 июл 2019
Hello there! My name is Daniel Bergholz, I'm a Fullstack Developer from 🇧🇷. I usually talk about JavaScript and Elixir and sometimes drop a tutorial or two. If that sounds fun to you, subcribe to my channel 🤘
Elixir crash course #21: ExUnit (unit testing)
Check my website:
bergdaniel.com.br/
Documentation:
hexdocs.pm/ex_unit/
Course content:
0:00 - Intro
0:21 - The "wrong" way of testing
2:14 - Running tests with "mix test"
4:20 - Writing tests for the Users module
4:44 - Test script inside mix.exs
5:59 - The "use" macro
7:30 - Running tests in parallel
8:03 - doctest (testing code inside documentation)
9:30 - Testing Users.new/0
12:05 - Testing Users.new/2 (with "Daniel")
13:57 - Contexts
15:00 - Callbacks (setup and setup_all)
17:23 - Pattern Matching the context
18:35 - Test coverage
bergdaniel.com.br/
Documentation:
hexdocs.pm/ex_unit/
Course content:
0:00 - Intro
0:21 - The "wrong" way of testing
2:14 - Running tests with "mix test"
4:20 - Writing tests for the Users module
4:44 - Test script inside mix.exs
5:59 - The "use" macro
7:30 - Running tests in parallel
8:03 - doctest (testing code inside documentation)
9:30 - Testing Users.new/0
12:05 - Testing Users.new/2 (with "Daniel")
13:57 - Contexts
15:00 - Callbacks (setup and setup_all)
17:23 - Pattern Matching the context
18:35 - Test coverage
Просмотров: 222
Видео
Elixir crash course #20: Structs
Просмотров 352День назад
Check my website: bergdaniel.com.br/ Documentation: hexdocs.pm/elixir/structs.html Course content: 0:00 - Intro 1:05 - defstruct 3:00 - Default values 3:42 - Mandatory fields (@enforce_keys) 5:04 - Refactoring the existing code 6:40 - Pattern matching 9:22 - Examples on TechSchool
How to increase Elixir adoption?
Просмотров 1,2 тыс.14 дней назад
Check my website: bergdaniel.com.br/ Original tweet: x.com/danielbergholz/status/1852705718429790579
What is Phoenix LiveView? Is it similar to React?
Просмотров 2,7 тыс.14 дней назад
Check my website: bergdaniel.com.br/ Video content: 0:00 - Intro 0:22 - What is LiveView? 0:54 - LiveView example 1:33 - Inspecting the WebSocket 3:47 - Next.js example 5:34 - React VS LiveView code 7:16 - UI code from LiveView 8:40 - mount() 9:22 - handle_params() 10:05 - handle_event("load_more") 13:00 - Every user opens a WebSocket connection???
Elixir crash course #19: Anonymous functions
Просмотров 23714 дней назад
Check my website: bergdaniel.com.br/ Documentation: hexdocs.pm/elixir/anonymous-functions.html Course content: 0:00 - Intro 0:19 - What is an anonymous function? 0:58 - Multi-line function 1:18 - Shorter syntax with "&" 4:09 - Using a named function 6:38 - Examples on TechSchool
Phoenix got authentication right
Просмотров 5 тыс.21 день назад
Check my website: bergdaniel.com.br/ Resources listed: - github.com/lucia-auth/lucia/discussions/1714 - hexdocs.pm/phoenix/mix_phx_gen_auth.html - dashbit.co/blog/a-new-authentication-solution-for-phoenix
Elixir crash course #18: Enums (map, each, filter)
Просмотров 27521 день назад
Check my website: bergdaniel.com.br/ Documentation: hexdocs.pm/elixir/enumerable-and-streams.html Course content: 0:00 - Intro 1:20 - Enum.filter (in lists) 5:34 - Enum.map (in lists) 8:40 - Enum.each (in maps)
The only frontend frameworks worth your time
Просмотров 3 тыс.28 дней назад
Check my website: bergdaniel.com.br/
Elixir crash course #17: Recursion
Просмотров 325Месяц назад
Join this channel to get access to perks: ruclips.net/channel/UCnmbV9eyMwIl50Ji1ObFxqgjoin Check my website: bergdaniel.com.br/ Documentation: hexdocs.pm/elixir/recursion.html Course content: 0:00 - JavaScript example 0:57 - Recursion 2:29 - Example: Count 6:36 - Example: Total
Indie hacking became the next gold rush
Просмотров 733Месяц назад
Check my website: bergdaniel.com.br/ Source: x.com/adamc0dez/status/1843699599162184064
Stop Ignoring OG Images
Просмотров 1,6 тыс.Месяц назад
Check my website: bergdaniel.com.br/ Websites mentioned: highperformancesqlite.com/ remix.run/blog/merging-remix-and-react-router github.com/remix-run/remix-website/tree/main/app/routes/img.$slug
Elixir crash course #16: Conditionals (case, cond, if)
Просмотров 404Месяц назад
Elixir crash course #16: Conditionals (case, cond, if)
React Router v7 will save your legacy SPA
Просмотров 3,5 тыс.Месяц назад
React Router v7 will save your legacy SPA
Stop wasting time learning new React.js frameworks
Просмотров 3,1 тыс.Месяц назад
Stop wasting time learning new React.js frameworks
DHH is right about (almost) everything
Просмотров 1,9 тыс.Месяц назад
DHH is right about (almost) everything
What and how to test frontend applications
Просмотров 1,5 тыс.Месяц назад
What and how to test frontend applications
Why I migrated my website from Astro to Next.js
Просмотров 2,6 тыс.Месяц назад
Why I migrated my website from Astro to Next.js
How I replaced social media with books
Просмотров 1,5 тыс.Месяц назад
How I replaced social media with books
Moving back to JavaScript after my Elixir journey
Просмотров 4,7 тыс.Месяц назад
Moving back to JavaScript after my Elixir journey
Elixir crash course #14: Pattern matching
Просмотров 3392 месяца назад
Elixir crash course #14: Pattern matching
Elixir crash course #12: Pipe operator
Просмотров 4533 месяца назад
Elixir crash course #12: Pipe operator
Elixir crash course #11: Module attributes
Просмотров 4253 месяца назад
Elixir crash course #11: Module attributes
Elixir crash course #10: Import and alias
Просмотров 3763 месяца назад
Elixir crash course #10: Import and alias
What makes Theo overlook AdonisJS? Is it the allure of Vercel’s sponsorship? or the convenience of the built-in S3 integration that scares him? 🤔
In other videos, he mentioned that having a framework generate lots of files scares him, so maybe it's because of that? 😂
I like the idea behind Elixir/Phoenix, but the language is not widely adopted. In my previous startup incubator, it's now forbidden, only Python and TS are allowed (to maintain consistency).
Thanks for your wisdom
Love it, thank you for sharing!
AFTER: You're absolutely right about the attitude - that is what makes or breaks this whole thing, and everything gets derived from that.
BEFORE: 10x developers are overhyped, but there competency is a spectrum. A person is good at some things, and really bad at others. For example I'm decent at figuring out what stakeholders want, and then couple together libraries and tools to build the features and functions to suit their needs. But ask me to do some low-level graphics programming and I'll just go and cry in the corner instead.
Awesome. Exactly right. Logical architecture first
Great content Daniel. Visually very clear. Null vs nil...null like seaGULL, nil like blackPILL...
Thanks, keep up with the elixir content, the internet is already full of js content, its hard to find some good content like yours!
Thank you! Elixir definitely needs more free content on RUclips 🚀
@@DanielBergholz Definitely. If I can give a suggestion: I'm starting to learn elixir, and its my first functional language, so I still need to adjust the way of thinking in a elixir way. Would help a lot to see someone solving some problems using elixir, I already watched a lot of talks, and did almost every tutorial, but there are very few coding content out there. I would love to see Advent of Code in elixir, I think that would help to think through a problem using elixir. Thanks!
My opinion on this and what i'v been looking lately is more coding content, because the syntax is unfamiliar so we need to adapt our way of thinking to solve problems. Advent of Code is a nice one, but we need more side projects coding to show how to solve problems in a elixir way.
estou estudando ruby on rails e é delicinha
skill issue
One important feature you left out that I found interesting is the Inertia.js package. It allows you to bind your view pages with your backend without using rest api or graphql. I believe this eliminates the need for cache handling and pending states.
Great video!@
I actually understand this now! Nice video! Really enjoying the elixir content.
Whats crazy about this video is that at any point you tried to read the docs...
Thanks for all your elixir videos. The problem with Elixir/ Phoenis is that if you want to learn it, you almost immediately have to pay for courses, because there is far too little available for free on RUclips. Especially when you look for free Phoenix tutorials, you will see far too few. I would like to learn elixir/phoenix and live view, but I don't feel like throwing 100 euros or so on it right away. Don't get me wrong, I think you should pay for quality, but there should be a free step where you learn enough to start your own app from coding to installing it on a VPS. Unfortunately I don't see it and that's why I'm busy learning Rails because there is plenty out there about it. Rails has a complete framework including installation on a VPS. I think that's the path elixir needs to take as well if you want to get new "lonely" coders. I just think it's a shame that you don't have any content on Rails, because something about you makes you a great instructor
Spoiler alert, I think you will enjoy my next free crash course 👀
As the years go by, I increasingly believe that the web is heading in the wrong direction, trying to solve problems that have already been solved, creating new problems to justify this! Of course, there are scenarios where tools like Next.js are a possible solution. However, I believe that it does not exceed 10% of the market! The rest is the same as microservices: it became the standard because they thought it would be better.
To be honest Nuxt 3 js isn't any better. it also has it's bugs.
So good content! I'm happy to have discovered it today:)
I am really struggling with understanding the use case for next.js and I run next.js in production with paying users.
@@nickross4059 😂 that’s relatable, every time I use nextjs I question my decision
Just move to Vue/Nuxt. There are many jobs, at least in the north east of the US, and all of this crap doesn't happen much at all.
The fix is in the docs, you can find it in route segment config, it states: The values of the config options currently need be statically analyzable. For example revalidate = 600 is valid, but revalidate = 60 * 10 is not.
Nice, thanks a lot!
@@DanielBergholzcan you confirm please if that works?
@@adrian110288 it worked!
Awesome, I have learnt something new today 😊thanks for tryint
JS ==Just ShootMe
😂
What are the theme and font that you use on vscode?
Bearded theme arc and fira code
ive had similar problem i didnt find a way to make page static with timer on revalidate only way i find to update the data was making page dynamic that wasnt what i wanted but didnt find other solution that worked. Tell me if you find out!
Have you tried sveltelive and Phoenix?
I cannot express in words the amount of frustration i've had when creating a personal project to learn Next, I had so much problems with cache in dev server that I didn't even want to see how it would work in production, just this experience alone was enough for me to quit on next/react ecossystem
@@vinizote1209 I should have stopped with Next.js the moment I realized caching was a nightmare
you can try using the revalidatepath which i think should invlidate the cache and fetch the new data
@@createbusiness-p6u I think you’re supposed to use that whenever you update something any type of record on the codebase, and I’m not doing that, I’m just fetching playlists from the RUclips API
Put nextjs in trash and use Astrojs
While watching, I wanted to say if it does not work then you should apply for a new job as a Senior NextJS Ambassador / DevRel person. 😁 So that's my take at this point. 😁
Does using Tanstack Query or Redux solve this? I'm new to Next.js and finding that anything specialised by Next.js is better handled by Tanstack or Redux, such as validation and caching.
Try to use the next 14 with the pages router. It doesn't try to look like a frontend and backend framework; it's just a frontend framework with a small BFF layer, and that works just fine.
@@nullush I don’t think “downgrading” my code is a good idea. Next.js has historically been horrible maintaining legacy features. Real soon they will deprecate the pages router or best case scenario, just stop working on it (with bug fixes and security updates)
@DanielBergholz what makes you think that it'll be ever deprecated? It's still getting updates. You can use pages router with next.js 15. For me as a frontend developer, app router is a downgraded version. Because it doesn't have router events. It'll never have full support for view transitions API. The only way to achieve fast navigation in app router is by prefetching every link. It's easier to create waterfalls and security vulnerabilities.
@@DanielBergholz overall, I think that making router server-centric was a bad idea. I think Remix/tanstack-start chose right direction
Next JS 15 will solve all your problem, because now the default of all Next JS caching is "no-store"
@@ibnurasikh it’s funny how everyone always says something like: “don’t worry bro, next js version 439 will fix it all!”, but most problems still persist. I like the fact that everything is dynamic by default, but I think “use cache” is extremely confusing
I come from a Ruby on Rails background, which has received a lot of criticism over the years for being opinionated. Sure, Rails has many complex default behaviors, but you can easily override or skip them, and in over 10 years of running production applications, this has never been an issue. Next.js, on the other hand, takes being opinionated to another level. There are many things you have to do exactly the way Vercel devs intended, or you won’t be able to do them at all.
@@adamk8724 exactly! And JS devs say rails has “too much magic” while they have an extremely complex and 0% transparent caching mechanism
I'm feeling the same. But I'm feeling super homeless in the JavaScript ecosystem. I'm thinking of saying fuck it and going to Laravel/Django and doing it the old-fashioned way.
@@jamilawada389 I did exactly this but with Elixir and Phoenix
Theo the terrible
What is driving me crazy is that you didn't just do a git revert when changing back the code 😂
@@cahva2 oh right, good point 😅
E o inglês tá o fino do fino
@@2viniciusms obrigado!
Another reason I use Angular, its so under rated now, definitely recommend you try it :)
have you thought about using remix
@@madhatter2744 yes! Remix is actually going to become react router V7, I’ll make content about it in the future!
Remix is basically React Router + Vite, so they've suspended Remix work to focus on React Router.
I noticed you are using next.js 14.x.x, they recently made version 15 stable and think they fixed many of these cache issue
Going through the same thing at work with NextJS. It never acts the way you expect it to. It's always different.
@@Hypawolf no matter how much we read the docs, there is ALWAYS some magic going on underneath that we don’t understand
@@DanielBergholz I am not a NextJS user but from the outside it seems to me that they literally do not even try... I mean it is just not the focus... The focus is to make people think they are the problem... Glad to see what Remix / React Router does though...
Heres what i thought was going on, export const revalidate is just a "syntactic sugar" for cdn caching using the s-maxage, but then you changed to ssr for courses route and it worked. Wait what ??? 😭. It shoudnt have worked and now i am even more confused. Specially now there is a fking "use cache" thing thats a one for all thing, thats more confusing to me as i know there cant be a one for all thing, because there are multiple types of caching, from server caching on redis(or any other external source like KV), then there is http caching, cdn caching, route cache. I think it was better earlier everyone started to understand it but now i am fu*ked 😡
I moved from next to tanstack start and never looked back. It's been amazing. Highly recommend it!
"Cached data is persisted across deployments, unless invalidated through revalidate or programmatically calling revalidateTag or revalidatePath. It is not updated at build time. When invalidated, it will be updated at run time with the next new request to the path that was invalidated." The data cache is working as intended. Just because you added a revalidate on that fetch call doesn't mean the request changed... the vercel data cache layer still recognized the fetch (likely just by the url path as the cache key) and served up the cached data. It's the framework's job to bust the cache and tell vercel's data cache to serve updated data. After you built again with the revalidate added in and then when you visited to live page the Next.js server started its timer to revalidate the data cache in ONE DAY from then. Which means the next request to hit that page will cause the next.js server to re-render that "static" route and serve it up from the cache until the next revalidate call.
Then why did it work when he, removed revalidate and changed the route to SSR?
@@dwolrdcojp I literally waited 1 entire week before recording this video, my revalidate of 1 day was completely useless
@@DanielBergholz lol fair. throw next in the bin
As I understand 1day revalidate is working like you need to make a request after 1 day to start revalidation and only next request will be updated @DanielBergholz
@ I was visiting my website everyday to check if the Phoenix crash course was there, and it wasn’t
Well, in development we have to delete the .next folder in case this caching bug happens, idk how to do this i production in vercel.
@@matheuspegorari1094 once you find out, please let me know 😅
I think the problem is that you're not using nvim. Thank me later
@@rinseyaron from now on I’ll just use neovim (BTW)
Boa pronúncia do inglês e bom video, topp