Open skredev opened 1 month ago
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!
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!
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.
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!
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! 🙏
I've made updates. Would love to hear your thoughts
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! 😃