Closed ansarizafar closed 6 years ago
Hi @ansarizafar - thanks for using Duktape!
I'm not that familiar with stenciljs, so I'll have to look into it over the next few days.
Duktape
is a fully-featured javascript engine and should be capable of running vanilla JS. With that being said, the engine currently does not shim any browser-specific functionality (i.e. document
, console.log
, etc.). Therefore if stenciljs uses any browser-specific functions, the engine will likely fail
with a ReferenceError
on the function.
Of course given the primitives in this shard, anyone should be able to write functions that provide the browser capabilities.
Hope this helps! I'll look into stenciljs over the next few days and get back to you.
@jessedoyle Check this https://github.com/ionic-team/stencil/issues/254#issuecomment-338896765
Thanks for the update @ansarizafar! That issue was a good read.
Here's what I got from reading it:
stenciljs
sys
object.sys
object can be implemented on the host interpreter and stenciljs
should function fine. Take a look at the interface.So I guess an answer to your initial question is that using stenciljs
for server-side rendering is possible, but some work is needed first. I think the bulk of the work would be re-implementing all of the functionality that the sys
object provides.
The current version of duktape.cr
(0.12.0
) brings support for handling various BuiltIn functions to Duktape interpreter contexts.
I don't think that this shard should ever provide built-in functionality to mock out behaviour for various frameworks. But you could definitely leverage the primitives in duktape.cr
to create a shard to run stenciljs
from within Crystal.
I hope this helps!
Is it possible to use duktape.cr to create a server rendered https://stenciljs.com application on a crystal server.