@@ -19,7 +19,6 @@ import { migrate_svelte_ignore } from '../utils/extract_svelte_ignore.js';
1919import { validate_component_options } from '../validate-options.js' ;
2020import { is_reserved , is_svg , is_void } from '../../utils.js' ;
2121import { regex_is_valid_identifier } from '../phases/patterns.js' ;
22- import { VERSION } from 'svelte/compiler' ;
2322
2423const regex_style_tags = / ( < s t y l e [ ^ > ] + > ) ( [ \S \s ] * ?) ( < \/ s t y l e > ) / g;
2524const style_placeholder = '/*$$__STYLE_CONTENT__$$*/' ;
@@ -114,16 +113,6 @@ function find_closing_parenthesis(start, code) {
114113return end ;
115114}
116115
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-
127116/**
128117 * Does a best-effort migration of Svelte code towards using runes, event attributes and render tags.
129118 * May throw an error if the code is too complex to migrate automatically.
@@ -963,11 +952,7 @@ const instance_script = {
963952const reassigned_bindings = bindings . filter ( ( b ) => b ?. reassigned ) ;
964953
965954if (
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' &&
971956! bindings . some ( ( b ) => b ?. kind === 'store_sub' ) &&
972957node . body . expression . left . type !== 'MemberExpression'
973958) {
0 commit comments