Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the lit-html marker length to be consistently 9 characters. #4570

Merged
merged 4 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/lit-html/src/lit-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const boundAttributeSuffix = '$lit$';
// a valid element name and attribute name. We don't support dynamic names (yet)
// but this at least ensures that the parse tree is closer to the template
// intention.
const marker = `lit$${String(Math.random()).slice(9)}$`;
const marker = `lit$${String(Math.random()).slice(-9)}$`;
rictic marked this conversation as resolved.
Show resolved Hide resolved

// String used to tell if a comment is a marker comment
const markerMatch = '?' + marker;
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import * as fs from 'fs';
// it's likely that we'll ask you to investigate ways to reduce the size.
//
// In either case, update the size here and push a new commit to your PR.
const expectedLitCoreSize = 15437;
const expectedLitHtmlSize = 7252;
const expectedLitCoreSize = 15438;
const expectedLitHtmlSize = 7253;

const litCoreSrc = fs.readFileSync('packages/lit/lit-core.min.js', 'utf8');
const litCoreSize = fs.readFileSync('packages/lit/lit-core.min.js').byteLength;
Expand Down