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

Feature - Lorem Ipsum Generator #73

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

skredev
Copy link
Contributor

@skredev skredev commented Sep 26, 2024

Hello everyone!

I've added a Lorem Ipsum Generator to the project. This tool allows users to easily generate random placeholder text.
The generator offers options such as generating paragraphs, sentences, and words and/or using HTML tags, giving users flexibility in how they use the generated content.

I've used the lorem-ipsum Node.js package because I thought it would simplify the code. It can be replaced with a custom generation if needed.

Looking forward to your feedback and thoughts! 😃

@franciscoaiolfi
Copy link
Contributor

Hello!

Thank you for taking the time to submit this PR and for your interest in contributing to the project! 😊 While the Lorem Ipsum generator is a cool tool, I don't see a strong need for it to be included in the current scope of the project. Most modern development environments, including VS Code, already offer built-in solutions for generating placeholder text, which makes external solutions less necessary.

Given that the focus is on adding features that align more closely with the goals of the project, I believe this feature may not have broad applicability at the moment. But that's my personal opinion and not everyone's opinion.

Thanks again for your efforts!

@EduardoDePatta
Copy link
Contributor

EduardoDePatta commented Sep 26, 2024

Hello @sprechblase !

Complementing what @franciscoaiolfi mentioned, i would also like to add my perspective..

I think it would be preferable to implement it without relying on an external library, as adding extra dependencies can increase the bundle size, require additional maintenance, and potentially introduce unnecessary overhead.

Given the simplicity of the feature, we could consider a lightweight in-house solution, such as the following function:

const LOREM_IPSUM: string = 
  "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
    ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
    velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
    qui officia deserunt mollit anim id est laborum.";
  
  function generateLoremIpsum(wordCount: number): string {
  const words: string[] = LOREM_IPSUM.split(' ')
  const totalWords: number = words.length
  let result: string[] = []
  for (let i = 0; i < wordCount; i++) {
    result.push(words[i % totalWords])
  }
  return result.join(' ') + '.'
}  

For a straightforward funcionality, this custom function could cover most use cases without the need for an external dependency.

I'm happy to discuss further if there are specific scenarios where this feature could add value!

@golergka
Copy link
Contributor

I think it would be preferable to implement it without relying on an external library, as adding extra dependencies can increase the bundle size, require additional maintenance, and potentially introduce unnecessary overhead.

As far as bundle size goes, library in question is 2.4kb minified and gzipped. And runtime overhead of a single call to generate some text can't possibly be significant enough for even a 20 year old computer unless something in this library is very, very wrong or you're generating several megabytes of it.

Personally, I'd expose more generation options from this third-party library in the UX, but it can of course be implemented in a follow-up PR.

@EduardoDePatta
Copy link
Contributor

EduardoDePatta commented Sep 27, 2024

I think it would be preferable to implement it without relying on an external library, as adding extra dependencies can increase the bundle size, require additional maintenance, and potentially introduce unnecessary overhead.

As far as bundle size goes, library in question is 2.4kb minified and gzipped. And runtime overhead of a single call to generate some text can't possibly be significant enough for even a 20 year old computer unless something in this library is very, very wrong or you're generating several megabytes of it.

Personally, I'd expose more generation options from this third-party library in the UX, but it can of course be implemented in a follow-up PR.

My intention in suggesting the solution was to explore a simpler alternative where granular control was not necessary.
However, i agree that it makes sense to incorporate it if the other funcionalities are being leveraged.

Thank you for sharing your knowledge!

@skredev
Copy link
Contributor Author

skredev commented Sep 27, 2024

My intention in suggesting the solution was to explore a simpler alternative where granular control was not necessary.

@EduardoDePatta As I said, I was thinking of building a simpler custom generation to keep it independent of third party libraries anyway 😃
I'm going to work on a solution that even adds functionality that the library unfortunately lacks 👍

While the Lorem Ipsum generator is a cool tool, I don't see a strong need for it to be included in the current scope of the project. Most modern development environments, including VS Code, already offer built-in solutions for generating placeholder text, which makes external solutions less necessary.

@franciscoaiolfi Good point, I hadn't thought of that. Still, I have used generators a lot on the web in the past, and I think many others do as well. In my opinion a simple ad-free alternative without having to switch to other sites would be advantageous 😀

Thank you for your feedback! 🙏

@skredev skredev marked this pull request as draft September 27, 2024 14:55
@skredev skredev marked this pull request as ready for review September 29, 2024 20:17
@skredev
Copy link
Contributor Author

skredev commented Sep 30, 2024

I've made updates. Would love to hear your thoughts

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.

4 participants