What are the use cases of jsdom

后端 未结 4 820
傲寒
傲寒 2021-01-31 15:43

After reading this Micro templates are dead article. I\'ve become curious:

  1. Whether Using the DOM on the server results in cleaner more maintainable code then templ
4条回答
  •  隐瞒了意图╮
    2021-01-31 16:02

    A few come to mind:

    1. Sharing views/controllers between server and browser
    2. Data mining / crawling / processing
    3. Transformation for fragments of HTML used in AJAX/realtime stuff
    4. Absolute separation of logic and content by avoiding template tags

    And to answer your questions:

    1. maybe. A lot of things affect code quality, but it's a step in the right direction
    2. nope, templating engines will always be faster, since they can pre-compile templates
    3. this probably warrants a new question?

提交回复
热议问题