Skip to content

jQuery: エコシステムについて #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ja/jQuery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ calculator.fn = calculator.prototype;
「拡張する時は`calculator.prototype`の代わりに`calculator.fn`を拡張して下さい」
というルールがあるだけとも言えます。

## エコシステム

最初に述べたように、このプラグインの仕組みはあるグローバルオブジェクトに依存しており、
これはスクリプトを`<script>`要素で読み込むだけで拡張することを前提とした作りといえます。

```html
<script src="jquery.js"></script>
<script src="greenify.js"></script>
```

まだNode.jsで使われているCommonJSやES6 Modulesといったものがなかった時代に作られた仕組みであるため、
それらと組み合わせる際には少し不向きな拡張の仕組みといえるかもしれません。

## まとめ

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

- [Plugins | jQuery Learning Center](https://learn.jquery.com/plugins/ "Plugins | jQuery Learning Center")
- [jQuery拡張の仕組み 〜 JSおくのほそ道 #013 - Qiita](http://qiita.com/hosomichi/items/29b19ed3ebd0df9361ae)
- [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")