alexa-samples / skill-sample-nodejs-hello-world

Apache License 2.0
212 stars 294 forks source link

Unnecessary code for a "hello world" skill? #43

Closed habuma closed 1 year ago

habuma commented 4 years ago

In recent months, I've found that some of the latest changes to this skill template are (at least in my mind) questionable. I've looked at the "Hello World" template as a barebones baseline skill project that can be used as the basis for almost any skill I might write. With that in mind, I'm wondering if there's opportunity for pruning (or if not, then an explanation of why some things are included):

Again, I view the "hello world" template as the simplest possible example of a skill and some of the stuff I've mentioned strays from that. When cards were removed from the template, I initially was upset to see them go, but then justified their removal because they were unnecessary in the "simplest possible skill", so I'm fine with them being gone. But these other items I've listed above seem counter to the "simplest possible skill".

I'd be happy to do a little work and produce a PR to address these items, but given that these are mostly due to recent changes, I'd imagine that there might be a reason for them and I'd love to hear the reasoning behind these things.

habuma commented 4 years ago

All that said, I do like the addition of languageStrings.js and the request interceptor that adds the t() function to handlerInput. Even in a simple skill, externalizing strings like that puts the developer on the right path toward later supporting multiple languages. I'd just trim languageStrings.js down to one language (maybe at most two locales in the models and skill.json) and invite the developer to add additional languages as they see fit.

habuma commented 4 years ago

FWIW, given silence on this issue for over a week, I've created my own simplified "hello world" template at https://github.com/habuma/skill-template-nodejs-hello-world. If the official template isn't likely to be simplified, then I invite anyone who is interested to both use it and provide feedback.

JoeMoCode commented 4 years ago

Hey Habuma, I agree with a lot of this. To address the complexity problem, there are now separate branches for each locale (named after the locale) with simplified code. This will be used for Alexa hosted templates. We will be keeping the localization in other skill samples, but for hello world, this should be as simple as possible.

I am leaving the main branch as is in case others are relying on localization code being there for now until.

aszk commented 1 year ago

Closing because we created different branch.