UNPKG

@tanstack/router-core

Version:

Modern and scalable routing for React applications

1 lines • 761 B
{"version":3,"file":"ssr-match-id.cjs","names":[],"sources":["../../../src/ssr/ssr-match-id.ts"],"sourcesContent":["// Inlined match ids must not look like relative URLs to crawlers, and must only\n// contain characters that are valid in the HTML input stream. '#' cannot come\n// from a decoded pathname or an encoded param, Seroval emits it unescaped, and\n// it keeps the HTML one-byte: a single char above U+00FF makes V8 widen the\n// whole concatenated HTML string to two bytes per char, which slows SSR.\n// The client compares ids in this encoded form, so no decoder is needed.\nexport function dehydrateSsrMatchId(id: string): string {\n return id.replaceAll('/', '#')\n}\n"],"mappings":";AAMA,SAAgB,oBAAoB,IAAoB;CACtD,OAAO,GAAG,WAAW,KAAK,GAAG;AAC/B"}