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

Don't cache data contents in script state #243

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

WardBrian
Copy link
Collaborator

In 8de418f, I made it so the data.py/R scripts wouldn't update the text if the data they just generated was exactly the same. This was a nice-enough quality of life feature, but it caused a lot of unnecessary re-renders, which I "fixed" in 805ca1b.

However, this has several other bugs if the output of your script is deterministic. The easiest to see is:

  1. Run a deterministic data.R
  2. Edit data.json, save
  3. Re-run data.R, observe that it claims the data is unchanged.

I considered several refactors to save this feature, but all seemed too complicated to justify their use, so I'm proposing we just ditch it and always update the data after a successful script run.

@WardBrian WardBrian added the bug Something isn't working label Nov 4, 2024
Copy link
Collaborator

@jsoules jsoules left a comment

Choose a reason for hiding this comment

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

The "you already had that deterministic output around, friend" notice is a small sacrifice for code simplicity. Looks good, feel free to push

@WardBrian WardBrian merged commit 03430c8 into main Nov 4, 2024
2 checks passed
@WardBrian WardBrian deleted the fix-setting-data-both-languages branch November 4, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants