diff --git a/documentation/docs/98-reference/.generated/compile-warnings.md b/documentation/docs/98-reference/.generated/compile-warnings.md index 732bb92f07..2af9021a6a 100644 --- a/documentation/docs/98-reference/.generated/compile-warnings.md +++ b/documentation/docs/98-reference/.generated/compile-warnings.md @@ -635,7 +635,7 @@ In some situations a selector may target an element that is not 'visible' to the ### custom_element_props_identifier ``` -Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructuring all the props or add the `customElement.props` option. +Using a rest element or a non-destructured declaration with `$props()` means that Svelte can't infer what properties to expose when creating a custom element. Consider destructuring all the props or explicitly specifying the `customElement.props` option. ``` ### element_implicitly_closed diff --git a/packages/svelte/messages/compile-warnings/script.md b/packages/svelte/messages/compile-warnings/script.md index 66aff9188e..26bd0c9027 100644 --- a/packages/svelte/messages/compile-warnings/script.md +++ b/packages/svelte/messages/compile-warnings/script.md @@ -1,6 +1,6 @@ ## custom_element_props_identifier -> Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructuring all the props or add the `customElement.props` option. +> Using a rest element or a non-destructured declaration with `$props()` means that Svelte can't infer what properties to expose when creating a custom element. Consider destructuring all the props or explicitly specifying the `customElement.props` option. ## export_let_unused diff --git a/packages/svelte/src/compiler/warnings.js b/packages/svelte/src/compiler/warnings.js index e8b89a9b22..1226190891 100644 --- a/packages/svelte/src/compiler/warnings.js +++ b/packages/svelte/src/compiler/warnings.js @@ -594,11 +594,11 @@ export function options_renamed_ssr_dom(node) { } /** - * Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructuring all the props or add the `customElement.props` option. + * Using a rest element or a non-destructured declaration with `$props()` means that Svelte can't infer what properties to expose when creating a custom element. Consider destructuring all the props or explicitly specifying the `customElement.props` option. * @param {null | NodeLike} node */ export function custom_element_props_identifier(node) { - w(node, 'custom_element_props_identifier', `Using an identifier or a rest element as the declarator for \`$props\` when compiling to custom elements without declaring \`props\` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructuring all the props or add the \`customElement.props\` option.\nhttps://svelte.dev/e/custom_element_props_identifier`); + w(node, 'custom_element_props_identifier', `Using a rest element or a non-destructured declaration with \`$props()\` means that Svelte can't infer what properties to expose when creating a custom element. Consider destructuring all the props or explicitly specifying the \`customElement.props\` option.\nhttps://svelte.dev/e/custom_element_props_identifier`); } /** diff --git a/packages/svelte/tests/validator/samples/custom-element-props-identifier-rest/warnings.json b/packages/svelte/tests/validator/samples/custom-element-props-identifier-rest/warnings.json index db034df8e8..9f3c59a073 100644 --- a/packages/svelte/tests/validator/samples/custom-element-props-identifier-rest/warnings.json +++ b/packages/svelte/tests/validator/samples/custom-element-props-identifier-rest/warnings.json @@ -17,7 +17,7 @@ "column": 15, "line": 4 }, - "message": "Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructuring all the props or add the `customElement.props` option.", + "message": "Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know what to expose as properties on the DOM element. Consider explicitly destructuring all the props or adding the `customElement.props` option.", "start": { "column": 7, "line": 4 diff --git a/packages/svelte/tests/validator/samples/custom-element-props-identifier/warnings.json b/packages/svelte/tests/validator/samples/custom-element-props-identifier/warnings.json index e7c637cd03..238da1c26d 100644 --- a/packages/svelte/tests/validator/samples/custom-element-props-identifier/warnings.json +++ b/packages/svelte/tests/validator/samples/custom-element-props-identifier/warnings.json @@ -17,7 +17,7 @@ "column": 10, "line": 4 }, - "message": "Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know which props to expose as properties on the DOM element. Consider explicitly destructuring all the props or add the `customElement.props` option.", + "message": "Using an identifier or a rest element as the declarator for `$props` when compiling to custom elements without declaring `props` in the component options means that Svelte can't know what to expose as properties on the DOM element. Consider explicitly destructuring all the props or adding the `customElement.props` option.", "start": { "column": 5, "line": 4