Skip to content

Commit 179335c

Browse files
committed
rename $.create_uid() into $.props_id()
1 parent 6698a34 commit 179335c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

packages/svelte/src/compiler/phases/3-transform/client/transform-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ export function client_component(analysis, options) {
564564

565565
if (analysis.props_id) {
566566
// need to be placed on first line of the component for hydration
567-
component_block.body.unshift(b.const(analysis.props_id, b.call('$.create_uid')));
567+
component_block.body.unshift(b.const(analysis.props_id, b.call('$.props_id')));
568568
}
569569

570570
if (state.events.size > 0) {

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export function server_component(analysis, options) {
247247
if (analysis.props_id) {
248248
// need to be placed on first line of the component for hydration
249249
component_block.body.unshift(
250-
b.const(analysis.props_id, b.call('$.create_uid', b.id('$$payload')))
250+
b.const(analysis.props_id, b.call('$.props_id', b.id('$$payload')))
251251
);
252252
}
253253

packages/svelte/src/internal/client/dom/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ let NEXT_UID = 100;
255255
/**
256256
* Create (or hydrate) an unique UID for the component instance.
257257
*/
258-
export function create_uid() {
258+
export function props_id() {
259259
let uid;
260260
if (
261261
hydrating &&

packages/svelte/src/internal/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export {
9797
template,
9898
template_with_script,
9999
text,
100-
create_uid
100+
props_id
101101
} from './dom/template.js';
102102
export { derived, derived_safe_equal } from './reactivity/deriveds.js';
103103
export {

packages/svelte/src/internal/server/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function element(payload, tag, attributes_fn = noop, children_fn = noop)
8585
*/
8686
export let on_destroy = [];
8787

88-
function create_uid_generator() {
88+
function props_id_generator() {
8989
let uid = 100;
9090
return () => 's' + uid++;
9191
}
@@ -104,7 +104,7 @@ export function render(component, options = {}) {
104104
out: '',
105105
css: new Set(),
106106
head: { title: '', out: '' },
107-
uid: options.uid ?? create_uid_generator()
107+
uid: options.uid ?? props_id_generator()
108108
};
109109

110110
const prev_on_destroy = on_destroy;
@@ -543,7 +543,7 @@ export function once(get_value) {
543543
* @param {Payload} payload
544544
* @returns {string}
545545
*/
546-
export function create_uid(payload) {
546+
export function props_id(payload) {
547547
const UID = payload.uid();
548548
payload.out += '<!--#' + UID + '-->';
549549
return UID;

0 commit comments

Comments
 (0)