Rich Harris
a1f5bb96b7
add Error to known globals, declare catch block parameter. fixes #3064
7 years ago
Rich Harris
f2c0364da0
Merge branch 'master' into gh-3058
7 years ago
Rich Harris
57c6b2e94a
always run onDestroy functions - fixes #3058
7 years ago
43081j
e65c8e4f8d
fix existing lint errors
7 years ago
Rich Harris
0034b6b074
merge master -> snake_case
7 years ago
Rich Harris
02e635687b
rename kebab-case files - supercedes #2890
7 years ago
Rich Harris
8390195c3a
Merge branch 'master' into gh-2612
7 years ago
Rich Harris
b1bf645272
Merge pull request #3093 from sveltejs/gh-3092
...
handle member expressions in destructuring assignments
7 years ago
Rich Harris
14e739379b
handle member expressions in destructuring assignments - fixes #3092
7 years ago
Rich Harris
a7aa95477f
typo
7 years ago
Rich Harris
204766ec0a
add some docs, rename to textContent and innerHTML
7 years ago
Rich Harris
3c21a184d1
Merge branch 'master' into init-contenteditable
7 years ago
Thomas Ghysels
d6b5c42f7f
Fix parsing ambiguous HTML entities ( #3071 )
...
Fixes sveltejs/sapper#759
7 years ago
Bryan Terce
34ac1ff42e
Fix binding to values in a component when it uses `$$props` ( #2725 )
7 years ago
Bryan Terce
dc3cb06f91
Fix dynamic `bind:this` on components ( #2333 )
7 years ago
Maurício Kishi
d0448aba01
Merge branch 'master' into gh-2612
7 years ago
mrkishi
b57354d8ac
replace ninja globals
7 years ago
Bryan Terce
b61b92166e
preserve whitespace at each block boundaries ( #713 )
7 years ago
Bryan Terce
0cc4b91f65
Fix each blocks not unmounting components correctly ( #3056 )
...
* Prevent outro from invoking detach multiple times
* Add tests for unmounting entries in an each block
* Remove redundant function for removing from lookup
7 years ago
Rich Harris
7de7cdbf06
Track which blocks are outroing to prevent duplication
...
* track whether block is already outroing
* get tests passing
* use transition_in and transition_out helpers
* fix some stuff
* fix non-existent dynamic component outros
* another fix
* another fix
* argh so close
* NAILED IT
* remove unused code
* tidy up
7 years ago
Conduitry
3bc50e0945
fix text nodes in .innerHTML-optimized output
...
- collapse whitespace to single space when appropriate (#2745 )
- escape template string characters in script and style tags
7 years ago
Conduitry
fa485165ce
Merge branch 'master' into gh-2612
7 years ago
Conduitry
88881cd3c5
don't grab page offsets too early
7 years ago
Richard Harris
d21f2b4518
merge master -> init-contenteditable
7 years ago
Richard Harris
b95d200a04
Merge branch 'master' of github.com:sveltejs/svelte
7 years ago
Richard Harris
f82378e64f
whoops
7 years ago
Rich Harris
f8433a30e6
Merge pull request #2990 from mrkishi/component-type
...
Add ambient types for `*.svelte` files
7 years ago
Richard Harris
dd162a2536
Merge branch 'master' into IlyaSemenov-gh-2843
7 years ago
Richard Harris
39bb045d8e
move get_name to get_name_from_filename and add unit tests
7 years ago
Conduitry
e8a53373f2
only set attributes via properties when truly necessary ( #1434 )
7 years ago
mrkishi
61f4d3a8f2
make eslint happy
7 years ago
mrkishi
75568f3656
split typescript projects
7 years ago
Mikhail Korepanov
eee073966c
Allow whitespace after = in attributes ( #3026 )
7 years ago
Johan
74a767403f
ensure correct requestAnimationFrame context ( #2933 )
7 years ago
Efe Küçük
52b964652f
do not collapse whitespace containing nbsp ( #3014 )
7 years ago
Conduitry
0b2d0f6711
use `@_` sigil for globals
7 years ago
Richard Harris
25dcf49b3c
prevent compiled output blowing up in Node if window is not defined
7 years ago
mrkishi
c0d9d555df
deconflict more globals
7 years ago
Conduitry
0b913aa338
import globals from helpers ( #2612 ) ( #2947 )
7 years ago
Ilya Semenov
1a74cede2f
Improve file name to component name conversion, fix #2843
7 years ago
Richard Harris
b502022d67
use helpers
7 years ago
Richard Harris
ceca640822
tidy up, prevent collisions
7 years ago
Richard Harris
e30d7b97d0
initialise text/html bindings if necessary
7 years ago
Richard Harris
4499969337
merge master -> leporo-master
7 years ago
Richard Harris
3bb160571c
Merge branch 'master' of https://github.com/leporo/svelte
7 years ago
Rich Harris
358e79f762
allow empty <title> tags - fixes #2980 ( #2988 )
7 years ago
Rich Harris
e69e891691
support once modifier on component events, fail on others ( #2987 )
...
* support once modifier on component events, fail on others. fixes #2654
* appease the gods of typescript
7 years ago
Rich Harris
6cc03f873c
Merge branch 'master' into master
7 years ago
mrkishi
fca5435605
add ambient type for generated svelte components
7 years ago
James Garbutt
11ced4a257
Introduce ESLint to svelte sources ( #2958 )
...
* introduce eslint
* add lint npm script
* first eslint run
* use tsc stronger checks for unused vars
* fix strict typescript unused checks
* reintroduce unicode oddities
* revert ordering changes
* revert whitespace changes
* set indent lint rule as error and ignore outliers
* revert some more unicode
* reintroduce scissors unicode again
7 years ago
Efe Küçük
e73eb33b45
Render textarea binding values inside element
...
* ssr-textarea-bind-fix
* oops
* trying again
* Fixing an old test
* avoid creating extra function expression
7 years ago
Rich Harris
9c892724c6
Merge pull request #2910 from Harald-1/animation-with-delay
...
follow-up fix to #2871
7 years ago
Richard Harris
bb96112eed
Merge branch 'master' of github.com:sveltejs/svelte
7 years ago
Richard Harris
fc3ae7356b
Merge branch 'fix-2929' of https://github.com/qintarp/svelte into qintarp-fix-2929
7 years ago
Vlad Glushchuk
46781985a1
Rebase and fix linter warning
7 years ago
Vlad Glushchuk
53d03811c8
Fix the cursor reset issue
7 years ago
Vlad Glushchuk
d0edb3167d
Fix a typo
7 years ago
Vlad Glushchuk
bf0d66175b
Add bind:text and bind:html support for contenteditable elements
...
Fixes #310
7 years ago
Richard Harris
833145cb28
fix typo
7 years ago
Richard Harris
0f06710da8
DRY out
7 years ago
Rich Harris
6c874569de
solve diamond dependencies ( #2660 )
7 years ago
Benjamin W. Broersma
1ffaccffc1
Fixing #2689 correctly, checking outro.is_local for adding if(local).
7 years ago
Lyphon
c865d53e5e
Fix build appveyor build failure
7 years ago
Lyphon
0b22030848
Fix 2929
7 years ago
Harald Fassler
082f86b1c6
remove prepare_outro
7 years ago
Harald-1
eb6a3c5b71
Apply suggestions from code review
...
call add_transform directly instead of wrapping it into prepare_outro
Co-Authored-By: Rich Harris <richard.a.harris@gmail.com>
7 years ago
Rich Harris
abf01fddcf
Merge pull request #2909 from Harald-1/animations-without-transitions
...
fix #2908
7 years ago
Rich Harris
b71b7fb5f6
Merge pull request #2912 from yazonnile/master
...
Fix for #2655 - adding introstart...outroend events to in-out transition
7 years ago
Slava Z
126d095bdb
Fix for #2655 - adding introstart...outroend events to in-out transition
7 years ago
Harald Fassler
35cdaa821e
follow-up fix to #2871
7 years ago
Ankeet Maini
c61ad46b06
Fix typo.
7 years ago
Harald Fassler
4d0d63f722
fix #2908
7 years ago
Colin Casey
a2cdcfde40
Merge branch 'master' into onmount_triggers_in_reverse_order_for_siblings
...
* master: (35 commits)
Fix overwrite of 'offset' value in reactive statement
fix slide example
typos
update svelte-repl (fixes download button)
update svelte-repl
update svelte-repl version
use better eliza package
gitignore workers
add compiler typings to list of published files
improve typings for animate, easing, transition, motion and internal apis
update bundler worker
fix gitignore
fix types for easing functions
fix build order
generate internal-exports file
update gitignore
update folder structure - #2790
bump estree-walker to fix some svelte.walk bugs
bundle locally
-> v3.4.4
...
7 years ago
Richard Harris
69b7b5e637
Merge branch 'master' into folder-structure
7 years ago
Rich Harris
98174f8374
typos
7 years ago
Colin Casey
142e6fb19f
Merge branch 'master' into onmount_triggers_in_reverse_order_for_siblings
...
* master: (66 commits)
-> v3.4.3
always add raw property to text nodes
flesh out in/out transition tutorial chapter (#2792 )
code style
fix test
fix tests
Fix CRUD example to allow changing input values.
Fixes #2714
treat requestAnimationFrame as a noop on the server
site: actions tutorial: destroy is not required (#2776 )
Allow binding of <details> open
site: add /faq redirect to GitHub wiki FAQ
fix case sensitive import name, improve tsconfig
type declarations for bundled files
convert everything to TypeScript
check for unknown props when creating component
cleanup, improve comments
typecheck npm script
workarond for estree-walker related typings conflict
compile/render-dom and other remaining typings
...
7 years ago
Bogdan Savluk
0173aa1147
improve typings for animate, easing, transition, motion and internal apis
7 years ago
Richard Harris
2d647ec071
fix types for easing functions
7 years ago
Richard Harris
b151458b07
update gitignore
7 years ago
Richard Harris
965fae7991
update folder structure - #2790
7 years ago
Rich Harris
bf5b8ab777
Merge pull request #2881 from sveltejs/gh-2878
...
dont create unknown prop warnings for $$scope etc, or if component has $$props
7 years ago
Rich Harris
95533b226d
Merge pull request #2880 from cudr/head_html_fix
...
repair dynamic {@html} in head
7 years ago
Richard Harris
3122decd33
dont create unknown prop warnings for $$scope etc, or if component has $$props - fixes #2878
7 years ago
Richard Harris
1c2c3b166c
make is_reactive_dependency optional
7 years ago
Rich Harris
1176e674d0
Merge branch 'master' into less-invalidation
7 years ago
Rich Harris
ca192e15df
Merge pull request #2872 from Harald-1/master
...
Update animations.js
7 years ago
Rich Harris
7ed3965f98
Merge pull request #2877 from colincasey/feat/omit_readonly_ssr_bindings
...
Omits readonly attributes from SSR code
7 years ago
cudr
435f3993ea
add tests
7 years ago
Colin Casey
3f906bfd95
Omits readonly attributes from SSR code
...
* move `is_readonly` into the common `Binding` AST class
* prevents the following bindings from being emitted into the SSR code:
* `bind:clientWidth`
* `bind:clientHeight`
* `bind:offsetWidth`
* `bind:offsetHeight`
* `bind:duration`
* `bind:buffered`
* `bind:seekable`
* `bind:played`
* `bind:value` (only for `input` with `type=file`)
7 years ago
Brian Takita
3c6acd7aa3
jsdoc: `derived` second argument
...
* optional first argument is a Stores type
* optional second argument is a function that takes a single argument
* has a return value
7 years ago
Brian Takita
0f493d8d78
Apply suggestions from code review
...
Co-Authored-By: Rich Harris <richard.a.harris@gmail.com>
7 years ago
Brian Takita
4e0555d5b3
Additional detail to jsdocs for writable, readable, & derived
...
Fixes https://github.com/sveltejs/svelte/issues/2867
7 years ago
Harald Fassler
3aa5bc1c35
Merge remote-tracking branch 'upstream/master'
7 years ago
Harald Fassler
5af26cf37b
Update animations.js
...
Fix issue #2871
7 years ago
Richard Harris
4da1f5d05e
Merge branch 'master' of github.com:sveltejs/svelte
7 years ago
Richard Harris
c8abbfc3a1
always add raw property to text nodes
7 years ago
Richard Harris
32c500f987
Merge branch 'raw-entities' of https://github.com/RedHatter/svelte into RedHatter-raw-entities
7 years ago
Richard Harris
cb04297b8a
merge master -> zxbodya-ts
7 years ago
Richard Harris
d0f84150bf
code style
7 years ago
Richard Harris
c2fa3dd30d
Merge branch 'feat/2174_dev_runtime_warning_when_passing_unknown_props' of https://github.com/colincasey/svelte into colincasey-feat/2174_dev_runtime_warning_when_passing_unknown_props
7 years ago
Rich Harris
8507ac2663
Merge branch 'master' into improve-typings
7 years ago
Rich Harris
c96ccf6dc6
Merge pull request #2856 from sveltejs/raf
...
treat requestAnimationFrame as a noop on the server
7 years ago
cudr
c7e3e26940
works correct
7 years ago
Richard Harris
181e954224
only invalidate referenced values
7 years ago
Richard Harris
0f51970ac1
fix tests
7 years ago
Timothy Johnson
5a87705a38
Fixes #2714
7 years ago
Rich Harris
47dcd385fe
treat requestAnimationFrame as a noop on the server
7 years ago
Benjamin Milde
f56445f3a1
Allow binding of <details> open
7 years ago
Bogdan Savluk
83114b29c8
fix case sensitive import name, improve tsconfig
7 years ago
Bogdan Savluk
70a9cec0f7
convert everything to TypeScript
7 years ago
Colin Casey
4f474521ec
check for unknown props when creating component
7 years ago
Bogdan Savluk
4c08e93f58
cleanup, improve comments
7 years ago
Bogdan Savluk
762a9c2bea
workarond for estree-walker related typings conflict
7 years ago
Bogdan Savluk
fef6dff347
compile/render-dom and other remaining typings
7 years ago
Bogdan Savluk
7d68f2e934
fix compile/render-ssr typings
7 years ago
Bogdan Savluk
e9ff062e41
fix compile/nodes typings
7 years ago
Bogdan Savluk
aee3dcae4d
improve parser typings
7 years ago
Rich Harris
6d6685c4ca
Merge pull request #2829 from colincasey/bugfix/2821_custom_elements_with_no_svelte_options
...
Allow custom element to be declared with no tag and no options
7 years ago
Rich Harris
4c9c04fc44
Merge pull request #2795 from sanderhahn/master
...
Add docstrings to store
7 years ago
Rich Harris
9c911462c4
Update store.ts
7 years ago
Colin Casey
a21afe8b5e
Allow custom element to be declared with no tag and no options
7 years ago
mrkishi
a01b1986bd
allow end tag omission in blocks
7 years ago
Christian Kaisermann
ab5b379c3c
fix: 🐛 data attributes without value outputting as "true"
7 years ago
Sander Hahn
701fe15ebc
add docstrings to store
7 years ago
Rich Harris
6c2f7347fa
Merge pull request #2784 from clarkdo/refactor
...
refactor: remove unnecessary return null in style attribute
7 years ago
Clark Du
29586f0d83
fix: add super.render back
7 years ago
Clark Du
e694fc36b2
refactor: remove unnecessary super.render in style attribute
7 years ago
Rich Harris
ce3a49520a
Merge pull request #2781 from sveltejs/gh-2780
...
handle non-falsy non-function deriver return values
7 years ago
Richard Harris
aa35bb5634
ensure spring works server-side = fixes #2773
7 years ago
Richard Harris
5c172504c0
handle non-falsy non-function deriver return values - fixes #2780
7 years ago
Rich Harris
960e0be017
Merge pull request #2733 from sanderhahn/master
...
typescript version of store
7 years ago
Rich Harris
103e56410f
Merge pull request #2749 from colincasey/custom_elements_without_tags
...
Allows custom element to be defined without a tag
7 years ago
Rich Harris
eabc9ba385
Merge pull request #2754 from EmilTholin/reset-quote-mark
...
Set quote_mark to null when closing quote mark is found
7 years ago
Rich Harris
902b7dbae1
Merge pull request #2755 from EmilTholin/mutated-const-reative-dependency
...
Set mutated const variables as reactive dependencies
7 years ago
Rich Harris
d060af034e
Merge pull request #2766 from EmilTholin/debug-hoisted-variable
...
Don't get hoisted variable from ctx when using @debug
7 years ago
Emil Tholin
3b163fe341
Add error for missing equals after attribute name
7 years ago
Emil Tholin
093bf15cb9
Don't get hoisted variable from ctx when using @debug
7 years ago
Emil Tholin
c6df0df7df
Set mutated const variables as reactive dependencies
7 years ago
Sander Hahn
cabd8ad3a5
advanced type for derived
7 years ago
Emil Tholin
00324b2d0e
Set quote_mark to null when closing quote mark is found
7 years ago
Colin Casey
5d1aece2ab
FIX : #2281 - trigger onMount callbacks in same order as child components
7 years ago
Colin Casey
6481c4cd61
FIX #2417 : allows custom element to be defined without a tag
...
* warning given on compile if tag is absent
* no warning if tag is set to `null`
7 years ago
Sander Hahn
05c26d789e
typescript version of store
7 years ago
Rich Harris
3cb1ef8e23
fix vars/warnings
7 years ago
Rich Harris
b858e8db32
implement namespaced components
7 years ago
Rich Harris
ceca22b26f
Merge pull request #2709 from LostKobrakai/multiple-event-listeners
...
Allow multiple event listeners on a single node
7 years ago
Benjamin Milde
85b256432a
Implement suggestions
7 years ago
Rich Harris
f84e46e227
Merge pull request #2696 from PaulMaly/patch-1
...
Make component.$$.dirty just a dictionary
7 years ago
Rich Harris
1652548ca2
Merge pull request #2698 from jacobmischka/fix-get-slot-changes
...
Initialize `get_slot_changes` to null when not needed
7 years ago
Rich Harris
580224d07d
Merge pull request #2703 from EmilTholin/hoisting-injected-reactive-vars
...
Don't hoist functions dependent on injected reactive variables
7 years ago
Julien Mourer
fef58ba8bb
Add `window` and `document` to globals
...
To prevent the following warning message:
```
(!) svelte plugin: 'window' is not defined
src/templates/Share.svelte
20: </script>
21:
22: {#if window.navigator.share}
^
23: <button class="icon-share2" on:click="{shareNatively}" title="Share"></button>
24: {:else}
```
7 years ago
Emil Tholin
fb3c5f6a90
Don't hoist functions dependent on injected reactive variables
7 years ago
Jacob Mischka
39e7487cec
Initialize `get_slot_changes` to null when not needed
...
Fixes #2697
7 years ago
PaulMaly
1ca1148dcd
Use special blank_object() for component.$$.dirty
7 years ago
PaulMaly
498049f368
Make component.$$.dirty just a dictionary
...
To be sure that we won't have any hidden behavior related to a prototype: https://davidwalsh.name/object-create-null
7 years ago
Rich Harris
47e6cc3935
Merge pull request #2694 from sveltejs/gh-2444
...
invalidate dependencies of reactive declarations
7 years ago
Rich Harris
ccf90f6e36
Merge pull request #2683 from sveltejs/gh-2681
...
fix instrumentation of auto-subscription self-assignments
7 years ago
Rich Harris
a74df4a149
Merge pull request #2679 from EmilTholin/reactive-declaration-warnings
...
Warn on improper use of reactive declarations
7 years ago
Richard Harris
dfc06cc7a1
invalidate dependencies of reactive declarations - fixes #2444
7 years ago
Benjamin Milde
73cbb4ce74
Allow multiple event listeners on a single node
7 years ago
Emil Tholin
9d237f9f4b
Warn on improper use of reactive declarations
7 years ago
Conduitry
6c56ea204b
some linting and tidying
7 years ago
Conduitry
f31a155f07
fix instrumentation of auto-subscription self-assignments ( #2681 )
7 years ago
Richard Harris
bdb9d8a859
lint
7 years ago
Rich Harris
094f6733cd
Merge pull request #2627 from lorenbrichter/spring-verlet
...
Subtle tweaks to spring animations
7 years ago
Rich Harris
50ee4efac4
Merge pull request #2658 from MikeMatrix/each-block-rest-destructuring
...
each-block array destructuring
7 years ago
Rich Harris
3364ba22cf
Merge pull request #2664 from EmilTholin/each-block-destructuring-rest
...
Add support for object-rest in each destructuring
7 years ago
Rich Harris
6524cbb8ad
Merge pull request #2670 from MikeMatrix/fix-readonly-form-attribute
...
Applying read only property form onto elements using `attr` instead
7 years ago
Rich Harris
cb3eb33952
Merge pull request #2672 from sveltejs/gh-2661
...
expose svelte.walk
7 years ago
Rich Harris
acc4dfd293
Merge pull request #2607 from EmilTholin/figcaption_figure_first_element_ancestor
...
Check if a figcaption's first element ancestor is a figure
7 years ago
Rich Harris
d81e453a0f
Merge branch 'master' into feat/abstract-block-class
7 years ago
Rich Harris
06436eb029
Merge pull request #2596 from EmilTholin/await-empty-block-warnings
...
Don't show 'Empty block' warnings for non-existent await branches
7 years ago
Conduitry
31df69581d
expose svelte.walk ( #2661 )
7 years ago
Michael Braun
3626d8ebbd
Applying read only property form onto elements using `attr` instead
...
This should generate the wanted behavior, without generating an exception.
7 years ago
Clemens Akens
6652a16c7a
expose parse to the public
7 years ago
Rich Harris
c54ad3d7aa
Merge pull request #2616 from EmilTholin/insertBefore_null_default_anchor
...
Make null the default anchor of insertBefore
7 years ago
Rich Harris
d9f81dcb82
Merge pull request #2618 from EmilTholin/remove_21618scope_from_spread
...
Remove the $$scope key from $$props when calculating spread
7 years ago
Rich Harris
394900935f
Merge pull request #2619 from sveltejs/gh-2435
...
fix resubscriptions inside script block
7 years ago
Rich Harris
e17e7807d0
Merge pull request #2631 from EmilTholin/reactive-values-fixed
...
Check 'injected' and 'fixed_reactive_declarations' independently
7 years ago
Rich Harris
7003ecc33a
Merge pull request #2634 from sveltejs/gh-2625
...
fix invalidating stores with UpdateExpression
7 years ago
Rich Harris
a3f2ae95ee
Merge pull request #2637 from sveltejs/gh-2635
...
Fix determining which props need a value in dev mode
7 years ago
Rich Harris
bd06e13dc0
Merge pull request #2649 from EmilTholin/alert-global
...
Add alert, confirm, and prompt to globals
7 years ago
Emil Tholin
f1d8b480fa
Add support for object-rest in each destructuring
7 years ago
Michael Braun
5bcba3b388
Fix NPE on pattern check
7 years ago
Michael Braun
aa6e612bf0
Experimenting with array destructuring in each-blocks
7 years ago
Emil Tholin
80d5c1442f
Remove v1 each key parsing
7 years ago
Emil Tholin
de6e4588fb
Add alert, confirm, and prompt to globals
7 years ago
Emil Tholin
151cc46574
Remove the scope key from props when calculating spread
7 years ago
Conduitry
2efaf79503
fix determining which variables are initialised ( #2635 )
7 years ago
Conduitry
7b51a185a7
fix invalidating stores with UpdateExpression ( #2625 )
7 years ago
Emil Tholin
74d40e0510
Check 'injected' and 'fixed_reactive_declarations' independently
7 years ago
Loren Brichter
448479902d
Subtle tweaks to spring animations
...
Use verlet-style integration for spring animations. Rather than keeping track of "value" and velocity over time, keep track of value and previous-value, and derive velocity from the delta every tick. This has a few benefits, including greater stability (position and velocity can't drift) and simplifying signature of tick_spring (no need to pass velocity back up).
Pulling "settled" flag out of the return signature as well means return value is just "next value", simplifying code mapping over objects and arrays, and eliminating duplicated code across get_initial_velocity, get_threshold and tick_spring.
Refactored "threshold" calcs, extremely inexpensive to do inline in tick_spring rather than create a parallel structure. Also fixes a rare pathological case where springs will never settle (reading through the code, could happen if velocity was non-zero during a set() where target==current, threshold will be calculated to be zero and settled will always be set to false, leading to infinite animations).
Functional changes:
In my experience dealing with spring animations, there are a handful of edge-cases where it is nice to have library support. 99% of the time, the only times you'd want to fudge 'stiffness' and 'damping' is during a live interaction (e.g. dragging something around). By providing an idiomatic mechanism hopefully the code around dealing with that could be simpler.
I propose an additional "options" parameter to 'set()' and 'update()'.
If passed {hard:true} the set will be considered a "hard" set, where you want the value to be set to the target value immediately. This could be extremely useful when implementing dragging for instance.
If passed {soft:true} or {soft:<duration>}, the set will be considered a "soft" set, where momentum will be preserved for some duration before settling. This could be useful when implementing "throwing", e.g. after a drag, on mouseup, 'soft set' to some position and the user's previous momentum will be honored before settling down.
Technically momentum preservation happens to a degree now, but aggressive stiffness and/or damping values make it nearly unapparent. This handles the case where you may want more aggressive or heavily underdamped springs but without the apparent velocity discontinuity that happens on throw. (As a real example, in FaceTime, note behavior when tossing around the picture-in-picture, or the iPhone X gestural behavior when tossing apps back to the home screen).
Internally this is implemented by temporarily setting mass to infinity and ramping back to normal over some duration.
"Hard sets" are also special-cased to trigger a same-frame set and fulfilment, leading to more responsive dragging. Best case is a one frame improvement in drag latency (noticed in Safari). This also handles the "old way" method of munging 'stiffness' and 'damping' to 1, so the improvement applies to existing code.
7 years ago
Conduitry
46092cbfb7
fix resubscriptions inside script block ( #2435 )
7 years ago
Emil Tholin
698a14b58f
Make null the default anchor of insertBefore
7 years ago
thollander
c8bf81f274
Create a new abstraction level to handle `Block`
...
- `AbstractBlock` contains the Block' specific rules
- extends a `Node`
- has a `block` and `children`
- can warn if empty
7 years ago
Emil Tholin
7da6ef68bc
Check if a figcaption's first element ancestor is a figure
7 years ago
thollander
be13b56643
Use the already defined type for AppendTarget
7 years ago
Emil Tholin
227a08fc59
Don't show 'Empty block' warnings for non-existent await branches
7 years ago
Richard Harris
4fcd2583b1
fix subscribe implementation, add test for unsubscribing observables
7 years ago
Richard Harris
89fe6a132e
Merge branch 'rxjs-support' of https://github.com/benlesh/svelte into benlesh-rxjs-support
7 years ago
Rich Harris
8513d9527f
RxJS always returns a Subscription object with an unsubscribe.
...
Co-Authored-By: benlesh <ben@benlesh.com>
7 years ago
Ben Lesh
ce209dd0ee
fix: Ensure RxJS users don't create memory leaks
...
There is a bit of excitement in the RxJS community about Svelte.
- It seems like the rest of Svelte "just works™" with RxJS!
- **BUT** The danger is that unwary users will figure out how smooth this API is and accidentally create nasty memory leaks if the returned RxJS Subscriptions are not handled. Fortunately the required change is small.
NOTE: I am not entirely sure how to test this change. The goal here is to make sure that whenever you would normally teardown your store subscriptions, it is also tearing down these RxJS-shaped subscriptions. This is most commonly something you want in a component scenario. Say you have a timer component in your app that you show and remove with an `{#if}` block, when the `{#if}` block hides the component, you'd want to tear down the underlying Observable that is "ticking".
Related #2549
7 years ago
Rich Harris
72d665ba72
Merge pull request #2511 from atomAltera/fix/2506
...
Fixing issue with cursor jumping in Safari #2506
7 years ago
Rich Harris
23778f1135
Merge pull request #2518 from sveltejs/gh-2510
...
handle unknown nodes in extract_identifiers
7 years ago
Rich Harris
f3a725176b
Merge pull request #2543 from jches/gh/2542
...
Fix is_hoistable cycle
7 years ago
Ben Lesh
f2ee6458e0
perf: Reuse the same promise instance in the scheduler
...
- Scheduling an update no longer allocates two new promises, only one via `then`.
- The `tick` method was really returning an empty, resolved promise, so just reusing the same promise there as well. It was a little confusing because it _looked_ like it would return a promise to when the flush had completed, but in fact it was returning a promise that would resolve before the flush completed, as it was the promise that was "thenned" for the flush.
7 years ago
John Chesley
b2e5becb12
fix cycle check for exported functions
7 years ago
Conduitry
9e9ea411f7
handle unknown nodes in extract_identifiers ( #2510 ) ( #2514 )
7 years ago
Konstantin Alikhanov
d808d9ee5d
Fixing issue with cursor jumping in Safari #2506
7 years ago
Richard Harris
70e4a1ba34
Merge branch 'master' of https://github.com/leporo/svelte into leporo-master
7 years ago
Rich Harris
f9f2afdd15
Merge pull request #2433 from sveltejs/gh-2430
...
Use Map for keyed each block lookups
7 years ago
Richard Harris
a63cdcdf94
use maps for keyed each block lookups - fixes #2430
7 years ago
Mikhail Korepanov
c904e21674
Fix creation of debugging comment for elements without children
7 years ago
Richard Harris
a1d35d868d
disallow duplicate slot="xxx" elements - fixes second half of #2320
7 years ago
Richard Harris
e44293aa64
remove renderer.slots
7 years ago
Richard Harris
c08cfc2bf8
sanitize names
7 years ago
Richard Harris
0cf04988c6
remove unused code
7 years ago
Richard Harris
394556941a
fix
7 years ago
Richard Harris
b6ca514188
inherit default slot values in named slots in SSR mode
7 years ago
Richard Harris
cf2bf05812
receive default slot values in named slots
7 years ago
Richard Harris
4c86701f92
pass default slot values through to named slots
7 years ago
Rich Harris
71dc6bddda
Merge pull request #2415 from sveltejs/gh-2356
...
Prevent infinite loops with chained bindings
7 years ago
Richard Harris
017cbc6bd3
oops, messed up the merge
7 years ago
Richard Harris
864d9f9cfb
propagate scope changes across chained slots - fixes #2359
7 years ago
Rich Harris
49330b1994
Merge branch 'master' into gh-2356
7 years ago
Richard Harris
330b9ea55a
wait until flush complete before unlocking bindings - fixes #2356
7 years ago
Richard Harris
cc50321f95
only fire binding callbacks when values change
7 years ago
Conduitry
f328f219e5
deconflict `value` argument in component bindings ( #2395 )
7 years ago
Rich Harris
c610e83a00
Merge pull request #2409 from sveltejs/gh-2354
...
only create fallback content if no slot is provided
7 years ago
Rich Harris
92fc5da0a5
Merge pull request #2406 from sveltejs/gh-2399
...
skip observedAttributes where appropriate
7 years ago
Richard Harris
48ac4ed1f1
only create fallback content if no slot is provided - fixes #2354
7 years ago
Richard Harris
3201e717df
better error for bindings to let: values - fixes #2301
7 years ago
Richard Harris
04900e90cd
skip observedAttributes where appropriate - fixes #2399
7 years ago
Richard Harris
08fab520be
allow reactive declarations to reference self - fixes #2386
7 years ago
Richard Harris
dda2012b4d
inject lets for destructured reactive declarations - fixes #2396
7 years ago
Richard Harris
7823bb7134
optimise certain $$invalidate calls
7 years ago
Richard Harris
6b1067e8c1
allow reactive declarations without dependencies - fixes #2285
7 years ago
nhducit
21db6acf3b
Fĩ type
7 years ago
Vlad Glushchuk
25b6c07816
Fix a typo
8 years ago
Vlad Glushchuk
54be0fbe44
Add bind:text and bind:html support for contenteditable elements
...
Fixes #310
8 years ago
Richard Harris
aac1f74d58
only use explicit namespace for top-level elements
8 years ago
Richard Harris
bbe4ab7b7d
apply namespace to foreignObject correctly - fixes #2340
8 years ago
Rich Harris
380f5ffaf2
Merge pull request #2349 from Panya/issue-2348
...
Pass block to the render of an expression in an attribute
8 years ago
Rich Harris
2157430a3f
Merge pull request #2351 from jches/gh/2347
...
Don't hoist non-renamed exports
8 years ago
Rich Harris
ed983c1e88
Merge pull request #2357 from sveltejs/conditional-text-updates-2
...
Update text.data only when necessary
8 years ago
Rich Harris
5cd5f36cce
only coerce once
8 years ago
John Chesley
a26c7824ac
hoist all hoistable top-level functions
8 years ago
Jacob Wright
82baceb8ac
Update text.data only when necessary
...
Only update the text node if the text node's value is not equal. This fix is for contenteditable usage where text content may change outside of Svelte's control in order to preserve text composition.
Accomplishes the same thing as #2341 without the added API.
8 years ago
John Chesley
25f3f39ca6
do not hoist declaration if it is exported ( fixes #2347 )
8 years ago
Mikhail Korepanov
1c5b730698
Pass block to the render of an expression in an attribute
8 years ago
Rich Harris
8efa51519d
update API reference docs ( #2206 )
8 years ago
Rich Harris
967596bcb6
Merge pull request #2326 from sveltejs/gh-2325
...
skip array literal length optimization in presence of spread
8 years ago
Richard Harris
50b0cf2d3e
Merge branch 'master' of github.com:sveltejs/svelte
8 years ago
Conduitry
6b7ba8de79
don't preprocess tags whose names begin with script/style
8 years ago
Lukas
00a1d5a225
add playbackrate as binding for mediaelements ( #2202 )
8 years ago
Conduitry
a0bbc13678
skip array literal length optimization in presence of spread ( #2325 )
8 years ago
Rich Harris
686384d50e
Merge pull request #2321 from sveltejs/gh-2295
...
Fix exception and warning for global variables
8 years ago
Conduitry
7208a07023
warn on template references to global variables ( #2295 )
8 years ago
Conduitry
5c97df6b84
disallow bindings to global variables ( #2295 )
8 years ago
Rich Harris
1447064eb5
handle foreignObject correctly, default to svg namespace for top-level svg elements - fixes #2298
8 years ago
Rich Harris
91d92c1e8a
remove unused import
8 years ago
Rich Harris
0c7151c502
handle arbitrary slot names
8 years ago
Rich Harris
7c4ae2c859
simplify some slot_name stuff
8 years ago
Rich Harris
0d02a84f33
DRY out
8 years ago
Rich Harris
a2503b2c9e
Merge branch 'issue-2291' of https://github.com/Panya/svelte into Panya-issue-2291
8 years ago
Rich Harris
c57ee5f8b6
Merge pull request #2309 from sveltejs/gh-2303
...
play transitions in slots
8 years ago
Rich Harris
0f7715e5f8
Merge pull request #2312 from sveltejs/gh-2294
...
note action/etc. references even when hoistable
8 years ago
Conduitry
d4f038cfa7
subscribe to global stores from script ( #2139 )
8 years ago
Mikhail Korepanov
0ab7077d40
Move slot names test to runtime. Allow slot names that start with a digit
8 years ago
Mikhail Korepanov
658d235350
Add an error for a slot name starts with a digit
8 years ago
Mikhail Korepanov
e85138f3e3
Don't remove digits and _ from slot names
8 years ago
Conduitry
392cec1070
note action/etc. references even when hoistable ( #2294 )
8 years ago
Richard Harris
1a3b260941
play transitions in slots - fixes #2303
8 years ago
Richard Harris
d26e0c4a1e
invalidate correctly inside event handlers - fixes #2305
8 years ago
Rich Harris
03de79ebc8
Merge pull request #2283 from sveltejs/gh-2280
...
replace comment anchors with empty text nodes
8 years ago
Richard Harris
cd93506fbb
remove comment
8 years ago
Rich Harris
7a0175a0c1
Merge pull request #2286 from sveltejs/gh-2284
...
find this= in <svelte:component> in presence of bind:this=
8 years ago
Conduitry
f63fc5166f
tidy some binding validation messages ( #2300 )
8 years ago
Conduitry
2d35095a60
find this= in <svelte:component> in presence of bind:this= ( #2284 )
8 years ago
Richard Harris
3c1dae08b0
replace comment anchors with empty text nodes - fixes #2280
8 years ago
John Chesley
3ee7938d34
break declaration grouping on non-declaration nodes ( fixes #2022 )
8 years ago
Rich Harris
7a1e2de8bb
suppress $$props is not defined warning
8 years ago
Rich Harris
558cefa2c7
linting
8 years ago
Rich Harris
f955eb28b5
Merge pull request #2258 from sveltejs/collapse-whitespace
...
collapse consecutive whitespace characters
8 years ago
Rich Harris
c0d5950ef1
Merge pull request #2265 from sveltejs/gh-2119
...
Handle store assignments in reactive statements
8 years ago
Rich Harris
c50d7412b9
Merge pull request #2266 from sveltejs/gh-2264
...
allow reactive declarations to only depend on $$props
8 years ago
Rich Harris
ccb56bba2f
allow reactive declarations to only depend on $$props - fixes #2264
8 years ago
Rich Harris
6a9c206e47
same but for SSR
8 years ago
Rich Harris
15b6e84cbb
handle assignments to store values in reactive declarations ( #2119 )
8 years ago
Conduitry
e4e2772086
fix logic for inclusion of getters/setters on components (32262)
8 years ago
Rich Harris
69eeefbac1
Merge pull request #2261 from sveltejs/gh-2253
...
fix renamed instance exports
8 years ago
Rich Harris
f362a92b40
fix
8 years ago
Conduitry
105586950f
fix renamed instance exports ( #2253 )
8 years ago
Rich Harris
43bf63448d
implement bind:online
8 years ago
Richard Harris
4fad86313f
collapse consecutive whitespace characters in the absense of options.preserveWhitespace or a <pre>
8 years ago
Rich Harris
7e8e891d91
Tidy up ( #2252 )
8 years ago
Rich Harris
05223f26e0
Merge pull request #2251 from sveltejs/gh-2025-alt
...
make customElement a boolean option
8 years ago
Richard Harris
348491a0c1
update valid_options
8 years ago
Richard Harris
319f591dc0
make customElement a boolean option ( #2025 )
8 years ago
Richard Harris
e970b8fdfc
Merge branch 'master' into gh-2025
8 years ago
Richard Harris
b4268e9a67
update stores when assigning to store values - fixes #2170
8 years ago
Rich Harris
ddb829568f
Merge pull request #2249 from sveltejs/gh-2182
...
set/unset parent component correctly in SSR
8 years ago
Richard Harris
81e9befd07
merge master -> slot-runtime-hasupdatemethod and add a test
8 years ago
Richard Harris
1e55b97bed
put callbacks with the other discardable items
8 years ago
Richard Harris
ab20acd479
set/unset parent component correctly in SSR - fixes #2182
8 years ago
Richard Harris
0f6cc667ea
allow transition functions to return nothing
8 years ago
Rich Harris
5eaae1976b
Merge pull request #2245 from sveltejs/gh-2236
...
prevent overwriting export consts
8 years ago
Rich Harris
9a0b750855
Merge pull request #2244 from sveltejs/gh-2167
...
various spring fixes
8 years ago
Richard Harris
427d4c1c8c
prevent overwriting export consts - fixes #2236
8 years ago
Richard Harris
7c70cb0d58
various spring fixes, including #2167
8 years ago
Rich Harris
d41eec1e4e
Merge pull request #2242 from sveltejs/gh-2144
...
default to accessors: false
8 years ago
Rich Harris
b4cc6a8320
Merge pull request #2235 from sveltejs/gh-2139
...
Subscribe to global stores
8 years ago
Richard Harris
ad17bd7627
default to accessors: false ( #2144 )
8 years ago
Richard Harris
cf96cd5fa4
call deferred transition function at correct time - fixes #2159
8 years ago
Rich Harris
3322540fdf
Merge pull request #2239 from sveltejs/gh-2158
...
dispatch transition events inside render callback
8 years ago
Rich Harris
dd94551b22
Merge pull request #2238 from sveltejs/gh-2098
...
fix repeated animations
8 years ago
Richard Harris
16466087ff
dispatch transition events inside render callback - fixes #2158
8 years ago
Richard Harris
b8462fec83
fix repeated animations ( #2098 )
8 years ago
Richard Harris
7bdaa1e2de
only clear out stylesheet after removing a specific animation - fixes #2053
8 years ago
Richard Harris
1d890623be
same but for SSR
8 years ago
Richard Harris
8b28581eab
subscribe to global stores ( #2139 )
8 years ago
Richard Harris
69680f58e7
Merge branch 'subscribable' of https://github.com/thgh/svelte into thgh-subscribable
8 years ago
Rich Harris
b272901449
Merge pull request #2232 from sveltejs/gh-2222
...
store prop names as $$.props, prevent leaky bindings
8 years ago
Rich Harris
44f983e54a
Merge pull request #2234 from sveltejs/gh-2163
...
Interpret `changed` inside slotted content
8 years ago
Richard Harris
24b8645079
report changes correctly
8 years ago
Richard Harris
e62c3c4588
remove some update false positives
8 years ago
Mikhail Korepanov
5d70e4c07b
Add test case for #2115 and possible fix
8 years ago
Richard Harris
566ba5b137
store prop names as $$.props, prevent leaky bindings. fixes #2222
8 years ago
Richard Harris
bdefae9f74
maintain context for contextual binding handlers - fixes #2146
8 years ago
Richard Harris
83520fbb3a
augment warnings to help people figure out they need to add a <script>
8 years ago
Richard Harris
8d5ac176c8
remove some more unused code
8 years ago
Richard Harris
a401071247
remove some unused code
8 years ago
Richard Harris
e59d40f885
remove support for logic-less components with vars
8 years ago
Rich Harris
61ca7d40ad
Merge pull request #2213 from sveltejs/gh-2212
...
deconflict fragment method aliases with other identifiers
8 years ago
Rich Harris
060973227d
Merge pull request #2225 from sveltejs/gh-2214
...
Disallow `export ... from` statements
8 years ago
Conduitry
c39a3f6d58
skip non-writable vars in reactive declaration deps ( #2173 )
8 years ago
Conduitry
97d698ccfc
temporarily disallow `export ... from` statements ( #2214 )
8 years ago
Thomas Ghysels
688ce68c33
Throw descriptive error when 'subscribable' of undefined
...
Fix #2139
8 years ago
Conduitry
5161bf0a18
deconflict fragment method aliases with other identifiers ( #2212 )
8 years ago
Richard Harris
20a944ce14
generate valid code for each block array literals ( #2180 )
8 years ago
Richard Harris
65d8871d91
fix svelte:self
8 years ago
Richard Harris
4cef016654
make foo += 1 equivalent to foo = foo + 1 in reactive statements
8 years ago
Rich Harris
893a1876a1
Add a tutorial ( #2132 )
8 years ago
Conduitry
597baa49c0
update options.customElement/<svelte:options tag='...'> handling ( #2025 )
8 years ago
Rich Harris
57c9274262
Merge pull request #2187 from sveltejs/gh-2186
...
implement $$props
8 years ago
Richard Harris
563efabd0a
generalise pattern of treating $foo as a store value but $$foo as internal
8 years ago
Richard Harris
2047f9831d
add test for $$props vars output
8 years ago
Richard Harris
428e264059
merge gh-2186 -> master
8 years ago
Richard Harris
1455c554ff
use add_var mechanism to create implicit $$props var
8 years ago
Richard Harris
63f1d0988f
tweak semantics of reactive statements - fixes #2178
8 years ago