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

Simplify effect change checking (and make effect cycle detection more accurate as a side-effect) #232

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

jviide
Copy link
Contributor

@jviide jviide commented Oct 6, 2022

This pull request simplifies effect change checking by removing the OUTDATED flag usage from effects. The flag itself can't be completely removed from the codebase, as computed signals still use it. Still, there are some delicious byte size savings gained from this change.

The OUTDATED flag became unnecessary after the changes introduced in #205.

As a nice side-effect the effect cycle detection is now more accurate. There is a new test case for that. The test case does collide with #231, and should be removed if/when that pull request is merged. The code simplifications are still valid regardless.

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2022

🦋 Changeset detected

Latest commit: aa4cb7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@preact/signals-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Oct 6, 2022

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit aa4cb7b
🔍 Latest deploy log https://app.netlify.com/sites/preact-signals-demo/deploys/633ed1f902592d0008428620
😎 Deploy Preview https://deploy-preview-232--preact-signals-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

Size Change: +233 B (0%)

Total Size: 67.4 kB

Filename Size Change
docs/dist/assets/client.********.js 45.7 kB +1 B (0%)
docs/dist/assets/index.********.js 1.08 kB +242 B (+29%) 🚨
docs/dist/assets/signals-core.module.********.js 1.36 kB -7 B (-1%)
docs/dist/assets/signals.module.********.js 1.97 kB +2 B (0%)
docs/dist/basic-********.js 245 B +2 B (+1%)
docs/dist/demos-********.js 3.35 kB +2 B (0%)
docs/dist/nesting-********.js 1.13 kB +2 B (0%)
docs/dist/react-********.js 239 B +2 B (+1%)
packages/core/dist/signals-core.js 1.42 kB -7 B (0%)
packages/core/dist/signals-core.mjs 1.45 kB -6 B (0%)
ℹ️ View Unchanged
Filename Size
docs/dist/assets/jsxRuntime.module.********.js 282 B
docs/dist/assets/preact.module.********.js 4 kB
docs/dist/assets/style.********.js 21 B
docs/dist/assets/style.********.css 1.21 kB
packages/preact/dist/signals.js 1.2 kB
packages/preact/dist/signals.mjs 1.15 kB
packages/react/dist/signals.js 790 B
packages/react/dist/signals.mjs 764 B

compressed-size-action

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Nice!! Very good catch on spotting those size savings 💯

@marvinhagemeister marvinhagemeister merged commit a42a2bd into main Oct 6, 2022
@marvinhagemeister marvinhagemeister deleted the indirect-cycles branch October 6, 2022 13:04
@github-actions github-actions bot mentioned this pull request Oct 6, 2022
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.

None yet

2 participants