Petal Components - ElixirCasts

In this episode, we’ll learn how to use Petal Components in a Phoenix application.

https://elixircasts.io/petal-components

The Comprehensive Guide to Elixir's List Comprehension

List comprehensions are one of my favorite features of Elixir and I am excited to finally be writing about them! In the article I go over every single feature and option of the comprehension, how to use them, and how they compare to Enum and recursive functions.

https://www.mitchellhanberg.com/the-comprehensive-guide-to-elixirs-for-comprehension/

IntelliJ Elixir v13.1.0

Changelog

v13.1.0

Enhancements

  • New Project > Language > Elixir includes all mix options

    • –app
    • –module
    • –sup
    • –umbrella
  • Add mix format external formatter. Requires project or module SDK be set in order to run. If the SDK is not available, only the internal formatter will be used. The internal formatter is still used for file subsection formatting and new line indenting as mix format works at the file-level.

    • Allow mix format external formatter to be disabled.
      1. Preferences
      2. Editor > Code Style > Elixir
      3. Click the mix format tab
      4. Expand the General group
      5. Uncheck “Format files with mix format“.
  • Support Elixir 1.13.0 in debugger.

Bug Fixes

  • Look above CallDefinitionImpl for Type scope processing It should go up to the ModuleImpl to find the TypeDefinitionImpl.
  • Have Credo Global Inspection use standard Mix.commandLine used for Run Configurations.
    • Allow environment variables to be set similar to Run Configurations for projects that require environment variables to be set for Mix tasks due to checks in their config.
    • No longer support Include Explanations as it takes too long to run.
    • Remove annotator until it can be re-implemented in performant manner using corrected environment and SDK from Global Inspection.
  • Fix Find Usages that resolve to compiled types.
    • Add element description for TypeDefinitionImpl
      • Node Text is @<module_attribte> <name>(<parameters>) :: …
      • Long Name and Short Name are just the name
      • Type is type
    • Mirror TypeDefinitionImpls to types in decompiled source. Allow TypeDefinitionImpl.getNavigation to go to decompiled types.
  • Allow types with atom keyword names to be highlight even though they are invalid names.
  • Restore Project configuration for Small IDEs. I dropped an ! when converting from equals to == when fixing the deprecation warnings, which made the Project SDK selection only be HIDDEN where it needed to be SHOWN.
  • Catch StackOverflowError in find_usages.Provider.getType().
  • Element descriptions for CallDefinitionImpl
  • Highlight CallDefinitionImpl references as predefined if resolved CallDefinitionImpl is in Kernel or Kernel.SpecialForms. Fixes highlighting def and other defined when using SDKs without source like Homebrew after the delayed-decompilation fixes from 12.2.1. Now source-less (Homebrew) and SDKs with sources (ASDF) will both be able to highlight predefineds.
  • No longer record the SDK name as an attribute of the Facet configuration, as it didn’t write back changes.
    • Instead detect the Elixir SDK by finding any of the libraries that have an Elixir SDK name in the module. (The Elixir SDK was already being added as a library to allow indexing the SDK.)
  • Clear out any existing Elixir SDKs listed as module libraries before setting a new SDK. This eliminates the duplicates that happened before. (It turns out the JetBrains API doesn’t prevent duplicates. Oopsie.) It also ensures that no SDK is recorded if the SDK is deselected in the UI, which wouldn’t happen before.
  • In IntelliJ 2022, the New Project dialog changed and it no longer automatically listed ModuleType.getBuilder ModuleBuilders as potential project builders, so it looked like Elixir New Project support disappeared. Fix this by implementing the newProjectWizard.language extension that was added to control the Language switching in the new New Project dialog.
  • Remove references to ElementClassHint in BeamFileImpl that only work in IntelliJ. ElementClassHint is part of the processDeclaration system used in Java and so was in the code because BeamFileImpl was original based on ClassFileImpl, but since the Elixir resolvers don’t use the hint system at all, it can just be removed.
  • Fix environment not being passed to debug runs of ESpec and ExUnit Run Configurations. The env from the Configuration was dropped because a local env was created to set MIX_ENV true.

Installation Instructions

🎉 Announcing the Paraxial.io Beta Launch!

Paraxial.io protects your Elixir/Phoenix application from bots attempting automated logins, scraping, and disruption of service. Today we are happy to announce the beta program is open to new users!

To sign up, email support@paraxial.io with a brief description of your website. The beta is open to anyone with an Elixir/Phoenix application, from a personal project to larger corporate site.

https://paraxial.io/blog/beta-announcement

ThinkingElixir 101: Replicating SQLite using Litestream with Ben Johnson

In episode 101 of Thinking Elixir, Ben Johnson explains his project Litestream.io, an OpenSource tool that replicates SQLite databases to remote servers and to backup locations like S3 for durability. We talk about how moving data out to the user creates true edge applications. We discuss what types of problems this helps solve, the architectures that become possible, and how a globally distributed Phoenix application could use this. He shares how Fly.io acquired the project and brought him on full-time to continue his work on it. Fascinating discussion that challenges many of the assumptions about how we’ve been building “web” systems for years.

