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

Sperate mustache.js file into multiple files and use typescript #787

Open
AbrahemAlhofe opened this issue Jun 12, 2021 · 2 comments
Open

Comments

@AbrahemAlhofe
Copy link

I noticed that mustache.js file it will be better to separate it into multiple files for each individual class ( e.g. Parse, Scanner ) and using typescript will add a lot of benefits into development process, so I want to do that as a pull request so I came to ask are you agree with that or not before I work on these processes

@phillipj
Copy link
Collaborator

Hi there @AbrahemAlhofe!

Appreciate you raising this discussion before jumping ahead and putting work into something that better be agreed upon first.

The thought of migrating to TypeScript has hit me as well from time to time. I'm personally see value of it in big projects of many thousands lines of code.

So why haven't that happened so far? To me, the benefits in a simple project like mustache.js, with well below 1000 lines of code and decent test coverage, is not obvious. TypeScript is definitively cool and often brings value to the table, but there's surely drawbacks and maintenance burden of supporting/following along with TypeScript versions and whatnot, that I honestly question whether or not is really worth the burden for maintainers in the years to come.

Have in mind this project' goal is to be a JavaScript implementation of the mustache specification. It works good in that regard, and have been for many years. I don't see any reason the goal of this package should change. Hence there is limited reasons why the source code of this project should change much going forward.

I do see value in ensuring mustache.js works in TypeScript projects and popular JavaScript runtimes & bundlers tho. And that has evolved over the years, without much changes to the source code.

Bottom line, I'm personally -0 on doing a TypeScript migration. Meaning on the fence, slightly leaning towards keeping it as JavaScript.

@AbrahemAlhofe
Copy link
Author

First of all, I appreciate your going throw with me in this conversation but you answered converting to typescript what about split it into multiple files instead of put everything on one file that can make some confusing to others

Second, I want to do something like that to pave the way to do add features like using proxies or async data that will be hard to work on with this kind of codebase

Third, we can use jsdoc instead of typescript and it will give us the benefits from keep things restricted and keep out the mystery from something like Parser class and whatnot

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

No branches or pull requests

3 participants
@phillipj @AbrahemAlhofe and others