en un clic
elixir-knowledge-patch
Elixir
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Elixir
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
AlmaLinux
Angular
Arch Linux
Astro
Auth.js
AWS SDK
| name | elixir-knowledge-patch |
| description | Elixir |
| license | MIT |
| version | 1.20.0-rc |
| metadata | {"author":"Nevaberry"} |
Use this index to load only the references relevant to the task. Apply the migration notes before adopting newer APIs, especially when upgrading an existing project or runtime.
| Reference | Topics |
|---|---|
| ecto.md | Ecto queries, schemas, changesets, repositories, adapter migrations |
| elixir-language-and-core.md | Elixir syntax, core APIs, JSON, files, regexes, processes, compatibility |
| erlang-otp.md | Erlang syntax and libraries, processes, tracing, profiling, storage, security |
| interop-and-portability.md | Browser Elixir, C++, Zig, Python, and Swift interoperability |
| phoenix-and-liveview.md | Phoenix generators and scopes, layouts, authentication, LiveView components and tests |
| tooling-testing-and-releases.md | Mix, compiler behavior, formatter, IEx, ExUnit, ExDoc, release artifacts |
| types-and-static-analysis.md | Set-theoretic types, inference, diagnostics, Dialyzer nominal types |
mix archive.install hex phx_new 1.8.0 --force.require(SomeModule).some_macro() code into a require SomeModule statement and a separate macro call. require/1 no longer expands to module AST.<<value::size(^size)>>.def set_path(%URI{} = uri), do: %{uri | path: "/"}.Range.new(first, last) calls with an explicit negative step.File.stream!(path, lines_or_bytes, modes) in that argument order.Logger.enable/1 and Logger.disable/1 with Logger.put_process_level/2 and Logger.delete_process_level/1.:backends configuration by disabling :default_handler or starting custom backends from the application callback.xref: [exclude: ...] to elixirc_options: [no_warn_undefined: ...].:default_task, :preferred_cli_env, and :preferred_cli_target from project/0 to cli/0 as :default_task, :preferred_envs, and :preferred_targets.mix do tasks with +, rename --no-protocol-consolidation to --no-consolidate-protocols, and stop invoking inert mix compile.protocols.--warnings-as-errors to mix compile or mix test; do not set :warnings_as_errors through compiler options.mix do --app APP instead of mix cmd --app APP. Remember that mix cmd now preserves quoting and skips shell expansion unless --shell precedes the command.List.zip/1, Module.eval_quoted/3, Tuple.append/2, and Mix.Tasks.Compile.compilers/0 with Enum.zip/1, Code.eval_quoted/3, Tuple.insert_at/3, and Mix.Task.Compiler.compilers/0.<%!-- ... --%> or <% # ... %> for EEx comments, and implement EEx.handle_text/3 instead of arity two.Any.__deriving__/3 callbacks with a protocol-owned optional __deriving__/1 macro.Kernel.ParallelCompiler.pmap/2 or call Code.ensure_compiled!/1 before spawning compiler-time work.return_diagnostics: true to Kernel.ParallelCompiler.compile, compile_to_path, and require.defprotocol.re parser rejects some formerly tolerated escapes, and its compiled representation is not portable.Inspect.Algebra.next_break_fits with optimistic or pessimistic groups.on_undefined_variable: :warn; undefined identifiers no longer fall back to function calls.distinct, group_by, order_by, and window as Ecto.Query.ByExpr, not QueryExpr.Ecto.ParameterizedType.init/2; do not depend on their changed private tuple representation.:array_join join type.allow_stale: true only when intentionally accepting a stale struct or changeset write.:phoenix_live_view before standard Mix compilers, add LazyHTML for tests, and remove Floki only if nothing else uses it.--alias:@=., and configure NODE_PATH for dependency and build paths..; leading-dot colocated hooks are now module-prefixed.fl-contains and fl-icontains selectors with LiveViewTest text filters.live/3 and live_isolated/3 raise for duplicates by default.annotate_slot/4 to custom Phoenix.LiveView.TagEngine implementations.Encode and decode with JSON; object keys decode as binaries. Derive selected struct fields through JSON.Encoder:
defmodule User do
@derive {JSON.Encoder, only: [:id, :name]}
defstruct [:id, :name, :email]
end
json = JSON.encode!(%User{id: 1, name: "Ada"})
%{"id" => 1, "name" => "Ada"} = JSON.decode!(json)
Calendar types already implement the protocol. Use the Erlang json module directly when writing Erlang; its default object keys are binaries too.
dynamic(t) as dynamic() and t, not as an unconstrained escape hatch...., optional fields with if_set(type), forbidden fields with not_set(), and open tuples with a trailing ....dynamic() during local inference; whole-project checking still compares the modules afterward.Map.put(map, :key, 123) # key becomes required
Map.delete(map, :key) # key becomes forbidden
Map.replace(map, :key, 123) # key remains optional
Bang operations propagate required-key information and reveal calls statically known to fail.
Kernel.to_timeout/1.File.read(path, [:raw]) for a raw file read. Expect File.cp_r/3 to skip special files, preserve directory permissions, and avoid symlink or nested-destination loops./E regular expressions with Regex.import/1; use Regex.to_embed/2 to embed one regex in another.min/2 and max/2 in guards.{:via, module, term} names to PartitionSupervisor.count_children/1 and stop/3.dbg evaluation with :dbg_callback; pipeline debugging now prints every intermediate stage.Parameterize an entire test module and keep modules sharing a resource out of concurrent execution:
use ExUnit.Case,
async: true,
group: :postgres,
parameterize: [%{partitions: 1}, %{partitions: 8}]
Read parameters from the test context. It also includes :test_pid and :test_group. Doctests support exception-tail ellipses and :inspect_opts.
mix source Enum.map/2
mix format --no-compile
mix test --dry-run
mix test --name-pattern PATTERN
mix xref graph --format json
Use MIX_OS_DEPS_COMPILE_PARTITION_COUNT to compile dependencies across OS processes, balancing speed against memory. Use ERL_COMPILER_OPTIONS=deterministic only when stripped source and compile metadata are acceptable.
distinct, group_by, order_by, and window, literal maps in dynamic/2, dynamic map-update values in select, and any Enumerable on the right of query in.order_by macros expand to the complete ordering expression and preload subquery sources.Repo.insert_all/3; use broader select_merge support when fields are distinct.writable: :never, default embeds_one values with defaults_to_struct: true, and store durations with :duration.Phoenix.LiveView.ColocatedHook and arbitrary colocated JavaScript with Phoenix.LiveView.ColocatedJS; merge generated hooks into the LiveSocket configuration.:key to comprehensions when identity must survive insertion or reordering. Prefer streams for very large collections.Phoenix.Component.portal/1 while retaining LiveView event ownership.JS.ignore_attributes/1.stream_insert(..., update_only: true) to update without inserting.debug_heex_annotations and debug_attributes for definition, caller, slot, line, and LiveView PID annotations.require_sudo_mode for recently authenticated operations.phx.gen.* output.priority send option; prioritize exit, link, and monitor signals through their corresponding APIs.<:-, <:=) when non-matches must fail, and zip generators with && for parallel iteration.graph module when persistent graph versions are useful.{max_size, Size}.proc_lib labels, independent trace sessions, unified tprof, and native coverage to diagnose runtime behavior.uv-managed dependencies; account for GIL serialization unless native packages release it.