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 $capture_state capture local state #3822

Merged
merged 24 commits into from
Feb 23, 2020
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cf3fe22
capture local variables in $capture_state
rixo Oct 29, 2019
0239ff3
Merge remote-tracking branch 'upstream/master' into hmr-capture-state
rixo Nov 4, 2019
b32a022
Merge branch 'master' of github.com:sveltejs/svelte into hmr-capture-…
Rich-Harris Nov 14, 2019
a99cd8a
update tests
Rich-Harris Nov 14, 2019
16398f9
Merge remote-tracking branch 'upstream/master' into hmr-capture-state
rixo Dec 3, 2019
1f84174
shorter & less ambiguous param names
rixo Dec 3, 2019
d1f490b
fix TS warnings
rixo Dec 3, 2019
1521c67
Merge branch 'hmr-capture-state' of github.com:rixo/svelte into hmr-c…
rixo Dec 3, 2019
8cdcdc0
add test of $capture_state & $inject_state behaviour
rixo Dec 4, 2019
00ef7bd
remove specific handling of props from $capture_state
rixo Dec 4, 2019
002bed8
fix TS error
rixo Dec 4, 2019
eb4dcfc
capture store subscriptions in $capture_state
rixo Dec 4, 2019
8989476
fix lint error
rixo Dec 4, 2019
3b5a7df
add $$inject special prop, clean $capture_state & $inject_state
rixo Dec 5, 2019
67bafea
Merge branch 'master' into pr/3822
Conduitry Dec 9, 2019
ae5d759
Merge master into pr/3822
rixo Dec 20, 2019
1f6d759
Merge remote-tracking branch 'upstream/master' into hmr-capture-state
rixo Dec 23, 2019
bed3964
Merge remote-tracking branch 'upstream/master' into hmr-capture-state
rixo Dec 30, 2019
e478e1f
Merge remote-tracking branch 'upstream/master' into hmr-capture-state
rixo Dec 30, 2019
7ba1d76
Merge branch 'master' into pr/3822
Conduitry Feb 18, 2020
63a56ad
fix test
Conduitry Feb 18, 2020
7e5578f
tidy
Conduitry Feb 18, 2020
dde2b21
tidy
Conduitry Feb 18, 2020
1a38d04
simplify handling of noop $capture_state/$inject_state
Conduitry Feb 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into pr/3822
  • Loading branch information
Conduitry committed Dec 9, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 67bafeaf4032c0859cef0bd83c503f88ca338cde
2 changes: 1 addition & 1 deletion test/js/samples/debug-no-dependencies/expected.js
Original file line number Diff line number Diff line change
@@ -151,4 +151,4 @@ class Component extends SvelteComponentDev {
}
}

export default Component;
export default Component;
31 changes: 8 additions & 23 deletions test/js/samples/loop-protect/expected.js
Original file line number Diff line number Diff line change
@@ -50,8 +50,8 @@ function create_fragment(ctx) {
return block;
}

function instance($$self, $$props, $$invalidate) {
const guard = loop_guard(100);
function foo() {
const guard = "foo";

{
const guard_1 = loop_guard(100);
@@ -84,24 +84,7 @@ function instance($$self, $$props, $$invalidate) {
}
}

const guard_2 = loop_guard(100);

while (true) {
foo();
guard_2();
}

const guard_4 = loop_guard(100);

do {
foo();
guard_4();
} while (true);

$$self.$capture_state = () => ({ foo });
$$self.$inject_state = noop;

$: {
{
const guard_3 = loop_guard(100);

while (true) {
@@ -125,14 +108,16 @@ function instance($$self, $$props, $$invalidate) {
});
}

$$self.$capture_state = () => {
return {};
};
$$self.$capture_state = () => ({ node, foo, console });

$$self.$inject_state = $$props => {
if ("node" in $$props) $$invalidate(0, node = $$props.node);
};

if ($$props && "$$inject" in $$props) {
$$self.$inject_state($$props.$$inject);
}

$: {
const guard_4 = loop_guard(100);

You are viewing a condensed version of this merge commit. You can view the full changes here.