https://podcast.thinkingelixir.com/101

Algebraic Data Types in Elixir

Discover the ins and outs of ADTs and their benefits for your Elixir app. https://blog.appsignal.com/2022/05/31/algebraic-data-types-in-elixir.html

TIL: Temporary data folder

The temporary directory for data storage is often used. However, /tmp dir is not always a good solution. Depending on the configuration, it can be represented differently. Check how you can fix it with simple modification.

More on: https://bartoszgorka.com/til-temporary-data-folder

ExMarcel: A Library for MIME type detection based on magic numbers

Marcel attempts to choose the most appropriate content type for a given file by looking at the binary data, the filename, and any declared type. This package is a port of Rails’s Marcel library. https://github.com/chaskiq/ex-marcel

[Poll] What is the oldest version of Elixir you use to run Wallaby?

Link to poll: https://twitter.com/elixir_wallaby/status/1531356768332353543?s=20

Boost your test coverage with Elixir

In this article, I will help you build the appropriate tooling to track and measure your test coverage, and hopefully improve it.

https://www.christianblavier.com/boost-your-test-coverage-with-elixir/

Elixir Meetup #6 hosted by Curiosum

Elixir Meetup #6 on June 8, 2022 at 18 CET

Where? 👉 ONLINE & FREE

Register 👉👉 https://curiosum.com/meetups/elixir

🔥 Speakers 🔥

  1. Gustavo Oliveira - Use TDD step by step with live view
  2. Adolfo Neto - Learning Erlang and Elixir through exercises and the advent of code

Simple Dependency Injection in ExUnit

Smart testing strategies for Elixir with Dependency Injection design pattern: https://k.lelonek.me/simple-di-in-elixir

Conference report: Code BEAM, Stockholm 2022

I wrote up my experience at Code BEAM in Stockholm this year.

I really enjoyed it :) https://underjord.io/code-beam-sto-2022.html

Elixir Meetup #5 ▶ hosted by Curiosum ▶ Miguel Cobá & Michał Buszkiewicz

5th Elixir Meetup hosted by Curiosum We discussed 2 presentations of our Elixir experts:

  • Miguel Cobá: Elixir, Kubernetes and minikube
  • Michał Buszkiewicz: A Framework for Unified Authorization in Elixir

Check the video!
https://curiosum.com/sl/e38klg5u


REGISTER FOR THE NEXT ELIXIR MEETUP: ▶ https://curiosum.com/meetups/elixir

Using IO.puts and IO.inspect in ExUnit tests

By default in the test env, Phoenix doesn’t show IO.puts/IO.inspect outputs in the console. Debugging without access to these two functions may be a pain in the neck. Fortunately, there is a simple solution, you can apply in just a few seconds. Check the TIL: https://curiosum.com/til/io-puts-and-inspect-in-exunit-tests

Elixir is taking over! 5 Elixir Meetups behind us - check how was it!

Five Elixir Meetups are behind us! Who were the speakers, how many people attended, what is the idea? https://curiosum.com/blog/elixir-is-taking-over-meetups-curiosum-behind

Read raw request body from Plug.Conn after parsers

If you ever tried to use Plug.Conn.read_body/2 and it returned nil, you now know that it can only be used once. If you have :json in your Plug.Parsers, you cannot read the raw body again, because it was already used by the parser. That’s a trick Plug does to save memory as request bodies can be of any size. However there’s a way to cache the raw body when you need it:

Read more: https://vinibrasil.com/plugrawbody

Showing how to use LiveView with Nerves

These are a few of my favorite things, as they say. I had no voice but it turned out quite artistic. Love to my editor for that. https://youtu.be/Fude1tM3kg0

ThinkingElixir 100: 10 Years of Elixir with José Valim

The 100th episode of Thinking Elixir is spent with José Valim celebrating 10 years of Elixir. We close out our 5-part series talking about the recent 1.13 release, the upcoming 1.14 release and looking into the future and v2.0. We learn that many features were created with Nx in mind but are still broadly helpful to Elixir developers. José gives a 1-minute explanation of how ex_unit works, explains what usually makes it into a point release, and how adding stepped ranges meant changes to many Enum functions and so much more! In addition to Elixir, we talk about his journey with Dashbit and we end up learning how the song “The Final Countdown” by Europe might actually be teaching functional programming and recursion?? A super packed episode!

https://podcast.thinkingelixir.com/100

Livebook for Elixir: Just What the Docs Ordered

Check out some top tips for using Livebook in Elixir and find out how to create interactive docs. https://blog.appsignal.com/2022/05/24/livebook-for-elixir-just-what-the-docs-ordered.html

Previous page Next page