-
Notifications
You must be signed in to change notification settings - Fork 516
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
fix(playground): run code even if it doesn't change #12224
Conversation
Bundle StatsHey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
client/src/playground/index.tsx
Outdated
url.pathname = `${codeSrc || code.src || ""}/runner.html`; | ||
setIframeSrc(url.href); | ||
setRunCount(runCount + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setRunCount(runCount + 1); | |
setRunCount((current) => (current + 1) % 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make it cheaper for the wire and lambda.
client/src/playground/index.tsx
Outdated
@@ -86,6 +86,7 @@ export default function Playground() { | |||
const [initialContent, setInitialContent] = useState<EditorContent | null>( | |||
null | |||
); | |||
const [runCount, setRunCount] = useState(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [runCount, setRunCount] = useState(1); | |
const [runCount, setRunCount] = useState(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider my change proposals, otherwise great.
Summary
Problem
Solution
&r=1
parameter giving the current run countHow did you test this change?
locally with
yarn dev