-
Notifications
You must be signed in to change notification settings - Fork 5
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
think about using template engine #180
Comments
I created a repo to tinker with handlebars https://github.com/rin-st/tinker-handlebars , see README how to use it. Current thoughts regarding this:
I didn't find a good way to do it with handlebars. I see two ways:
You can also play with that repo, but for now looks like it's not worth to use handlebars at all and our solution is much better |
Yeah I think there is no workaround to this variable scoping issue it's just javascript runtime evaluation problem.
Yeah :( doesn't seem any straight forward way.
Yup I was also tinkering with https://github.com/carletex/create-dapp-example/tree/feat/extenstion-templateConfig, I think yeah our's solution is simple also since it's Some other things I explored which are used for code generation (an abstractions over handlebars, ejs) :^ but not worth it Btw we have this in
It's not clicking to me how But yeah I am kinda leaning towards #175 as well |
Description:
Since we are planning to allow more customization (#170) and also early to do high breaking changes. It would be nice if we give a templating engine a shot (looking into all options handlebars seems very nice for use case but open for other options).
The reason for this is while tackling #174, #175 and with #135 we started reinventing wheel and creating our own solutions like having our identifier like
$$$
for using vars, creating utils likestringify
for allowing objects in.args.mjs
etc.Looking at current
.template.mjs
I think we need the following features:.template.mjs
) to accepts args from extensions (currently passed via `.args.mjs)--dev
we create.dev
files showing what args were passed.--dev
mode symlinks)We kind of have the above things working with current templating logic and utils but this workaround breaks when certain new use case comes up for example this where
stringify
util failed.Let's try to research and tinker more with it and see if it better fits for us 🙌
Past discussions:
Search this quoted text in SE-2 core TG group(for some reason I wasn't able to copy link to message):
"I forked what Shiv made, and made some tweak in order to test point 2 (handlebars)." - Carlos creating v0.1 with hbs checkout video about it.
https://www.veed.io/view/24b6495f-32e7-4e31-84c4-f7c9ae922668?panel=share - Initial templating video of passing with args in handlebars.
Branch with handle bars : https://github.com/carletex/create-dapp-example/tree/feat/extenstion-templateConfig
"Testing an alternative to handlebars.... using a function." - Suggestion on using current version of templates instead of handlebars.
"then, for template files maybe do something different, where instead of the actual resulting file we create a special file like file.ext.dev.mjs" - Dani tinker on
--dev
mode so that we show what args were passed.Dani's Initial Draft with templates literals (read RFC-extensions.md):
https://github.com/carletex/create-dapp-example/pull/2/files#diff-1c5bb9873a4d62b19f0844b00ade8d65295ffdd188d146cea2e9ce43e60e778a
The text was updated successfully, but these errors were encountered: