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

Could be replace randexp with something else? #944

Open
EloB opened this issue Jan 30, 2024 · 10 comments
Open

Could be replace randexp with something else? #944

EloB opened this issue Jan 30, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@EloB
Copy link
Contributor

EloB commented Jan 30, 2024

Feature Request

The randexp seems like an unmaintained repo. It's using CJS that is bad for dead code elimination. Also has some old dependencies that also seems to be unmaintained.
https://github.com/fent/randexp.js

Made a PR to try to add sideEffects: false to them without any response.

What do you think?

@samchon samchon self-assigned this Jan 30, 2024
@samchon samchon added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers question Further information is requested labels Jan 30, 2024
@samchon
Copy link
Owner

samchon commented Jan 30, 2024

Do you know something to recommend?

I also hope to change to another one. When complicate regular expression comes, randexp generates wrong string value which even cannot pass the RegExp.test(string) function of itself.

@Namchee
Copy link

Namchee commented Feb 6, 2024

Might give reregexp a shot. It does have limitations though.

@EloB
Copy link
Contributor Author

EloB commented Feb 6, 2024

@samchon I never used such feature before. The only thing I would like is something that is ESM because it's better for dead code elimination.

@samchon
Copy link
Owner

samchon commented Jun 12, 2024

@EloB #1099 This PR and v6.1 update may solve your issue.

@samchon samchon closed this as completed Jun 12, 2024
@ryoppippi
Copy link
Contributor

@samchon
I think we still need to consider the alternative for randexp.
Bundling is fine for now, but we need to find something.

So this issue still needs be opened!

@ryoppippi
Copy link
Contributor

randexp is really great for bundle size,
but reregep looks good

@ryoppippi
Copy link
Contributor

I'm considering if magic-regexp implements zero-runtime random generator.

@samchon samchon reopened this Jun 17, 2024
@AlexRMU
Copy link
Contributor

AlexRMU commented Aug 7, 2024

@ryoppippi
Copy link
Contributor

ryoppippi commented Aug 15, 2024

@AlexRMU
Thank you for your investigation.
We are finding a randome generator with these specs.

  • small bundle size
  • esm/cjs build
  • ability to generate random values from reliable regexes.

e.g. I found this library today copycat, but this cannot generate random string from regex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants