javascript - Dynamic import of module from memory -
i allow user of webapp upload code-fragments in react (with jsx) should embedded dynamically in code.
for instance user writes class render-method returns
<div>hello {this.props.name}</div>
then system should transpile babel , maybe transform result secure google caja. after want able embed in way that:
let code = theuserscodefragment; import foreignclass code; render() { return <mycontainer> <foreignclass name={"john"}> </mycontainer> }
is possible (i know dynamic imports in stage 3)? found way load modules memory require: load node.js module string in memory
Comments
Post a Comment