Only allow passing functions to lifecycle methods like onMount.#5529
Merged
Conduitry merged 1 commit intoOct 22, 2020
Merged
Conversation
|
We could also add that instead of "any", the |
Contributor
Author
The problem is that it risks breaking existing code. There will be no working code that passes in something else than a function, but there can easily be code that passes in a function with a return value. |
Member
|
This has been released in 3.29.1, thanks! |
hontas
added a commit
to hontas/svelte
that referenced
this pull request
Oct 29, 2020
* upstream/master: (140 commits) support $$props and $$restProps for custom elements (sveltejs#5608) Bump eslint-config to 5.5.0 (sveltejs#5599) update changelog add Node and Element as known globals (sveltejs#5601) docs: fix a11y warning in media elements example (sveltejs#5606) Curly braces linting fixes (sveltejs#5585) refactor sourcemap and preprocessor tests (sveltejs#5583) -> v3.29.4 fix code generation error with nullish coalescing operator and logical operators (sveltejs#5564) -> v3.29.3 -> v3.29.2 -> v3.29.1 docs: fix a11y warning in media elements tutorial (sveltejs#5523) update changelog get context at start of {#if} update block instead of at the end (sveltejs#5531) update changelog only allow passing functions to lifecycle functions (sveltejs#5529) update changelog fix compiler hanging on <slot slot="..."> (sveltejs#5536) Add svelte@next caveat to bug report template (sveltejs#5561) ...
taylorzane
pushed a commit
to taylorzane/svelte
that referenced
this pull request
Dec 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changing the parameter of
onMountetc to take a function rather thanany. I accidentally passed an evaluated function rather than the function itself in my TypeScript Sapper project and that gave a runtime rather than a compile-time error.If I understand it right,
types.d.tsis created from this file which in turn is used by the Sapper type definitions.