Open violivei opened 8 years ago
It is, mostly. You won't get to use the cool tags like you would using a build tool like babel, but you can still get the benefits of validation, custom tags, and easy ssml creation with pure JavaScript. I'll comment with some examples later tonight.
So basically if you're using babel. It'll convert to the jsx to pure javascript. This means the following code means the same thing.
/** @jsx ssml */
import {ssml, renderToString } from 'alexa-ssml';
function CustomTag(props) {
return <p>Hello World</p>
}
const string = renderToString(
<speak>
<CustomTag foo="bar" />
</speak>
);
var alexaSsml = require('alexa-ssml');
var ssml = alexaSsml.ssml;
var renderToString = alexaSsml.renderToString;
function CustomTag(props) {
return ssml('p', null, ['Hello World']);
}
const string = renderToString(
ssml('speak', null, [
ssml(CustomTag, { foo: 'bar' })
]);
);
Does that make sense @violivei
Hello,
I'm very excited in using alexa-ssml in my project. However, I'm having troubles setting up in pure Javascript. What exactly am I missing? Can you provide guidance?
Thanks and Regards.