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

Fixes class map truncation #96

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Conversation

bcardarella
Copy link
Contributor

@bcardarella bcardarella commented Dec 12, 2023

This resolves an issue with how the class maps were being built up. When there are a certain number of classes extracted from a template they could exceed Elixir's own truncation limit when it comes to stringifying. Typically this can be worked around by setting an :infinity limit but in this case the code was using Macro.to_string/1. The quoted code being passed to Macro.to_string was directly printing the entire list of classes.

This was going to present sooner or later. Glad we found it now. This PR fixes it but is not a permanent fix. Instead of injecting the literal array into the code it will cache it in Ets and retrieve at runtime for the function avoiding the truncation issue of the AST being evaluated.

@bcardarella bcardarella merged commit da58c7d into main Dec 12, 2023
1 check passed
@bcardarella bcardarella deleted the bc-fix-class-name-map-truncation branch December 12, 2023 02:33
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.

1 participant