Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Bower + WebComponents
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mex-ichikawa
October 24, 2014
Programming
43
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Bower + WebComponents
WebComponentsのパッケージ化について。。。
mex-ichikawa
October 24, 2014
More Decks by mex-ichikawa
See All by mex-ichikawa
Three.js vs Unity5
mex_ichikawa
0
62
WebAudioAPIで(目的の)SE作れなかった話
mex_ichikawa
0
41
gulp + React
mex_ichikawa
2
440
Blob URL Scheme
mex_ichikawa
0
580
Other Decks in Programming
See All in Programming
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
360
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
200
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
1
890
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
200
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
570
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
580
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
350
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
270
今さら聞けない .NET CLI
htkym
0
210
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
100
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
370
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
1k
Everyday Curiosity
cassininazir
0
290
Building Applications with DynamoDB
mza
96
7.2k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
660
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
640
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
470
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
420
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Transcript
Bower + WebComponents @ichikawa Tsukiji.front - 2014/10/24
パッケージ管理ツール
• Component - https://github.com/componentjs/component • Bower - http://bower.io/ • RequireJS
- http://requirejs.org/ • Browserify - http://browserify.org/
• Component - https://github.com/componentjs/component • Bower - http://bower.io/ • RequireJS
- http://requirejs.org/ • Browserify - http://browserify.org/
普段使ってるBowerで!
とりあえずColorPickerを作る
ソースをコンポーネント化
ソースをコンポーネント化
まずは、 シンプルなテンプレコード で実行
createdCallback: { value: function(){ var shadowRoot = this.createShadowRoot(); var template
= document.querySelector('#nameOfTemplate'); shadowRoot.appendChild(template.content.cloneNode(true)); } }
templateが読めない。。。
//global var currentDocument = document.currentScript.ownerDocument; ... createdCallback: { value: function(){
var shadowRoot = this.createShadowRoot(); var template = currentDocument.querySelector('#nameOfTemplate'); shadowRoot.appendChild(template.content.cloneNode(true)); } }
読めるようになった!
作成コードをはめ込む
• テンプレートがShadowRoot内に入るのでセレクタ注意 • 画像などのアセットパスの扱いをどうするか、今回は埋め込んだ
githubにpush
bowerに登録 bower register [パッケージ名] [パッケージリポジトリパス ]
別プロジェクトで利用 DEMO
ホントは配置までやりたかった 次の機会に。。。
おわり