-
Notifications
You must be signed in to change notification settings - Fork 19
Add support for hono, itty and no router to http-ts and http-js
#356
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
Conversation
http-hono-ts templatehttp-hono-ts and http-hono-js templates
radu-matei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the TS template, LGTM!
Thanks!
|
Q: @radu-matei @karthik2804 do we wanna use the suggested names? ( |
|
|
|
I prefer the consistency as well. One potential alternate for us to consider is if we want to consider just having a single template that prompts for choices? similar to the work on the package manager PR we have open. The advantage would be that we have one single template but the flipside is the user has to make more choices and that the template will look a lot more bloated with if statements( It is not something that end users will have to deal with though) |
|
FWIW I've previously used the language-last convention (e.g. https://github.com/itowlson/spin-templates-slack/tree/main/templates/slack-slash-command-rust). But that is definitely not any kind of established project precedent. @karthik2804 Yes, it would be even better to have a template that asks users "which router do you want to use (itty / hono / none)". It would definitely make the template gnarly though (and I think we'd need to add a choice type to the system, I don't think we have that yet). |
|
We can make choices based on string matching already IIRC. |
|
How should we proceed here? I'm happy to rename the templates to If we extend prompting for the default http-js / http-ts templates, I would also vote for adding a prompt to chose the desired package manager (npm|yarn|pnpm). Any ideas on how to proceed here in the meantime? |
I am happy to go eitherway on the template but have a slight preference on the "extending prompting" approach as that will mean lesser templates. |
http-hono-ts and http-hono-js templateshttp-ts and http-js
|
I've updated the templates |
|
@karthik2804 I updated both templates |
f93fc11 to
676e048
Compare
karthik2804
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
I am just curious if we are able to use partials and split things into multiple files?
|
@karthik2804 Looking at how Liquid partials work (https://docs.rs/liquid/latest/liquid/partials/index.html)... the template system doesn't currently do any of that. No reason it couldn't, but we'd have to do some work on it, which might be fairly easy, but would still mean not until Spin 3.3. Sorry - I can see the value, just hasn't been needed before. |
Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
…emplates Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
Signed-off-by: Thorsten Hans <[email protected]>
acedd87 to
7e4cf81
Compare
UPDATE
Instead of adding new templates, this PR modifies existing
http-tsandhttp-jstemplates. Users could now select if they wanna useittyorhono. They could also go without a router by responding to the particular prompt withnone.Original
This PR adds the two new templates to the Spin SDK for JavaScript:
http-hono-ts: HTTP triggered Spin application using TypeScript and Honohttp-hono-js: HTTP triggered Spin application using JavaScript and Hono