Skip to content

Instantly share code, notes, and snippets.

@japboy
Created May 31, 2013 08:12
Show Gist options
  • Save japboy/5683560 to your computer and use it in GitHub Desktop.
Save japboy/5683560 to your computer and use it in GitHub Desktop.

Web サイト制作におけるパターンの考察

フロントエンド JavaScript によるサイト作成の受難。最強の grunt タスクをつくるためのメモとして。とりあえず思いつくところまで。

パターン

  • web app
    • single HTML page
    • partial HTMLs being generated by JSTs
    • single JavaScript file including entire modules
    • no global scopes
    • 一番簡単なパターン
  • modern web site
    • multiple HTML pages
    • partial HTMLs being generated by JSTs
    • single JavaScript file including entire modules
    • no global scopes
    • パーシャル動的読込のパフォーマンス的デメリット。
    • リリース後の修正範囲が一箇所ですむ。
  • static web site
    • multiple HTML pages
    • partial HTMLs being inserted into actual HTML pages (by grunt-contrib-jade or grunt-bake)
    • single JavaScript file including entire modules
    • no global scope
    • パーシャルを冗長化する事によるパフォーマンス的メリット。
    • リリース後の修正範囲が全体におよぶ。
  • legacy static web site
    • multiple HTML pages
    • partial HTMLs being inserted into actual HTML pages (by grunt-contrib-jade or grunt-bake)
    • single common module JavaScript file & page modules
    • use global scopes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment