diff --git a/src/shared/index.js b/src/shared/index.js index 3d3e8b56d0..3ff0a2d421 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -77,6 +77,8 @@ export function observe(key, callback, options) { } export function observeDev(key, callback, options) { + console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); + var c = (key = '' + key).search(/[.[]/); if (c > -1) { var message = diff --git a/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js b/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js index 5ba9581cf5..b580ce1155 100644 --- a/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js +++ b/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js @@ -92,6 +92,8 @@ function observe(key, callback, options) { } function observeDev(key, callback, options) { + console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); + var c = (key = '' + key).search(/[.[]/); if (c > -1) { var message = diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js index 5ba9581cf5..b580ce1155 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js @@ -92,6 +92,8 @@ function observe(key, callback, options) { } function observeDev(key, callback, options) { + console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); + var c = (key = '' + key).search(/[.[]/); if (c > -1) { var message = diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js index 5ba9581cf5..b580ce1155 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js @@ -92,6 +92,8 @@ function observe(key, callback, options) { } function observeDev(key, callback, options) { + console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); + var c = (key = '' + key).search(/[.[]/); if (c > -1) { var message =