Skip to content

fix: use random string as batch snippet splitter #46

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

Merged
merged 2 commits into from
May 7, 2025

Conversation

Teages
Copy link
Collaborator

@Teages Teages commented May 7, 2025

No description provided.

Copy link

pkg-pr-new bot commented May 7, 2025

Open in StackBlitz

npm i https://pkg.pr.new/vue-sfc-transformer@46

commit: ebd6d5a

@mattmess1221
Copy link

Does it have to be a number or could you get away with using a string? That wouldn't get mangled by the minifier.

@Teages
Copy link
Collaborator Author

Teages commented May 7, 2025

In earlier versions, using string might interfere with determining the original quotes.

Let me check if string works now


I think we can use random string now and there is no need to use uuid

@Teages Teages changed the title fix: avoid scientific notation in handling snippet fix: use random string as batch snippet splitter May 7, 2025
@Teages Teages marked this pull request as ready for review May 7, 2025 15:36
@Teages Teages requested a review from Copilot May 7, 2025 15:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the inline random batch splitter generation with a dedicated function, generateSnippetSplitter, to improve code modularity and reusability.

  • Introduces generateSnippetSplitter to encapsulate random splitter generation.
  • Replaces inline random splitter code with a call to generateSnippetSplitter in transformJsSnippets.
Comments suppressed due to low confidence (1)

src/utils/template.ts:345

  • [nitpick] Consider renaming the variable 'identify' to 'identifier' for improved clarity and consistency with common naming conventions.
const identify = Math.random().toString(36).substring(2, 15)

@Teages Teages merged commit b9c96d3 into main May 7, 2025
4 checks passed
@Teages Teages deleted the fix/avoid-scientific-notation branch May 7, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants