react-engine vs other template engines
我想知道使用Paypal的React Engine(https://github.com/paypal/react-engine),但我有一些疑问:
与其他模板引擎(如把手)相比有什么好处?
为什么要上传.jsx文件而不上传(jsx预编译/转换).js文件? (这应该更快,因为不必在服务器上处理转换)。
我一直在研究,但感到困惑。
谢谢
假设我们要运行一个简单的网页。只是滚动和打开文本信息。通常,使用模板引擎(例如Handlebars.js),当浏览器请求到达服务器时,它会尝试弄清楚如何响应以及该怎么做。也就是说,模板引擎可以引用从存储到本地可访问源中的文件中提取的现有数据。它们正在加载有关网站模板文件的所有已定义数据(即
With template engines, you feed the library a string (usually but not
necessarily HTML), which is then converted into a piece of JavaScript
code which generates virtual DOM structures when executed. At design
time, templates are just strings, so we dona€?t have direct access to
the surrounding code. For instance, we cana€?t import helper functions,
or call methods. These things are only possible through abstractions
called directives (and possibly other names depending on where you are
coming from). Directives are the glue between the HTML and the
JavaScript.
到目前为止,两种解决方案之间都没有相关的区别。指向下一个或上一个简单网页的链接只是简单的
目前,当我们决定实现一些交互时,
模板引擎也具有此SEO支持,但影响较小。我们不能在这里全部运行
最后,模板引擎可以执行与