Skip to content

Commit 5f4085b

Browse files
committed
write(jQuery): エコシステムについてを追記
1 parent 7ca2453 commit 5f4085b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ja/jQuery/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ calculator.fn = calculator.prototype;
9393
「拡張する時は`calculator.prototype`の代わりに`calculator.fn`を拡張して下さい」
9494
というルールがあるだけとも言えます。
9595

96+
## エコシステム
97+
98+
最初に述べたように、このプラグインの仕組みはあるグローバルオブジェクトに依存しており、
99+
これはスクリプトを`<script>`要素で読み込むだけで拡張することを前提とした作りといえます。
100+
101+
```html
102+
<script src="jquery.js"></script>
103+
<script src="greenify.js"></script>
104+
```
105+
106+
まだNode.jsで使われているCommonJSやES6 Modulesといったものがなかった際に使われていた仕組みであるため、
107+
それらと組み合わせる際には少し不向きな拡張の仕組みといえるかもしれません。
108+
96109
## まとめ
97110

98111
ここではjQueryプラグインの仕組みや実装について学びました。
@@ -106,3 +119,4 @@ calculator.fn = calculator.prototype;
106119

107120
- [Plugins | jQuery Learning Center](https://learn.jquery.com/plugins/ "Plugins | jQuery Learning Center")
108121
- [jQuery拡張の仕組み 〜 JSおくのほそ道 #013 - Qiita](http://qiita.com/hosomichi/items/29b19ed3ebd0df9361ae)
122+
- [The npm Blog — Using jQuery plugins with npm](http://blog.npmjs.org/post/112064849860/using-jquery-plugins-with-npm "The npm Blog — Using jQuery plugins with npm")

0 commit comments

Comments
 (0)