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

Make sure fulcro app prints safely #551

Merged
merged 2 commits into from
Jan 27, 2024
Merged

Make sure fulcro app prints safely #551

merged 2 commits into from
Jan 27, 2024

Conversation

holyjak
Copy link
Collaborator

@holyjak holyjak commented Jan 23, 2024

Issue: Printing a fulcro-app could blow the stack because an atom could contain itself. And even if it didn't, the app is huge and you rarely really want to print it.

Fix: Take inspiration from Component and replace the map with a record, for which we implement safe print-method. As a bonus, this also simplifies detecting whether something is a Fulcro app.

Here we see how it prints an different cases:

Screenshot 2024-01-23 at 22 17 33

Issue: Printing a fulcro-app could blow the stack because an atom could contain itself. And even if it didn't, the app is huge and you rarely really want to print it.

Fix: Take inspiration from Component and replace the map with a record, for which we implement safe print-method. As a bonus, this also simplifies detecting whether something is a Fulcro app.
@awkay
Copy link
Member

awkay commented Jan 23, 2024

Did you try this out against anything of size? Like a RAD demo app? I want to make sure that various dependencies, which may be assuming the app is a map, work correctly. For example, the statecharts assoc things onto it, as down with-react18, etc. Should be ok, but there are a LOT of places that assume it is just a map.

@holyjak
Copy link
Collaborator Author

holyjak commented Jan 24, 2024

Yes, I tried it in rad-demo.

@awkay awkay merged commit 41c3f13 into main Jan 27, 2024
2 checks passed
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