Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for Elixir 1.15 #1918

Merged
merged 8 commits into from
May 30, 2023
Merged

Changes for Elixir 1.15 #1918

merged 8 commits into from
May 30, 2023

Conversation

jonatanklosko
Copy link
Member

@jonatanklosko jonatanklosko commented May 22, 2023

Closes #1713.

Requires elixir-lang/elixir#12585.

@jonatanklosko jonatanklosko changed the title Support Elixir 1.15 Changes for Elixir 1.15 May 22, 2023
@github-actions
Copy link

github-actions bot commented May 22, 2023

Uffizzi Preview deployment-26181 was deleted.

Comment on lines +604 to +620
try do
quoted = Code.string_to_quoted!(code, file: env.file)

try do
{value, binding, env} =
Code.eval_quoted_with_env(quoted, binding, env, prune_binding: true)

{:ok, value, binding, env}
catch
kind, error ->
stacktrace = prune_stacktrace(__STACKTRACE__)
{:error, kind, error, stacktrace}
end
catch
kind, error ->
{:error, kind, error, []}
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that for parsing errors we always return an empty stacktrace.

Comment on lines +348 to +356
defp ensure_order(map) do
map
|> Enum.sort()
|> Enum.map(fn
{key, %{} = value} -> {key, ensure_order(value)}
pair -> pair
end)
|> Jason.OrderedObject.new()
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serialized maps used to have sorted keys, now we sort explicitly, so it's easier to test the exported source.

defp io_proxy?(pid) do
try do
info = Process.info(pid, [:dictionary])
info[:dictionary][:"$initial_call"] == {Livebook.Runtime.Evaluator.IOProxy, :init, 1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can use the Registry instead of this check... 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in a separate PR!

Copy link
Contributor

@josevalim josevalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

@jonatanklosko jonatanklosko marked this pull request as ready for review May 30, 2023 09:55
@jonatanklosko jonatanklosko merged commit d2988f9 into main May 30, 2023
7 checks passed
@jonatanklosko jonatanklosko deleted the jk-elixir-1.15 branch May 30, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elixir v1.15 improvements
2 participants