Livebook Launch Week - Day 1: Deploy notebooks as apps & quality-of-life upgrades

Explore Livebook 0.9’s new features: deploy notebooks as user-friendly apps, star & access recent notebooks, and collapse sections.

Learn how to build and deploy your notebook as an app with Livebook.

https://news.livebook.dev/deploy-notebooks-as-apps-quality-of-life-upgrades—launch-week-1—day-1-2OTEWI

IntellIJ Elixir v14.0.1

v14.0.1

Bug Fixes

  • Ignore atoms at top-level when looking for docs.

  • Replace TODO() in leex.reference.resolver.Assign with logger errors that include PSiElement.

  • Ignore type for docs.

  • Don’t look for variable use scope above EEx tags. If a variable is declared in an EEx tag then it is actually missing its declaration and cannot be resolved, so ignore its usage.

  • Check if module is disposed when write action is run for syncLibraries.

  • Only use Elixir SDK for mix format if it has an Erlang SDK.

  • Include more lines of context for stacktraces in error reports.

  • Ignore identifier when @*doc attribute isn’t quoted.

  • Ignore if package virtual file is disposed before the deps can be read.

  • Don’t decompile Erlang And as Elixir and.

  • Ignore request_body and responses for docs.

  • Check if heredoc has lines before calculating host text range for Markdown docs.

  • Ignore if stubs ids can’t be found when resolving Callables.

  • Ignore hexadecimal numbers at the root of the file when collecting doc comment.

  • Return an empty array of primaryArguments instead of array with null operand for unary operation without operand.

  • Set sinceBuild to IntelliJ IDEA 2022.3. Fixes incorrect compatibility listed with < 2022.3 when < 2022.3 support was removed in 14.0.0 with #2946.

  • Use minByOrNull to protect from empty module list. This fix may not work as the line number reported in the errors is actually outside of the file. This is only a guess that minBy was what was throwing the NoSuchElement exception.

  • Ignore null operands for not in primaryArguments(). Instead of including both left and right operand always and so having null operand in fixed size array return array with only non-null operands.

  • Don’t allow Elixir SDK without Erlang SDK to be selected for New Project. The SDK has to be able to work for mix new.

  • Ignore strings, charlists, and sigils at the top of file when looking for doc comments.

  • Ignore top-level Aliases when collecting docs.

  • Ignored unquote calls when injecting docs.

  • Find enclosing quote when defs are inside an fn as in Phoenix Route Helpers.

  • Handle binary modules when processing protocols and implementations for line markers and definition search.

  • Skip unqualified no arguments calls when Ecto.Query.from arguments are being typed.

  • Setting name on a call definition clause sets the name on the head instead. The JetBrains API both renames the usage references AND the original element where the rename refactoring was started, but when started on a call definition clause the functionNameElement is the def, defp, defmacro, or defmacrop and so both the name of the call was changed, but the def* was also changed to the new name. Now, if setName is called on a definition, the head is renamed instead.

  • Filter out Elixir SDKs that don’t have an Erlang SDK when importing projects.

  • Check Elixir SDK has Erlang SDK before running dialyzer. Notify user of configuration error instead of throwing exception when constructing mix commandline.

  • Log heredoc where Markdown cannot be injected.

  • Don’t inject Markdown in empty heredoc docs.

  • Log if new name element type does not match old name element type.

  • Replace name with relative identifier instead of identifier for qualified calls on rename.

  • Keep looking for variants above if and unless if and unless used to call keepProcessing() after checking if the child calls when resolving or searching for variants, but Variants returned false always from keepProcessing().

    This stops the variant search from terminating inside of an if or unless when it wouldn’t outside of one as was reported in #2751.

  • List Kernel and Kernel.SpecialForms variants inside modulars. Keep processing at end of modulars when looking for variants, which will check the implicit imports of Kernel and Kernel.SpecialForms.

  • Prevent listing variants from outer module in nested module

  • Log the accumulated and target usage type that cannot be folded.

  • Fix reporting mix new errors as notifications

    • Don’t associate mix new errors with new project as it doesn’t have a frame, so the notification was suppressed before.
    • Strip color codes from mix new error notification.
  • Validate –app is set correctly for new projects

    • If inferred from project name, make sure the name is valid application name the same as mix new does.
    • If –app is set explicitly, make sure it follows naming rules for mix new.

Simulate LiveView Latency with liveSocket.enableLatencySim()

Another awesome LiveView helper:

liveSocket.enableLatencySim()

It lets us emulate latency to see how our LiveView responds when our users aren’t sitting close to our servers. That’s 🔥

Check it out https://youtube.com/shorts/xlLVtmVCuPw 👀

Elixir Security: What's the impact of DoS due to atom creation?

How to test your Elixir application’s reaction to a major crash.

https://paraxial.io/blog/atom-dos-impact

Analyze Meta Tags With Elixir

