Skip to content

Commit 2837a1b

Browse files
committed
fix: mark accessors and immutable as deprecated
1 parent b91a67b commit 2837a1b

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.changeset/tiny-meals-deliver.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: mark `accessors` and `immutable` as deprecated

packages/svelte/src/compiler/types/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export interface CompileOptions extends ModuleCompileOptions {
9494
* If `true`, getters and setters will be created for the component's props. If `false`, they will only be created for readonly exported values (i.e. those declared with `const`, `class` and `function`). If compiling with `customElement: true` this option defaults to `true`.
9595
*
9696
* @default false
97+
* @deprecated This will have no effect in runes mode
9798
*/
9899
accessors?: boolean;
99100
/**
@@ -107,6 +108,7 @@ export interface CompileOptions extends ModuleCompileOptions {
107108
* This allows it to be less conservative about checking whether values have changed.
108109
*
109110
* @default false
111+
* @deprecated This will have no effect in runes mode
110112
*/
111113
immutable?: boolean;
112114
/**

packages/svelte/src/compiler/validate-options.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export const validate_component_options =
4040
object({
4141
...common,
4242

43-
accessors: boolean(false),
43+
accessors: deprecate(
44+
'The accessors option has been deprecated. It will have no effect in runes mode.',
45+
boolean(false)
46+
),
4447

4548
css: validator('external', (input) => {
4649
if (input === true || input === false) {
@@ -73,7 +76,7 @@ export const validate_component_options =
7376
discloseVersion: boolean(true),
7477

7578
immutable: deprecate(
76-
'The immutable option has been deprecated. It has no effect in runes mode.',
79+
'The immutable option has been deprecated. It will have no effect in runes mode.',
7780
boolean(false)
7881
),
7982

packages/svelte/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ declare module 'svelte/compiler' {
585585
* If `true`, getters and setters will be created for the component's props. If `false`, they will only be created for readonly exported values (i.e. those declared with `const`, `class` and `function`). If compiling with `customElement: true` this option defaults to `true`.
586586
*
587587
* @default false
588+
* @deprecated This will have no effect in runes mode
588589
*/
589590
accessors?: boolean;
590591
/**
@@ -598,6 +599,7 @@ declare module 'svelte/compiler' {
598599
* This allows it to be less conservative about checking whether values have changed.
599600
*
600601
* @default false
602+
* @deprecated This will have no effect in runes mode
601603
*/
602604
immutable?: boolean;
603605
/**
@@ -2395,6 +2397,7 @@ declare module 'svelte/types/compiler/interfaces' {
23952397
* If `true`, getters and setters will be created for the component's props. If `false`, they will only be created for readonly exported values (i.e. those declared with `const`, `class` and `function`). If compiling with `customElement: true` this option defaults to `true`.
23962398
*
23972399
* @default false
2400+
* @deprecated This will have no effect in runes mode
23982401
*/
23992402
accessors?: boolean;
24002403
/**
@@ -2408,6 +2411,7 @@ declare module 'svelte/types/compiler/interfaces' {
24082411
* This allows it to be less conservative about checking whether values have changed.
24092412
*
24102413
* @default false
2414+
* @deprecated This will have no effect in runes mode
24112415
*/
24122416
immutable?: boolean;
24132417
/**

0 commit comments

Comments
 (0)