mirror of https://github.com/sveltejs/svelte
breaking: rename svelte/reactivity helpers to include Svelte prefix (#12248)
* breaking: rename svelte/reactivity helpers to include Svelte prefix * keep old exports * add runtime errors * add runtime errors * feedback * feedback * feedback * Update .changeset/nice-jobs-breathe.md Co-authored-by: Conduitry <git@chor.date> --------- Co-authored-by: Conduitry <git@chor.date>pull/12246/head
parent
9a293ea8c4
commit
cae5f1ed26
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
breaking: rename `svelte/reactivity` helpers to include `Svelte` prefix
|
@ -1,4 +1,29 @@
|
|||||||
export { ReactiveDate as Date } from './date.js';
|
export { SvelteDate } from './date.js';
|
||||||
export { ReactiveSet as Set } from './set.js';
|
export { SvelteSet } from './set.js';
|
||||||
export { ReactiveMap as Map } from './map.js';
|
export { SvelteMap } from './map.js';
|
||||||
export { ReactiveURL as URL, ReactiveURLSearchParams as URLSearchParams } from './url.js';
|
export { SvelteURL, SvelteURLSearchParams } from './url.js';
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteDate` instead */
|
||||||
|
export function Date() {
|
||||||
|
throw new Error('Date has been removed, use SvelteDate instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteSet` instead */
|
||||||
|
export function Set() {
|
||||||
|
throw new Error('Set has been removed, use SvelteSet instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteMap` instead */
|
||||||
|
export function Map() {
|
||||||
|
throw new Error('Map has been removed, use SvelteMap instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteURL` instead */
|
||||||
|
export function URL() {
|
||||||
|
throw new Error('URL has been removed, use SvelteURL instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteURLSearchParams` instead */
|
||||||
|
export function URLSearchParams() {
|
||||||
|
throw new Error('URLSearchParams has been removed, use SvelteURLSearchParams instead.');
|
||||||
|
}
|
||||||
|
@ -1,5 +1,30 @@
|
|||||||
export const Date = globalThis.Date;
|
export const SvelteDate = globalThis.Date;
|
||||||
export const Set = globalThis.Set;
|
export const SvelteSet = globalThis.Set;
|
||||||
export const Map = globalThis.Map;
|
export const SvelteMap = globalThis.Map;
|
||||||
export const URL = globalThis.URL;
|
export const SvelteURL = globalThis.URL;
|
||||||
export const URLSearchParams = globalThis.URLSearchParams;
|
export const SvelteURLSearchParams = globalThis.URLSearchParams;
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteDate` instead */
|
||||||
|
export function Date() {
|
||||||
|
throw new Error('Date has been removed, use SvelteDate instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteSet` instead */
|
||||||
|
export function Set() {
|
||||||
|
throw new Error('Set has been removed, use SvelteSet instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteMap` instead */
|
||||||
|
export function Map() {
|
||||||
|
throw new Error('Map has been removed, use SvelteMap instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteURL` instead */
|
||||||
|
export function URL() {
|
||||||
|
throw new Error('URL has been removed, use SvelteURL instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use `SvelteURLSearchParams` instead */
|
||||||
|
export function URLSearchParams() {
|
||||||
|
throw new Error('URLSearchParams has been removed, use SvelteURLSearchParams instead.');
|
||||||
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Set as ReactiveSet, Map as ReactiveMap } from 'svelte/reactivity';
|
import { SvelteSet, SvelteMap } from 'svelte/reactivity';
|
||||||
|
|
||||||
let map = new Map();
|
let map = new Map();
|
||||||
let set = new Set();
|
let set = new Set();
|
||||||
let rmap = new ReactiveMap();
|
let rmap = new SvelteMap();
|
||||||
let rset = new ReactiveSet();
|
let rset = new SvelteSet();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>{rset.entries()} {rset.keys()} {rset.values()}</div>
|
<div>{rset.entries()} {rset.keys()} {rset.values()}</div>
|
||||||
<div>{set.entries()} {set.keys()} {set.values()}</div>
|
<div>{set.entries()} {set.keys()} {set.values()}</div>
|
||||||
<div>{rmap.entries()} {rmap.keys()} {rmap.values()}</div>
|
<div>{rmap.entries()} {rmap.keys()} {rmap.values()}</div>
|
||||||
<div>{map.entries()} {map.keys()} {map.values()}</div>
|
<div>{map.entries()} {map.keys()} {map.values()}</div>
|
||||||
|
Loading…
Reference in new issue