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

Otp 25 #1252

Merged
merged 6 commits into from
Jun 29, 2023
Merged

Otp 25 #1252

merged 6 commits into from
Jun 29, 2023

Conversation

benwilson512
Copy link
Contributor

No description provided.

maartenvanvliet and others added 6 commits September 14, 2022 11:46
In OTP-25 the SDL rendering was different compared to earlier versions.

I traced it down to `:digraph_utils.topsort()` although could not
find a relevant change in OTP-25 that would explain the difference.

`topsort/1` is used to sort the nodes in the graph so that the import
process can be done in the correct order in the FieldImports phase.
I've changed it to no longer rely on `topsort/1`. Since the
`NoCircularFieldImports` ensures there are no cycles in the graph
we can use recursion for solving the imports without ending up in an
endless loop.

This could be less efficient. The `topsort/1` ensured that the order
of imports was such that when `A` imported `B`, `B` was already imported,
etc up the hierachy chain. If `C` also imported `B`, the imports for
`B` would also already be done. So, `import_fields(B)` would be called once
for the entire graph.

Using recursion, `import_fields(B)` would be called twice, once for `A`
and once for `C`. If B itself imported other fields, those would also be
called multiple times.

I don't think this will be a problem in practice. The cost is only
incurred for schema building, and the `import_fields` graphs are
probably pretty shallow.

The rendering order now matches the order the type definitions were
defined in.
Add support for OTP-25 and Elixir 1.14
@benwilson512 benwilson512 merged commit 3e3d4e6 into master Jun 29, 2023
@benwilson512 benwilson512 deleted the otp-25 branch June 29, 2023 03:15
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.

2 participants