@@ -19,7 +19,6 @@ import { migrate_svelte_ignore } from '../utils/extract_svelte_ignore.js';
19
19
import { validate_component_options } from '../validate-options.js' ;
20
20
import { is_reserved , is_svg , is_void } from '../../utils.js' ;
21
21
import { regex_is_valid_identifier } from '../phases/patterns.js' ;
22
- import { VERSION } from 'svelte/compiler' ;
23
22
24
23
const regex_style_tags = / ( < s t y l e [ ^ > ] + > ) ( [ \S \s ] * ?) ( < \/ s t y l e > ) / g;
25
24
const style_placeholder = '/*$$__STYLE_CONTENT__$$*/' ;
@@ -114,16 +113,6 @@ function find_closing_parenthesis(start, code) {
114
113
return end ;
115
114
}
116
115
117
- function check_support_writable_deriveds ( ) {
118
- const [ major , minor , patch ] = VERSION . split ( '.' ) ;
119
-
120
- if ( + major < 5 ) return false ;
121
- if ( + minor < 25 ) return false ;
122
- return true ;
123
- }
124
-
125
- const support_writable_derived = check_support_writable_deriveds ( ) ;
126
-
127
116
/**
128
117
* Does a best-effort migration of Svelte code towards using runes, event attributes and render tags.
129
118
* May throw an error if the code is too complex to migrate automatically.
@@ -963,11 +952,7 @@ const instance_script = {
963
952
const reassigned_bindings = bindings . filter ( ( b ) => b ?. reassigned ) ;
964
953
965
954
if (
966
- // on version 5.25.0 deriveds are writable so we can use them even if
967
- // reassigned (but if the right side is a literal we want to use `$state`)
968
- ( support_writable_derived
969
- ? node . body . expression . right . type !== 'Literal'
970
- : reassigned_bindings . length === 0 ) &&
955
+ node . body . expression . right . type !== 'Literal' &&
971
956
! bindings . some ( ( b ) => b ?. kind === 'store_sub' ) &&
972
957
node . body . expression . left . type !== 'MemberExpression'
973
958
) {
0 commit comments