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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -