-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
documentation/docs/98-reference/.generated/legacy-warnings.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### legacy_reactive_block_mutation | ||
|
||
``` | ||
Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## legacy_reactive_block_mutation | ||
|
||
> Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/svelte/scripts/process-messages/templates/legacy-warnings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { DEV } from 'esm-env'; | ||
|
||
var bold = 'font-weight: bold'; | ||
var normal = 'font-weight: normal'; | ||
|
||
/** | ||
* MESSAGE | ||
* @param {string} PARAMETER | ||
*/ | ||
export function CODE(PARAMETER) { | ||
if (DEV) { | ||
console.warn(`%c[svelte] ${'CODE'}\n%c${MESSAGE}`, bold, normal); | ||
} else { | ||
// TODO print a link to the documentation | ||
console.warn('CODE'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* This file is generated by scripts/process-messages/index.js. Do not edit! */ | ||
|
||
import { DEV } from 'esm-env'; | ||
|
||
var bold = 'font-weight: bold'; | ||
var normal = 'font-weight: normal'; | ||
|
||
/** | ||
* Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`. | ||
*/ | ||
export function legacy_reactive_block_mutation() { | ||
if (DEV) { | ||
console.warn(`%c[svelte] legacy_reactive_block_mutation\n%cDetected a migrated \`$:\` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.`, bold, normal); | ||
} else { | ||
// TODO print a link to the documentation | ||
console.warn("legacy_reactive_block_mutation"); | ||
} | ||
} |