A quick walk through on how to analyse for meta tags on websites using Elixir.

Go read more: https://kiru.io/blog/posts/2023/analyze-meta-tags-with-elixir/

Inspecting LiveView Payloads with liveSocket.enableDebug()

I ❤️ that LiveView comes with so many helpers to improve dev experience.

One of those is liveSocket.enableDebug() to help us inspect the payloads LiveView is sending. So nice! 🤩

👉 https://youtube.com/shorts/b8X8QoJJ1N8 👀

Can Phoenix Safely Use the Zip Module?

Elixir has a built-in Zip library that comes with OTP. This post explores how to use the zip module and asks the important question: “Is this safe to use with user provided zips?” We explore two different types of zip-based attacks and see what we learn from it.

https://fly.io/phoenix-files/can-phoenix-safely-use-the-zip-module/

Sean Moriarity, Building a Conversational Support Bot with Elixir and Bumblebee

Sean’s talk from the Denver Elixir meetup:

  • Open-ended generation with LLMs
  • Vector search with ExFaiss, Elixir binding, Facebook AI similarity search
  • 100% Elixir and Bumblebee, ~100 LOC!

https://youtu.be/ELBQytOaQUQ

Thinking Elixir News 145

Episode 145 of Thinking Elixir. News covers the EEF election results, a new Livebook 0.9 release, Docker reverses directions, how Github spilled the secret beans, full text search with a new Haystack lib, how intentionally vulnerable Phoenix apps are educational, the timescale hex package grows up some more, and more!

https://podcast.thinkingelixir.com/145

Phoenix LiveView's new JS.exec/3 function!

Phoenix 1.7.2 shipped a new JS.exec/3 function.

It allows us to execute JS defined in a different dom element.

Why would we want that?

If we’re repeating the same code in multiple places (e.g. hide modal), even if we’re using a helper function to reduce code duplication, we might still be sending that several times in the payload!

JS.exec/3 allows us to reduce that payload by only including the JS command in a single place!

Here I refactor a modal component 👉 https://youtu.be/fZd58xxY4pU 👀

Elixir Security: Sobelow 0.12.1 Released, Adds LiveView Support

Sobelow version 0.12.1 was released recently, adding support for HEEx templates, which are used in Phoenix LiveView. Sobelow is a static analysis tool for finding security issues in Elixir and Phoenix code. If you’re using Elixir in production, running Sobelow is highly recommended, because it automatically checks for common security issues.

https://paraxial.io/blog/sobelow-liveview

LiveView Streams with Pagination

I’ve run across this several times now.

How do we use LiveView streams with pagination (for example, with infinite scroll) where we want to insert more than one element?

This is what I do 👇

Enum.reduce(elements, socket, fn socket, el -> 
  stream_insert(socket, :elements, el)
end)

See it in action 👉 https://youtube.com/shorts/oR88yGtw89w 👀

127 LOC livebook that shows how to deploy one machine to fly.io in 40 seconds

https://twitter.com/joao_lubien/status/1641401331129765888

Connect Livebook to a Local Phoenix Server

In this quick video, Amos shows you how to connect your Livebook to a local Phoenix server.

https://youtu.be/nXlxRpZRrx4

Elixir/Phoenix Security: What is CSRF via Action Reuse?

Misconfiguration of the Phoenix router can lead to CSRF via a GET request to your controller action. Learn more in this article.

https://paraxial.io/blog/action-reuse-csrf

Thinking Elixir News 144

Episode 144 of Thinking Elixir. A collection of ML stories, fixing an 8-year old LiveView bug, Docker drama, speeding up Dialyzer in CI, a new Credo release and more!

https://podcast.thinkingelixir.com/144

Debugging Phoenix LiveView with open_browser/2 Tracey Onim

Find out how to debug Phoenix LiveView tests with open_browser/2: https://blog.appsignal.com/2023/03/28/debugging-phoenix-liveview-with-open-browser2.html

Between the Ctrl-C's

Have you ever noticed the little menu that shows up after you press Ctrl-C the first time in IEx and just before you press it again? What is that menu for? What can you do with it? https://blog.sequin.io/between-the-ctrl-cs/

Syncing SQLite and Postgres using Elixir and Erlang

I had a load of fun figuring out everything for making this video on @ElectricSQL. Syncing between SQLite and Postgres. Local first. Active-Active replication.

If you like SQLite AND/OR Postgres. This should be for you. https://www.youtube.com/watch?v=_U5Z8AQy0hc

Using LiveView's New Primitives for Accessibility

Phoenix LiveView 0.18 added new features to manipulate focus and improve accessibility in your Phoenix LiveView apps. In this post, I show you all of these features, and provide real-life examples to demonstrate just how simple it is to use them and enhance your app’s accessibility. https://fly.io/phoenix-files/liveview-accessible-focus/

Previous page Next page