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

continue inlining $$invalidate calls #3548

Merged
merged 8 commits into from
Oct 17, 2019
Merged

continue inlining $$invalidate calls #3548

merged 8 commits into from
Oct 17, 2019

Conversation

dasZGFz
Copy link
Contributor

@dasZGFz dasZGFz commented Sep 11, 2019

Continue inlining $$invalidate as a follow-up to #3533

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests tests with npm test or yarn test)

@codecov-io
Copy link

codecov-io commented Sep 11, 2019

Codecov Report

Merging #3548 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3548   +/-   ##
=======================================
  Coverage   50.25%   50.25%           
=======================================
  Files           1        1           
  Lines         197      197           
=======================================
  Hits           99       99           
  Misses         98       98

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2cd1fe...28950b7. Read the comment docs.

@dasZGFz dasZGFz changed the title finish inlining $$invalidate [WIP] finish inlining $$invalidate Sep 11, 2019
@dasZGFz
Copy link
Contributor Author

dasZGFz commented Sep 11, 2019

Found a case where it does not inline it even after these changes. I'll try to find out why this is arising.

@dasZGFz
Copy link
Contributor Author

dasZGFz commented Sep 11, 2019

I've tracked down the failing test output to here. I'll try to fix it but it seems like this particular case will be very difficult without large refactoring.

@dasZGFz dasZGFz changed the title [WIP] finish inlining $$invalidate [WIP] finish inlining $$invalidate calls Sep 11, 2019
@dasZGFz dasZGFz changed the title [WIP] finish inlining $$invalidate calls continue inlining $$invalidate calls Sep 11, 2019
@dasZGFz
Copy link
Contributor Author

dasZGFz commented Sep 11, 2019

I think this is ready for review now. I decided not to handle the input event handlers and instead filed an issue with a reproduction: #3553

@dasZGFz
Copy link
Contributor Author

dasZGFz commented Oct 16, 2019

Updated the tests. I'm not sure if you have any strong preferences over this change:

- const callback = x`$$value => { $$invalidate('${value}', ${value} = $$value) }`;
+ const callback = x`$$value => $$invalidate('${value}', ${value} = $$value)`;

I have it as the latter for personal preference but feel free to change it before merging.

@Rich-Harris Rich-Harris merged commit 54a129c into sveltejs:master Oct 17, 2019
@Rich-Harris
Copy link
Member

Thank you — I kept your version without the extra curlies. I think I got in the habit of wrapping arrow functions in curlies back when everything got transpiled to ES5, because it meant adding a return. Since that's no longer generally the case, it's probably better to save those two bytes.

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.

3 participants