fix: mark `accessors` and `immutable` as deprecated

pull/11277/head
Rich Harris 1 year ago
parent b91a67ba68
commit 2837a1b30c

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: mark `accessors` and `immutable` as deprecated

@ -94,6 +94,7 @@ export interface CompileOptions extends ModuleCompileOptions {
* 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`. * 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`.
* *
* @default false * @default false
* @deprecated This will have no effect in runes mode
*/ */
accessors?: boolean; accessors?: boolean;
/** /**
@ -107,6 +108,7 @@ export interface CompileOptions extends ModuleCompileOptions {
* This allows it to be less conservative about checking whether values have changed. * This allows it to be less conservative about checking whether values have changed.
* *
* @default false * @default false
* @deprecated This will have no effect in runes mode
*/ */
immutable?: boolean; immutable?: boolean;
/** /**

@ -40,7 +40,10 @@ export const validate_component_options =
object({ object({
...common, ...common,
accessors: boolean(false), accessors: deprecate(
'The accessors option has been deprecated. It will have no effect in runes mode.',
boolean(false)
),
css: validator('external', (input) => { css: validator('external', (input) => {
if (input === true || input === false) { if (input === true || input === false) {
@ -73,7 +76,7 @@ export const validate_component_options =
discloseVersion: boolean(true), discloseVersion: boolean(true),
immutable: deprecate( immutable: deprecate(
'The immutable option has been deprecated. It has no effect in runes mode.', 'The immutable option has been deprecated. It will have no effect in runes mode.',
boolean(false) boolean(false)
), ),

@ -585,6 +585,7 @@ declare module 'svelte/compiler' {
* 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`. * 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`.
* *
* @default false * @default false
* @deprecated This will have no effect in runes mode
*/ */
accessors?: boolean; accessors?: boolean;
/** /**
@ -598,6 +599,7 @@ declare module 'svelte/compiler' {
* This allows it to be less conservative about checking whether values have changed. * This allows it to be less conservative about checking whether values have changed.
* *
* @default false * @default false
* @deprecated This will have no effect in runes mode
*/ */
immutable?: boolean; immutable?: boolean;
/** /**
@ -2395,6 +2397,7 @@ declare module 'svelte/types/compiler/interfaces' {
* 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`. * 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`.
* *
* @default false * @default false
* @deprecated This will have no effect in runes mode
*/ */
accessors?: boolean; accessors?: boolean;
/** /**
@ -2408,6 +2411,7 @@ declare module 'svelte/types/compiler/interfaces' {
* This allows it to be less conservative about checking whether values have changed. * This allows it to be less conservative about checking whether values have changed.
* *
* @default false * @default false
* @deprecated This will have no effect in runes mode
*/ */
immutable?: boolean; immutable?: boolean;
/** /**

Loading…
Cancel
Save