- Fix infinite loop when instantiating another component during
onMount
(#3218) - Make autosubscribing to a nullish store a no-op (#2181)
- Fix updating a
<slot>
inside an{#if}
or other block (#4292) - Fix using RxJS observables in
derived
stores (#4298) - Add dev mode check to disallow duplicate keys in a keyed
{#each}
(#4301) - Fix hydration of
<title>
when starting from SSR-generated code withhydratable: true
(#4310)
- Fix removing attributes during hydration (#1733)
- Disallow two-way binding to a variable declared by an
{#await}
block (#4012) - Allow access to
let:
variables in sibling attributes on slot root (#4173) - Fix
~=
and class selector matching against values separated by any whitespace characters (#4242) - Fix code generation for
await
ed expressions that need parentheses (#4267) - Preserve JavaScript comments from the original component source where possible (#4268)
- Add some more known globals (#4276)
- Correctly apply event modifiers to
<svelte:body>
events (#4278)
- Only attach SSR mode markers to a component's
<head>
elements when compiling withhydratable: true
(#4258)
- Remove old
<head>
elements during hydration so they aren't duplicated (#1607) - Prevent text input cursor jumping in Safari with one-way binding (#3449)
- Expose compiler version in dev events (#4047)
- Don't run actions before their element is in the document (#4166)
- Fix reactive assignments with destructuring and stores where the destructured value should be undefined (#4170)
- Fix hydrating
{:else}
in{#each}
(#4202) - Do not automatically declare variables in reactive declarations when assigning to a member expression (#4212)
- Fix stringifying of attributes in SSR mode when there are spread attributes (#4240)
- Only render one
<title>
in SSR mode when multiple components provide one (#4250)
- Also apply actions in the order they're given along with other directives (#2446, #4156)
- Check whether a dynamic event handler is a function before calling it (#4090)
- Correctly mark event handlers as dynamic when they involve an expression used in a
bind:
elsewhere (#4155)
- Fix CSS specificity bug when encapsulating styles (#1277)
- Apply directives in the order they're given (#2446)
- Fix destructuring in
let:
directives (#2751) - Preserve whitespace around
<tspan>
s in<svg>
s (#3998)
- Fix slots with props not propagating through to inner slots (#4061)
- Fix noting autosubscribed stores as
referenced
invars
for tooling (#4081) - Fix cascading invalidations in certain situations (#4094)
- Fix bitmask overflow when using slotted components (#4077)
- Remove unnecessary
$$invalidate
calls from init block (#4018)
- Handle slot updates when parent component has a bitmask overflow (#4078)
- Fix unused export warning for props used as stores (#4021)
- Fix
{:then}
without resolved value containing{#each}
(#4022) - Fix incorrect code generated with
loopGuardTimeout
(#4034) - Fix handling of bitmask overflow and globals (#4037)
- Fix
{:then}
containing{#if}
(#4044) - Fix bare
import
s informat: 'cjs'
output mode (#4055) - Warn when using a known global as a component name (#4070)
- Use bitmasks to track changes (#3945)
- Fix heisenbug with component styles (#3977)
- Do not warn about missing expected props for
export function foo() {}
(#3954) - Fix
context="module"
exports with the same name as an instance variable (#3983) - Fix binding to contextual values from
{#each}
blocks referring to global variables (#3992) - Use
requestAnimationFrame
callback argument for smoother transitions (#4014) - Fix
listen_dev
argument order (#4016)
- Hide commented sections from preprocessors (#3894)
- Add
seeking
andended
bindings to media elements (#3650) - Add
videoWidth
andvideoHeight
bindings to video elements (#3927) - Fix for dynamic event handlers (#3934)
- Handle scale transforms when using the
flip
animation (#3555) - Fix some code generation bugs (#3929, #3939)
- Add
aria-hidden="true"
to objects generated when adding resize-listeners, to improve accessibility (#3948)
- Deconflict block method names with other variables (#3900)
- Fix entity encoding issue in text nodes with constant expressions (#3911)
- Make code for unknown prop warnings compatible with older js engines (#3914)
- Add
loopGuardTimeout
option that augmentsfor
/while
loops to prevent infinite loops, primarily for use in the REPL (#3887) - Keep component bindings in sync when changed in reactive statements (#3382)
- Update attributes before bindings (#3857)
- Prevent variable naming conflict (#3899)
- New structured code generation, which eliminates a number of edge cases and obscure bugs (#3539)
Also:
- Fix
{#each}
context not shadowing outer scope when usingbind:
(#1565) - Fix edge cases in matching selectors against elements (#1710)
- Fix several bugs related to interaction of
{...spread}
attributes with other features (#2721, #2916, #3421, #3681, #3764, #3790) - Allow exiting a reactive block early with
break $
(#2828) - Fix binding to props that have been renamed with
export { ... as ... }
(#3508) - Fix application of style scoping class in cases of ambiguity (#3544)
- Check attributes have changed before setting them to avoid image flicker (#3579)
- Fix generating malformed code for
{@debug}
tags with no dependencies (#3588) - Fix generated code in specific case involving compound ifs and child components (#3595)
- Fix
bind:this
binding to a store (#3591) - Use safer
HTMLElement
check before extending class (#3608) - Add
location
as a known global (#3619) - Support
{#await}
with{:catch}
but no{:then}
(#3623) - Clean up dead code emitted for
<slot/>
s (#3631) - Fix tracking of dependencies of compound assignments in reactive statements (#3634)
- Flush changes in newly attached block when using
{#await}
(#3660) - Throw exception immediately when calling
createEventDispatcher()
after component instantiation (#3667) - Fix globals shadowing contextual template scope (#3674)
- Fix
<svelte:window>
bindings to stores (#3832) - Deconflict generated var names with builtins (#3724)
- Allow spring/tweened values to be initially undefined (#3761)
- Warn if using
<svelte:options tag="...">
withoutcustomElement: true
option (#3782) - Add
Event
to list of known globals (#3810) - Throw helpful error on empty CSS declaration (#3801)
- Support
easing
param onfade
transition (#3823) - Generate valid names from filenames with unicode characters (#3845)
- Don't generate any code for markup-less components (#2200)
- Deconflict with internal name
block
(#3854) - Set attributes before bindings, to prevent erroneous assignments to
input.files
(#3828) - Smarter unused CSS detection (#3825)
- Allow dynamic event handlers (#3040)
- Prevent erroneous
"undefined"
class name (#3876) - Prevent resetting of
src
attribute unless changed (#3579) - Prevent hydration of void element 'children' (#3882)
- Hoist globals even if mentioned in
<script>
block (#3745)
- Escape
@
symbols in props, again (#3545)
- Fire events on
document
in development to facilitate dev tooling (#3005) - Remove old props when the keys in spread props are removed (#2282)
$capture_state
and$inject_state
HMR hooks in dev mode (#3148)- Allow unclosed tags inside if/each/etc blocks (#2807)
- Invalidate unreferenced store values inside
<script>
(#3537) - Print
null
text when hydrating (#3379)
- Preserve reactivity inside if block heads etc (#3512)
- Fix store bindings inside each blocks (#3455)
- Generate correct code for if-else blocks with static conditions (#3505)
- Avoid generating unnecessary component update code (#3526)
- Make
bind:currentTime
more reliable (#3524) - Prevent errors when setting spread props on SVG elements (#3522)
- Add
blur
transition (#3477) - Prevent
<input type="number">
edge case with spread props (#3426) - Robustify cyclical dependency detection, improve errors (#3459)
- Fix handling of additional @-rules in style blocks (#2995)
- Fix if blocks with complex but static conditions (#3447)
- Only update style properties if necessary (#3433)
- Only update if/await blocks if necessary (#2355)
- Set context correctly inside await blocks (#2443)
- Handle
!important
inline styles (#1834) - Make index references reactive in event handlers inside keyed each blocks (#2569)
- Support
is
attribute on elements, with a warning (#3182) - Handle missing slot prop (#3322)
- Don't set undefined/null input values, unless previous value exists (#1233)
- Fix style attribute optimisation bailout (#1830)
- Set SVG namespace for slotted elements (#3321)
- Add
self
event modifier (#3372) - Generate valid code when spreading literal (#3185)
- Coerce tag values to string before checking equality (#2290)
- Assume
let
variables are dynamic for slots (#3354) - Allow transition functions to return nothing (#2246)
- Disable warnings via
svelte-ignore
comments (#3351) - Throw if
$
or$$...
is referenced as global (#3272) - Remount HTML tags correctly (#3329)
- Treat data attributes like other attributes (#3337)
- Handle reassigned RxJS observables (#3304)
- Remove commas from HTMLified attributes with multiple chunks (#3341)
- Prevent
class
on element with scoped styles from rendering asundefined
(#3283) - Allow references to index in key expression (#3274)
- Mark attribute selectors as used if corresponding binding exists (#3281)
- Preserve
async
/*
when hoisting functions (#3179) - Make
raf
a noop on server (#3324) - Prevent erroneous a11y warning for image input with alt attribute (#3331)
- Add several well-known globals (#3316)
- Use
change
event for file inputs (#3226) - Always fire reactive declarations with
$$props
(#3286) - More conservative spread prop updates (#3289)
- Quote props if necessary in SSR mode (#3312)
- Always update derived stores with a derived input whose value does not change (#3191)
- Preserve global keyframes that don't match local elements (#3228)
- Fix spread/
class:
combination (#3242) - Never scope
:root
selector (#3250) - Prevent trailing commas in function arguments (#3255)
- Prevent corruption of outro callbacks with nested keyed each blocks (#3209)
- Prevent cursor jumping in bound input in Safari (#3199)
- Make resize listener object unfocusable (#3206)
- Handle RxJS-style observables with
get
(#3153) - Pass
let
values to bindings (#3140) - Escape
@
symbols in props (#3173) - Scale crossfaded elements (#3175)
- Run
onMount
functions in correct order, and before initialafterUpdate
functions (#2281) - Fix code transformation for shorthand methods (#2906)
- Fix assignments in inline functions (#3038)
- Fix await block mounting inside removed if block (#1496)
- Update when element references are removed (#2034)
- Don't attempt to serialize non-string values in server-rendered bindings (#2135)
- Recognise dependencies in function expressions (#2693)
- Scope pseudo-class selectors without class/type (#1705)
- Allow nested at-rules (#3135)
- Allow attributes to contain
=
characters (#3149)
- Fix placement of each-else block (#2917)
- Make context accessible to
bind:this
(#2806) - Pass hoisted values to slots (#2586)
- Fix escaping of
@
in dev mode debug filename (#3114)
- Add
innerHTML
andtextContent
bindings forcontenteditable
elements (#2996) - Fix destructuring assignments where targets are member expressions (#3092)
- Deconflict with used globals (#2963)
- Always run
onDestroy
functions, not just for detaching components (#3058) - Fix scope analysis around catch clauses (#3064)
- Add error constructors to known globals (#3064)
- Always bail out of hoisting on encountering local state in function definition (#3044)
- Fix incorrect merging of top-level text nodes (#3027)
- Handle removal of components in each blocks without props (#3035)
- Only call subscriber once when resubscribing to a store (#3022)
- Check for existence of dynamic component before introing (#3054)
- Sanitize names of bubbled event handlers (#2923)
- Preserve whitespace at the boundaries of
{#each}
blocks (#713) - Fix dynamic
bind:this
on components (#2333) - Fix binding to values in a component when it uses
$$props
(#2725) - Fix parsing ambiguous HTML entities (#3071)
- Don't double-destroy keyed each blocks with outros (#3055)
- Prevent duplicated outros causing errors (#3001)
- Fix automatic name generation (#2843)
- Fix .d.ts stubs (#3009)
- Don't strip non-breaking spaces (#3014)
- Fix
requestAnimationFrame
context (#2933) - Allow space before attribute value (#3026)
- Remove null/undefined attributes (#1434)
- Fix whitespace in static markup (#3030)
- Accommodate webpack idiosyncracies
- Update package folder structure (#2887)
- Support
once
modifier on component events (#2654) - Allow empty
<title>
tags (#2980) - Render textarea binding values inside element (#2975)
- Fix delayed animation glitch (#2871)
- Solve diamond dependencies problem with stores (#2660)
- Fix missing outros inside each blocks (#2689)
- Support animations without transitions (#2908)
- Add missing transition events (#2912)
- Publish type declaration files (#2874)
- Don't trigger updates for unreferenced values (#2865)
- Omit readonly bindings from SSR output (#2339)
- Prevent outdated animation CSS (#2871)
- Repair dynamic
{@html ...}
in head (#2880) - Don't create unknown prop warnings for internal props, or if component has
$$props
(#2881)
- Add type declaration files for everything (#2842)
- Prevent
svelte/store
being bundled (#2786) - Warn on unknown props in dev mode (#2840)
- Treat
requestAnimationFrame
as a no-op on the server (#2856) - Add
raw
property to AST'sText
nodes (#2714) - Add
<details bind:open>
(#2854)
- Use empty string for empty data attributes (#2804)
- Support
customElement: true
with no<svelte:options>
(#2821) - Add docstrings to
svelte/store
(#2795)
- Handle non-falsy non-function return values from derivers (#2780)
- Allow
spring
to work server-side (#2773)
- Allow custom element to be defined without a
tag
(#2417) - Fix parsing of quote marks inside attribute values (#2715)
- Convert
svelte/store
to TypeScript (#2733) - Allow
debug
tags to include hoisted values (#2764) - Parse error if attribute name is missing
=
(#1513) - Allow reactive declarations to depend on mutated
const
values (#2728)
- Allow multiple event listeners on a single node (#2688)
- Allow derivers to return a cleanup function (#2553)
- Support namespaced components (
<Foo.Bar/>
) (#2743)
- Add
window
anddocument
to expected globals (#2722) - Prevent hoisting of functions that depend on reactive state (#2703)
- Generate correct code when slot has no changes (#2697)
- Prevent
Object.prototype
-related bugs (#2696)
- Use same comparison logic for
derived
as for other stores (#2644) - Invalidate dependencies of reactive declarations (#2444)
- Fix instrumentation of auto-subscription self-assignments (#2681)
- Warn on non-top-level or module-context statements labeled with
$:
(#2176)
- Improve
spring
animations, and addhard
/soft
options (#2627) - Expose
parse
andwalk
functions (#2661, #2534) - Support array/object rest in
each
block destructuring patterns (#2647, #2658) - Use
setAttribute
to changeform
property on form elements (#1742) - Fix a11y warning when
<figcaption>
is non-direct descendant of<figure>
(#2582) - Squelch erroneous 'empty block' warnings (#1716)
- Fix IE9/10 error with
insertBefore
(#2573) - Prevent
$$scope
from being spread onto an element (#2520) - Resubscribe to stores that are assigned to in
<script>
(#2435) - Allow reactive declarations to depend on
const
variables (#2285) - Trigger store changes on UpdateExpression (#2625)
- Squelch missing prop warning if variable is initialised (#2635)
- Add
alert
,confirm
andprompt
to known globals (#2648)
- Allow store subscribe functions to return an object with an
unsubscribe
method, providing native RxJS support (#2549)
- Prevent text input cursor jumping in Safari (#2506)
- Allow assignments to member expressions (#2510)
- Prevent mutually dependent functions causing an infinite during hoisting (#2542)
- Reuse scheduler promise instead of creating new one each time (#2555)
- Various site/docs fixes
- Everything
- IE
classList
fix (#1868)
- Don't mutate AST
- Expose
stats.props
(#1837)
- Don't throw missing store error when store is declared in component (#1828)
- Event modifiers (#1088)
- Wheel and touch events are passive by default (#1088)
- Add
<svelte:document>
tag (#1484) - Include binding values in server-rendered HTML (#1205)
- Remove attributes when value is undefined/null (#1434)
- Initialise window scroll from component data (#938)
- Remove references to unused properties in generated code (#1187)
- Add TypeScript definitions for store (#1207)
- Better error for missing store (#1807)
- Account for directive dependencies (#1793)
- Detach each block iterations in each blocks with no update method (#1795)
- Fix issue with nested
{#if}
blocks (#1780)
- Fix block insertion order regression (#1778)
- Fix blocks inside
<svelte:head>
(#1774) - Better attribute parsing (#1772)
- Fix parse errors inside directives (#1788)
- Refactor internals (#1678)
- Deprecate
onerror
option (#1745) - Handle edge cases where
destroy
is called beforemount
(#1653) - Make
scroll
binding more efficient (#1579) - Make 'readonly property' store error more informative (#1761)
- Fix missing dependencies in shorthand class directives (#1739)
- Support dynamic
import()
in template expressions
- Fix bug with keyed each blocks and nested components (#1706)
- Coalesce simultaneous store/component updates (#1520)
- Fix nested transitions preventing each block item removal (#1617)
- Add
class
directive shorthand and encapsulate styles (#1695) - Prevent erroneous updates of bound inputs (#1699)
- Coerce second argument to
toggleClass
(#1685)
- Allow actions to take any expression (#1676)
- Run transitions in component context (#1675)
- Correctly set select value on mount (#1666)
- Support
{@debug}
in SSR (#1659) - Don't treat
as empty whitespace (#1658) - Fix outros for if blocks with no else (#1688)
- Set
style.cssText
in spread attributes (#1684)
- Initialise actions on mount rather than hydrate (#1653)
- Allow non-existent components to be destroyed (#1677)
- Pass AMD ID from CLI correctly (#1672)
- Minor AST tweaks (#1673, #1674)
- Reduce code duplication in component initialisation (#1670)
- Add
--shared
CLI option (#1649) - Run first
onstate
before fragment is rendered (#1522) - Exclude current computed prop from state object (#1544)
- Add sourcemaps to
{@debug}
tags (#1647)
- Add a
{@debug}
tag, for inspecting values in templates in dev mode (#1635) - Fix dimension bindings in iOS (#1642)
- Pass props to custom elements rather than setting attributes, where appropriate (#875)
- Handle whitespace in lists consistently between SSR and DOM renderers (#1637)
- Improve error for invalid
ref
names (#1613)
- Handle
null
consistently in tags (#1598) - Support object rest in computed properties (#1540)
- Always update dynamic components when expression changes (#1621)
- Encapsulate local styles inside global styles (#1618)
- Fix attribute name regex (#1623)
- Sanitize spread attributes in SSR — fixes vulnerability CVE-2018-6341 (#1623)
- Allow
<input type=file bind:files>
(#1608) - Ensure child window exists before removing listener in
addResizeHandler
(#1600) - Handle transitions in
else
block (#1589)
- Provide more useful error if SSR component attempts to render non-SSR component (#1605)
- Null out refs to dynamic components (#1596)
- Fix bug when an each block contains transitions but its else branch does not (#1559)
- If an event handler throws an exception, don't block all future calls to that handler (#1573)
- Fix conflict when using multiple if-else blocks, some of which use outros and some of which do not (#1580)
- Fix some cases where
.innerHTML
was being used to create child elements when it shouldn't (#1581)
- Use
template.content
instead oftemplate
where appropriate (#1571)
- Play outro transitions on
<svelte:component>
ifnestedTransitions
is true (#1568) - Allow illegal identifiers to be component prop names, for e.g. spreading
data-foo
props (#887) - Abort transition when node is detached (#1561)
- Only include
transitionManager
when necessary (#1514)
- Fix prefixed animation name replacement (#1556)
- Correctly set store on nested components (to parent store, not root store) (#1538)
- Prevent unnecessary remounts (#1527)
- Allow
refs.*
as callee (#1526) - Handle empty lists when outroing (#1532)
- Fix spread props with multiple dependencies (#1515)
- Add
__svelte_meta
object to elements in dev mode, containing source info (#1499) - Fix
bind:online
in dev mode (#1502) - Update v1 warnings/errors (#1508)
- Transform prefixed keyframes (#1504)
- Fix nested transition bug (#1497)
- Handle cases where only some
if
block branches have outros (#1492)
- Nested transitions respect
skipIntroByDefault
(#1460) - Always create outro for top-level block (#1470)
- Fix spread+bindings on dynamic components (#1433)
- Abort in-progress animations, if a new one starts (#1458)
- Allow animations to be parameterised (#1462)
- Absolutely position outroing animated nodes (#1457)
- Add
animate
directive (#1454) - Add
skipIntroByDefault
compiler option andintro: true
init option (#1448) - Add
nestedTransitions
compiler option (#1451) - Component outros, if
nestedTransitions
is true (#1211) - Allow transition functions to return a function, for inter-transition coordination (#1453)
- Pass
1 - t
as second argument to transition functions (#1452)
- Add new ARIA attributes (#1436)
- Add
Promise
to whitelisted globals (#1441) - Allow spaces around reserved keyword attributes (#1445)
- Support transitions in
await
blocks (#956) - Abort outros if block is recreated (#1425)
- Wait until transitions have completed before removing styles (#648)
- Support event shorthand on dynamic components (#1427)
- Various codegen improvements (#1419, #1421, #1422, #1424)
- Correctly handle
await
blocks with no dynamic content (#1417) - Allow spread props on elements with static attribute tests (#1429)
ref
directives prevent HTMLified content (#1407)- Store computed properties update components immediately upon declaration (#1327)
- Evaluate
each
key in child scope (#1397) - Prevent false negatives and positives when detecting cyclical computed store properties (#1399)
- Only update dynamic component props (#1394)
- Fix DOM event context (#1390)
- Integrate CLI (#1360)
- Allow arbitrary destructuring for each block items, with binding (#1385)
- Each block keys can use arbitrary expressions (#703)
bind:offsetWidth
,bind:offsetHeight
,bind:clientWidth
andbind:clientHeight
(#984)- Leaner generated code for
each
blocks (#1287)
- Allow computed properties to have entire state object as dependency (#1303)
- Fix
stats
whenoptions.generate
isfalse
(#1368) - Assign custom methods to custom elements (#1369)
- Fix
this
value in custom event handlers (#1297) - Re-evaluate
each
values lazily (#1286) - Preserve outer context in
await
blocks (#1251)
- Internal refactoring (#1367)
- Report initial
changed
based on state, not expected props (#1356) - Set state to empty object, not null, on destroy (#1354)
- Prevent stale state in component event handlers (#1353)
See the blog post for information on how to upgrade your apps
- New template syntax (#1318)
- Emit ES2015 code, not ES5 (#1348)
- Add
onstate
andonupdate
hooks, removecomponent.observe
method (#1197) - Use destructuring syntax for computed properties (#1069
- Change signature of
svelte.compile
(#1298) - Remove
validate
andStylesheet
from public API (#1348) - Don't typecast numeric attributes (#657)
- Always compile with
Store
support, and cascading disabled (#1348) - Remove unused
hash
property from AST (#1348) - Rename
loc
property tostart
in warnings and errors (#1348)
- Fix computed properties in SSR renderer (#1349)
- Deprecate passing a string argument to
component.get
(#1347)
- Allow
observe
method to be overwritten
- Add
onstate
andonupdate
lifecycle hooks and deprecatecomponent.observe
(#1197) - Add
on
andfire
toStore
, deprecateonchange
andobserve
(#1344) - Require computed properties to have destructured argument in v2 mode (#1069)
- Add a
code
field to errors and warnings (#474) - When using v2 syntax, do not use interpolation in non-root
<style>
tags (#1339)
- Support v2 syntax with
parser: 'v2'
option (#1318)
- Fix validation of
multiple
attributes on bound<select>
elements (#1331)
- Fix order of insertions for keyed each blocks with siblings (#1306)
- Bail out of CSS DCE if element has spread attribute (#1300)
- Allow
console
etc in component events (#1278) - Deconflict against inherited contexts (#1275)
- Make CSS DCE case insensitive (#1269)
- Error on dynamic
multiple
attribute for bound select (#1270) - Allow custom events on
<:Window>
(#1268)
- Fix spread updates on dynamic components (#1307)
- Spread properties (#195)
svelte.compile
returns an object with{ js, css, ast }
properties, wherejs
andcss
are{ code, map }
objects (#1298)- Fixed broken compile errors when using Rollup (#1296)
- Deprecate
teardown
in custom event handlers (#531) - Allow static content in keyed
each
block (#1291) - Allow empty content in keyed
each
block (#1295) - Only delete applicable transitions (#1290)
- Allow backtick string literals for
svg
,tag
, andprops
properties (#1284) - Fix removal of transition styles under Firefox (#1288)
- Fix initial state regression (#1283)
- Actions run in the context of the component (#1279)
- Set refs when mounting dynamic components (#1280)
- (1.58.1 failed to publish)
- Actions (#1247)
- Support
preserveComments
option in SSR mode (#1265) - Fix performance regression (#1274)
- Fast row swapping (#588)
- Better error messages for invalid directives (#1242)
- Fix local context variable bugs (#1240, #1254)
- Skip missing property warnings for computed/global properties in dev mode (#1246)
- Add end position to warnings (#1250)
- Deconflict context names (#1229)
- Use
setAttribute
to set input types (#1209) - Scale transition duration correctly (#1221)
- Fix scoped CSS on static child elements (#1223)
- Fix scoped CSS on SVG elements (#1224)
- Add each_value to contextProps (#1206)
- Use classes (not attributes) for style encapsulation, and base36-encode hashes (#1118)
- Allow
component
andstate
to be context names (#1213) - Don't remove
@supports
rules whencascade: false
(#1215)
- Top-level transitions work inside nested components (#1188)
- Always use internal
_mount
method (#1201)
- Null out
key
for children of keyed each blocks (#1202)
- Internal refactor (#1122)
- Use correct context for component events (#1184)
- Allow observing
$foo
in dev mode (#1181) - Handle dynamic data in default slot (#1144)
- Fix cancellation of store
onchange
handlers (#1177) - Write
["default"]
instead of.default
in legacy mode (#1166) - Upgrade Acorn (#1182)
- Don't warn about capitalisation if
options.name
begins with non-alphabetical character (#1179)
- Add
immutable
compiler option for Svelte and runtime option forStore
(#1146) - Fix component store bindings (#1100)
- Fire
oncreate
when custom element is attached (#1117) - Downgrade empty blocks to a warning (#1156)
- Error on unclosed comment (#1156)
- Prevent
await
blocks using stale state (#1131) - Prevent erroneous missing data warnings for custom elements (#1065)
- Remove empty selectors in prod mode (#1138)
- Escape attribute values in SSR mode (#1155)
- Remove
<noscript>
elements in DOM mode (#1108) - Allow hydration of non-root
<script>
/<style>
tags (#1163) - Allow interpolation in non-root
<style>
tags (#1163)
- Run
oncreate
hooks depth-first, top-to-bottom (#1135) - Render boolean attributes correctly in SSR mode (#1109)
- Add
feed
aria role to expected roles when doing a11y checks (#1124) - More complete fix for case sensitive attributes (#1062)
- Handle CLRF line endings in await block comments (#1132)
- Base scoping selectors on
<style>
contents alone (#1091)
- Deconflict referenced globals (#1079)
- Validate contents of
await
blocks (#1061) - Fire
oncreate
for components inawait
blocks (#1061) - Automatically fix attribute casing (#1062)
- Fix escaping in
<script>
and<style>
(#1082) - Error if invalid characters are used in computed properties, and allow any valid identifier in props (#1083)
- Don't run a11y tests on components (#1110)
- Respect
store
option in SSR mode (#1107)
- Only escape <, > and & characters (#1082)
- Lock
scroll
bindings (#1071) - Escape HTML entities when compiling to static HTML (#1066)
- Apply a11y warnings to SVG
<a>
attributes withxlink:href
(#1008)
- Prevent main fragment being created twice in custom elements (#1064)
- Detect unused/misplaced components (#1039)
- Warn on unused event definitions/transitions (#1051)
- Remove whitespace inside
<:Head>
(#1026) - Optimise
<title>
(#1027) - Add
bind: false
option to disable two-way binding (#54)
- Return
html
from SSR compilerrender().toString()
methods (#1044) - Correctly reinitialise dynamic components (#1040)
- Allow
<option>
outside<select>
(#1022) - Fix data references in await-block event handlers (#1032)
- Pass
store
to children in SSR mode (#1029)
- Support
store
as a component property (#1028)
- Added
<:Head>
component for injecting contents into document head (#1013)) - SSR
render(...)
method now returns a{ html, css: { code, map }, head }
object (#1013) - SSR
renderCss(...)
method is deprecated (#1013) - Add a
preload
function to components (#1015) - Expose
this.root
on nested components (#1023)
- Deconflict computed properties against arguments to
_recompute
(#1012) - Allow
await
blocks in slots (#1018) - Allow components without slots to have whitespace as only child (#1007)
- Correctly set
toString
onCompileError
(#1016)
- Sanitize filenames in SSR mode (#1005)
- Support dynamic
import(...)
inside<script>
tags (#1003)
await...then
shorthand (#957)- Allow dynamic components inside elements (#993)
- Don't use
dataset
on SVG nodes (#982) - Fix erroneous
<figcaption>
a11y warning (#991) - Handle empty classes when pruning unused selectors (#978)
- Better trimming of SSR'd output (#976)
- Don't add
event
toexpectedProperties
(#972) - Emit error on bad
set
arguments in dev mode (#990)
- Pass
filename
through to preprocessors (#983)
- Dynamic components (#971)
- Fix bidirectional transitions that reference state (#962)
- Fix parameterised transitions (#962)
- Prevent boolean attributes breaking estree-walker expectations (#961)
- Throw error on cyclical store computations (#964)
- Export
Store
class to manage global state (#930) - Recognise
aria-current
(#953) - Support SSR register options including
extensions
(#939) - Friendlier error for illegal contexts (#934)
- Remove whitespace around
<:Window>
components (#943)
- Correctly append items inside a slotted
each
block (#932) - Fix
<:Window bind:online/>
(#936) - Attach globals to state upon initialisation (#908)
- Implement
indeterminate
binding for checkbox inputs (#910) - Use
<option>
children asvalue
attribute if none exists (#928) - Allow quoted property names in default export and sub-properties (#914)
- Various improvements to generated code for bindings
- Handle self-destructive bindings (#917)
- Prevent
innerHTML
with<option>
elements (#915) - Use
dataset
unlesslegacy
is true (#858) - Add
prepare
script to facilitate installing from git (#923)
- Prevent argument name clashes (#911)
- Fix UMD factory arguments (#918)
- Don't attempt to set computed values (#893)
- Fix TypeScript build error (#919)
- Handle attribute selectors with no value (#905)
- Retain
async
keyword when extracting functions (#904) - Shallow clone
data
on initialisation (#891)
onwarn
andonerror
receive default handlers as second arguments (#883)- Recognise
muted
as boolean property on<audio>
elements (#886) - Array destructuring for
each
block contexts (#889)
- Always use explicit closing tags with
innerHTML
(#866) - Escape text in
textContent
andinnerHTML
expressions (#868)
- Extract shared init logic (#855)
- Allow
console.*
calls in event handlers (#782) - Marker comments in output (#823)
- Use
textContent
andinnerHTML
where appropriate (#23) - Various improvements to generated code
- Allow
slot='...'
inside custom elements (#827) - Disallow
slot='...'
inside if/each blocks (#849) - Use correct parent node for slotted if blocks (#850)
- Always use anchors for slotted content (#822)
- Prevent ES6 in helpers (#838)
- Correctly determine whether to use
timeRangesToArray
(#837)
- Always attach fragment to shadow root (#821)
- Add
buffered
,seekable
,played
bindings to media elements (#819) - Quote
class
properties in legacy mode (#830) - Warn on missing
lang
attribute on<html>
(#828)
- Compile-time a11y warnings (#815)
- Remove redundant input blowback guards (#645)
- Use component name in debugging messages (#781)
- Experimental support for compiling to custom elements (#797)
- Optimize
style
attributes where possible (#455)
set
andget
continue to work untildestroy
is complete (#788)- Observers of unchanged bound values don't fire incorrectly (#804)
- Nested components with slotted content render correctly in SSR mode (#801)
- More efficient rendering of raw and slotted content (#637)
- Handle unquoted attributes in attribute selectors (#798)
- Support nested
<slot>
elements (#790) - Attach
options
to instance (#550, #777) - Error if transitions are applied to component (#791)
- Handle CSS variables in
<style>
tag (#757)
- Replace
{{yield}}
with<slot>
— adds fallback content named slots, andoptions.slots
(#763)
- Allow
anchor
initialisation option, alongsidetarget
(#784) - Remove leading CSS selectors safely (#783)
- Add
legacy
compile option, which adds IE9 compatibility (#773)
- Update all component bindings simultaneously (#760)
- Fix
@keyframes
atrules withfrom
andto
selectors (#774)
- Only recompute tag and attribute values if they could have changed (#768)
- Fix CSS scoping with multiple levels of descendant selectors (#767)
- Preserve space before non-parenthesized media query expression (#759)
- Call
create()
on new iterations of static each blocks (#762) - Use
change
events as well asinput
events to bind range inputs (#740)
- Replace
set
anddestroy
withnoop
when component is destroyed (#744)
- Fix unescaping of special words in SSR mode (#741)
- Support
ref:foo
as a CSS selector (#693) - Prevent magic-string bugs by only minifying CSS combinators if
cascade: false
(#743) - Don't throw an error if component is destroyed twice (#643)
- Minify CSS and remove unused styles (#697)
- Optimize ternary expressions when excluding unused CSS (#696)
- Clear refs after
ondestroy
callbacks fire (#706) - Prevent certain forms of component binding blowback (#721)
- Use helper to encapsulate styles (#375)
- Event propagation shorthand —
on:foo
equalson:foo='fire("foo", event)
(#638) - Allow
refs.*
in event handlers, and validate them (#686)
- Unescape
#
characters (#722)
- Fix select binding regression (#724)
- Enforce correct order of operations when initialising (#708 and #714)
- Ensure data is up-to-date when re-rendering yield block (#711)
- Fix unescaping of strings, preserve at-rules in CSS (#712)
- Preserve whitespace at end of each blocks (#713)
- Better CSS sourcemaps (#716)
- Fix hoisted event handlers (#699)
- Fire
intro.start
andoutro.start
events (#702) - Preserve order of components in keyed each blocks (#700)
- Add
cssMap
property to compiler output (#698)
- Deconflict names with imports in SSR compiler (#655)
- Improved transition performance (#670)
- Run transitions on initial render (#651)
- Add dev mode warning if
hydrate
is true buthydratable
was false (#664) - Manipulate sourcemap to make missing loop values obvious (#683)
- Only add CSS scoping attributes where necessary (#679)
- Warn on unused CSS selectors (#678)
- Fix
<select>
binding in loop (#685) - Prevent bindings from calling
oncreate
functions prematurely (#694) - Simpler codegen (#673)
- Don't recreate if blocks incorrectly (#669)
- Pass parameters to
get_block
(#667)
- Fix if blocks being recreated on update (#665)
- Fix each-else blocks that are empty on initial render (#662)
- Fix nested component unmounting bug (#643)
- Include
ast
insvelte.compile
return value (#632) - Set initial value of
<select>
binding, if unspecified (#639) - Mark indirect dependencies of
<select>
bindings (i.e. the dependencies of their<option>
values) (#639)
- Fix nested component unmounting bug (#625)
- Allow components to have computed member expression bindings (#624)
- Handle empty
<style>
tags (#634) - Warn on missing component (#623)
- Allow dynamic
type
attribute for unbound inputs (#620) - Rename
addEventListener
andremoveEventListener
directives (#621)
- Escape template strings correctly in SSR output (#616)
- Prevent magic-string deprecation warning (#617)
- Sanitise event handler names (#612)
- Symmetry between
mount
andunmount
. This is potentially a breaking change if your components import other components that were precompiled with an earlier version of Svelte (#592) - Add
cascade
option, which prevents styles affecting child components iffalse
, unless selectors are wrapped in:global(...)
and keyframe declaration IDs are prefixed with-global-
. This will become the default behaviour in v2 (#583) - Support binding to computed member expressions (#602)
- Coerce empty string in
number
/range
inputs toundefined
, not0
(#584) - Fix insert location of DOM elements in each/if/nested component edge cases (#610)
- Always use
helpers
if referenced, not just for call expressions (#575) - Fix parsing of
<textarea>
children (#599) - Treat
<textarea>
value attributes and children as equivalent, and fail validation if both are present (#599) - Fix
<textarea>
SSR (#599) - Apply CSS transition styles immediately if transition has delay (#574)
- Ensure
transitionManager
is treeshakeable (#593) - Fix for environments where
node.style.animation
is undefined (#587) - Fix order of operations when dealing with
<select>
elements (#590) - Downgrade 'invalid callee' to a warning (#579)
- Convert to TypeScript (#573)
- Fix destruction of compound if-blocks with outros (#572)
- Fix insertion order of
if
blocks and their anchors (#569)
- Faster, better updates of keyed each blocks (#373, #543)
- Use element IDs to robustly track dynamically injected
<style>
tags (#554) - Abort outros before corresponding intros (#546)
- Generate less code for
if
blocks withelse
blocks (#540) - Ensure
{{yield}}
block content is injected into the right place (#561) - Simpler, more readable codegen code (#559)
- Validate transition directives (#564)
- Apply delays to bidirectional transitions (#562)
- Handle all valid HTML entities (#565)
- Fix outros on compound
if
blocks (#565) - Validation for
<:Window>
tags (#565) - Increased test coverage (#565)
- Export
generateKeyframes
, so that CSS transitions work
- Experimental support for transitions (#7)
- Use
querySelector(':checked')
instead ofselectedOptions
(#539) - Stringify helpers before bundling them, to avoid renaming errors (#538)
- Parenthesize if-block conditions (#532)
- Fix parsing of parenthesized expressions (#534)
- Fix error on
bind:checked
that doesn't belong to a checkbox input (#529)
- Visit
<select>
attributes after children, to ensure options are in the right state (#521) - Use sibling elements as anchors rather than creating comment nodes wherever possible (#3)
- Replace bad characters when creating variable names based on element names (#516)
- Add
currentTime
,duration
andpaused
bindings for media elements (#406) - Don't treat helpers as dependencies (#492)
- Allow
<:Window>
event handlers to access component state (#497) - Allow two-way binding to properties named 'component' (#495)
- Group checkbox bindings correctly, to avoid erroneously unchecking siblings (#498)
- Validate two-way bindings (#494)
- Allow dynamic each-block to have static else-block (#501)
- Initialise
<select>
value correctly (#502)
- Clone data before merging it with state (#479)
- Apply binding event handlers before user event handlers (#486)
- Dev mode — downgrade 'missing data' to a warning, and ignore whitelisted globals (#475)
- Fix
<select>
value binding when options are updated late (#476) - Throw at compile time if event handler references invalid callee (#473)
- Check for helper function purity (#473)
- Validate
namespace
option (#473)
- Replace bad characters when creating variable names based on attributes (#470)
- Better guard against naming conflicts (#465)
- Better error if getters and setters are used with
methods
(#425) - Don't create whitespace nodes inside elements that can't use them (#189)
- Collapse consecutive
if
statements with the same condition (#450) - Window
scroll
bindings are bidirectional (#404) - Add
bind:online
to window (#404) - In dev mode, throw if read-only properties are set (#404)
- Prevent conflicts with component name (#464)
- Ensure event handler names are deconflicted (#466)
- Fix observers —
defer: true
now triggers callback after DOM is updated (#441) - Handle empty
computed
property (#452) - Correctly bind one-way
<select>
value attributes with objects (#423) - Hoist event handlers inside each blocks, where possible (#456)
- Don't bind event handler callbacks (#433)
- Internal refactoring and neater code generation (#453)
- Use
assign
helper instead ofObject.assign
for better performance and legacy compatibility (#431) - Improved code generation (#419), (#440), (#442)
- Prevent unclosed
<script>
tag causing infinite loop (#435)
- Correctly handle
{{true}}
,{{false}}
and{{null}}
(#424) - Update
<select>
value attributes correctly (#423) - Bind custom event handler callbacks (#428)
- Disallow
import root
(#430) - Prevent component bindings mutating the wrong object (#432)
- Fix deep component bindings (#420)
- Include
css
property in compiler output (#409) - Treat functions as mutable objects when recomputing (#413
- Include magic-string in bundle (#410)
- Disable unneeded Bublé transformations for slimmer output (#411)
- Add
<:Window>
meta tag with event listeners, and a handful of bindings (#371) - Don't uncheck radios incorrectly (#399)
- Deconflict non-helper functions (
addCss
etc) (#388) - Allow reserved words in tags, e.g.
{{class}}
(#383)
- Shorthand attributes —
<Widget :foo/>
is equivalent to<Widget foo='{{foo}}'/>
(#384) - Support
bind:group
for radio and checkbox inputs (#311, #312) - Better sourcemap support for two-way bindings
- Dev mode warning for bad
component.observe
arguments (#369) - Translate
component.on('teardown', ...)
tocomponent.on('destroy', ...)
and add dev warning (#365) - Use shared prototype to save bytes (#378)
- Add component CSS to each document a component is rendered to (#331)
- Fix two-way binding for components inside
each
blocks (#356)
- Add
format: 'eval'
andsvelte.create
, to create components directly from source code (#345) - Node 4 compatibility (#109)
- Prevent
'</script>'
string occurence breaking pages (#349) - Allow reference to whitelisted globals without properties (#333)
- Don't remove
incorrectly (#348) let
->var
inaddCss
block (#351)
- Accept any case for doctype declarations (#336)
- Allow non-top-level
<script>
and<style>
tags to pass through without processing (#335)
- typecheck argument in _set when in dev mode (#342)
- Prevent duplicate helpers in non-shared mode (#337)
- Add development warnings (#13), (#320), (#177), (#249)
- Better error if parser encounters an unmatched closing tag (#321)
- Allow implicitly closed elements (#318)
- More informative error messages for unclosed elements/blocks (#258)
- Deprecate
onrender
andonteardown
in favour ofoncreate
andondestroy
(#40)
- Prevent duplicate imports (#308)
- Use
input
events (notchange
) for all input elements other thancheckbox
andradio
, and textareas (#309) - Encapsulate keyframe declarations (#245)
- Deconflict imports and shared helpers (#222)
- Deconflict each-block contexts and reserved words (#222)
- Allow shorthand properties in expressions (#296)
- Include CSS AST in
svelte.parse
output (#302) - Better handling of CSS parse errors (#302)
- Initialise
<select>
elements with two-way binding correctly (#301) - Allow local context in component event handlers inside
each
blocks (#290) - Fix two-way binding for components inside
each
blocks (#290)
- Initialise dynamic
<option>
value correctly (#291)
- Ensure
sources
andsourcesContent
are populated in sourcemaps, even if none of the original code is used (#295) - Add
outputFilename
option to populatefile
andsources
sourcemap properties correctly (#295)
- Don't trigger bindings for torn-down components (#277)
- SSR: Handle two-way bindings (#275)
- Improve performance by checking data has changed before updates (#279)
- Parse CSS with css-tree to prevent transformation errors with unconventional styles (#288)
- Always trigger
onrender
, including when change initiator is a nested component (#263) - Handle default function parameters in computations (#274)
- Handle
<!doctype>
declarations (#255)
- Fix updates of yields inside each blocks (20e1b05)
- SSR: Handle attributes with values that begin with a number (#248)
- Handle multiline comments in CSS (#252)
- Fix
{{yield}}
bugs for components insideif
andeach
blocks (#230, #231) - Set attributes on
<svg>
elements correctly (#233) - Add
svelte.VERSION
property to compiler
- Use helpers for
addEventListener
,removeEventListener
,setAttribute
(#227) - Escape
sharedPath
(#229) - Handle attributes with values that begin with a number (#234)
- Update dependencies
- SSR: Handle component directives at arbitrary positions (#221)
- Provide useful feedback on invalid void closing tag (#224)
- Replace
standalone: false
withshared: true
, orshared: 'custom/path/to/shared.js'
(#218) - Include
shared.js
in package
- Keyed
each
blocks (#81)
- SSR compiler: Support
format
option (#196) - SSR compiler: Don't self-close 'normal' elements (#200)
- Remove leading spaces from scoped CSS (#140)
- Internal refactoring
- Allow whitelisted globals in templates (#185)
- Intercept parse errors with
options.onerror
- Add support for
namespace
declaration for SVG (etc) components (#147) - Throw error if methods or lifecycle hooks are arrow functions that use
this
orarguments
(#179) - Use
setAttribute()
forlist
attributes, to preserve link to<datalist>
(#178) - Throw error if default export is not an object literal (#190)
- Internal refactoring
- Omit directives in server-side rendering (#163)
- Handle comments in SSR (#165)
- Support calling methods of
event
/this
in event handlers (#162) - Remove
mount
from public API (#150)
- Server-side rendering is available as a compiler option (
generate: 'ssr'
) (#159) - Allow call expressions where function is not in
helpers
(#163)
- Handle
xmlns
attributes correctly (#142) - Error on duplicate
<style>
/<script>
tags rather than failing silently (#142) - Don't create whitespace text nodes inside SVG elements (#142)
- Require void elements to be lowercase, to eliminate confusion with components (#137)
- Support multiple SVG elements in a component (#130)
- Separate fragment creation from
mount
(#91) - Trigger
onrender
hook at correct time for nested components (#103) - Fix keypath dynamic attributes in components (#46)
- Implement
{{yield}}
(#112) - Optimise teardown (#99)
- Require computed properties to have at least one dependency (#115)
- Support
{{#each ...}}...{{else}}...{{/each}}
(#90) - Triple mustaches (#35)
- Correctly escape HTML entities (#85)
- Generate useful sourcemaps (#60)
- Ensure compiler only generates ES5 code (#75)
get()
without arguments returns entire state object (#73)
- Handle empty attributes in elements and components (#63)
- Detach top-level text nodes inside departing each blocks (#62)
- Better generated code for
if
blocks, especially withelse
/elseif
chains (#28) - Trim unnecessary whitespace from
else
/elseif
blocks (#49) - Handle trailing comments in script tags (#64)
Set style.cssText
rather than style
(#44)
- Preserve SVG namespace inside each blocks
- Always use
setAttribute
with SVG elements
- Generate AMD, CJS, IIFE and UMD builds
- Correctly insert text nodes before anchors (#31)
- Fix bug where departing element would unset
ref
incorrectly (#24) - Basic template validation (#6)
- Fire
onrender
hooks once component is in DOM (#18) - Only detach nodes when necessary to do so (#26)
- On second thoughts, don't transpile build. Was only really for Uglify's benefit, which is daft
- Transpile build
- Only generate UMD build, for now
- Include dependencies in the build, treat as
devDependencies
- Faster initial render
- Parent data overrides child defaults
- Remove top-level text nodes on teardown
- Handle
readUntil
errors in parser - Basic
<select>
binding - Handle missing data
- Prevent infinite set/observe loops
- Add
bind:foo
shorthand else
andelseif
blocks- Hoist imports
- Support unquoted attributes
- Handle entities in attributes
- Inline nested components
fire
andon
methods
- Breaking change – Svelte compiler now generates constructor functions rather than factories (#2)
- SVG support
- First release capable of building TodoMVC
- Just squatting on the package name