You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
RequireJS はみんな使ってるらしーし、 何かかっこいいし、意識高そうだし、使っとくか! ・・・と、思って試しに使い始めてみたのですが、 自分が作るような小規模なものの場合、 大変な割に良い事あんまりないので使うのを止めました。 以下、忘れそうなのでその理由をメモって置きます。 基本的に、1枚のJSファイルが1モジュール、ファイル名がコードに影響する。それもあって、結合・圧縮は r.js という専用のツールが必要になる。Grunt の concat とか uglify とか使えない。 AMD の仕様では、「JSファイルのリストを順番通りに読み込み/実行する」ということができない。実際何が困ったかというと、分割した mocha テストケースを順番通りに実行できなくなったということ。結果は変わらなくても、順番通りに実行されないと結果が見辛いし、問題が起こった時に発見が難しい。ただしこれは
Introduction [UPDATE: This post has new 2015 followup] This is about managing dependencies in a well-tested client-side JavaScript codebase, how I got overwhelmed, and how I automated the pieces to make it Just work ™. The JavaScript world has grown a lot of tools for dependency management. I've dipped my toes into it into the past, but didn't really know much about it, especially on the client-si
If you have been following JavaScript development, you might have seen a lot of posts on modules. It's a hot topic in JavaScript and it's easy to jump on a bandwagon. The truth is that the problem that needs to be solved is very fundamental to the success of your code. Why Modules JavaScript has an inherent lack of a module system... WHOA! WHAT DOES THAT EVEN MEAN!?! If that's the first place your
Optimize (Concatenate and Minify) RequireJS Projects by naorye · Published April 19, 2013 · Updated May 19, 2016 This article will demonstrate you how to concatenate and minify projects that are based on RequireJS. In this article I’ll use several tools that require Node.js. So, if you don’t have Node.js yet, install it here. Motivation A lot has been written already about RequireJS. This tool all
メモ。 いい加減やらないと行けないと思いつつ、二回ほど試して上手く行かなくて放置してたので再入門した。 ディレクトリ構成 ├── app.js ├── entities ├── libs │ ├── backbone-0.9.9-min.js │ ├── bootstrap-2.2.2-min.js │ ├── jquery-1.8.2-min.js │ ├── jquery-layout-1.3.0-30.77.js │ ├── jquery-ui-1.9.1.custom.js │ ├── jquery.jsPlumb-1.3.16-all.js │ ├── micro-log.js │ ├── moment-1.7.0-min.js │ ├── require-2.1.2-min.js │ └── underscore-1.4.3-min.js ├── main.js ├── mod
げりんぐすたーてっど うぃず りくわぃあーじぇーぇす ということで、社内勉強会でRequireJSの入門資料をこさえたのでシェア。 利用したデモファイルセット http://d.aho.mu/S4mh なんとなくRequireJSが動くセットです。スライド中のr.jsによるビルドコマンドや、gruntを利用したビルドも試せるようになっています。 おさえるべき要点 いくつかの要点だけ記事内に文字列でおこしておきまする。 モジュラーと依存関係 Webサイト → Webアプリ への流れが明確になってきてフロントエンドが複雑化してきている今、1つのJSファイルにつらつらとCSSのようなノリで書き連ねる時代は終わりつつあります。 ParisJS #10 : RequireJS このあたりについては、上記の素晴らしいスライドから、Figureを拝借しました。個々のJavaScriptの粒度が揃えてモジ
Referencing JavaScript. How should it be done? Is there an approach that works for module systems, package managers and project layouts? The following describes the approach in use by AMD/RequireJS and volo, but parts are found in other places like Node, CommonJS and Dojo. The following approach works well for browser-based, web development. Since browser-based development is the harder environmen
In my previous post, I covered the structure of a Backbone.js application using RequireJS. The next thing (or if you are a TDD fan, the first thing) we do is to run some tests on it. According to Coda Hale: Writing tests for your code may not reduce the number of bugs, but it will make fixing the bugs you inevitably find easier. Obviously, we can take advantage of the AMD architecture, to help us
I found that RequireJS has became one of my favorite library, so I need to know it deeply to make it my strong point. This article is log of code reading for 2.0.4. require.js it has many helper like bind(), mixin() and each(). IE6 support: there is a comment "When that browser dies, this can be removed"... handling error: overriding this method or putting break point here will help me to debug. i
はじめに Backbone.js を使って UI を実装しているけど、モデルやビューが増えてきた。1ファイルに収めるには多いんで、ファイルを分割して実装し、最終的には結合したい。 そこで、RequireJS を使ってモデルやビューをモジュールにして、ファイルを分割しつつ開発できるようにしてみる。 RequireJS とは RequireJS は JavaScript のファイルやモジュールを非同期でロードできる JavaScript ライブラリ。 RequireJS 最適化機能もあり、公開時はモジュールをひとまとめにできる。 RequireJS と Backbone.js を組み合わせてみる 以前作った TODO アプリのサンプルで練習してみる。モデルとビューとテンプレートを1ファイルに記述していたので、それを別ファイルに分割する。 ディレクトリ構成 RequireJS の導入でディレクト
Why Primary Changes Delayed module evaluation shim config require errbacks Catching load failures in IE paths fallbacks Loader plugin errors map config module config Loader plugin changes Removed Items Report issues Why There has been a good deal real world usage of requirejs, and there were some features around configuration that have come up that would be nice to add. At the same time, there wer
#Flickly Mobile *This app was further refactored 21/12 A complete Backbone.js + jQuery Mobile sample app using AMD for separation of modules, Require.js for dependency management + template externalisation and Underscore for templating. The app allows you to search for images using the Flickr API, lookup individual photos in more detail, bookmark any state for results or photos, supports paginatio
CoffeeScript JavaScript require.js nikki Tweet JS の読込み順を征する者は なんか色々征する! with CoffeeScript ガツガツした JavaScript 案件をこなしていると、必ず直面するのが JavaSscript の読み込み順問題。 再利用性への考慮だったり、不必要なコードを読まないようにとモジュールを細分化した場合、 どうしてもその分 HTTP リクエストの回数が増えてしまいます。 ブラウザは読める物から読んでいくので、jQuery に依存しているのに先に読まれて jQuery がないと怒られるだとか、そういった経験は皆さんも一度はあるのではないでしょうか。 特に IE6 や IE7 などで、しょっちゅうそういった自体に遭遇するかと。 そのあたりをいい感じに解決するのが今回紹介する require.js です。
Hell yeah. Get it now. This release is basically the same as the 0.27.1 release. There was just one change, to a regexp used by the optimizer when it converts CommonJS modules to AMD modules via its -convert flag. This release has been two years in the making. The code and APIs have changed over time based on feedback from the community, and now there are some very strong AMD loaders besides Requi
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く