The Chrome team recently announced that we are moving DOM properties to the prototype chain. This change, implemented in Chrome 43 - (Beta as of mid April 2015) - brings Chrome more in line with the Web IDL Spec and other browsers’ implementations, such as IE and Firefox. Edit: clarified Older WebKit based browsers, are currently not compatible with the spec, however Safari now is. The new behav
Once upon a time in web development, we had perfect mental models through static HTML. We could predict the output without giving it too much thought. If we were to change any of the contents on the site, we did a full refresh and we could still mentally visualise what the output would be. We would communicate between elements on the website by a simple protocol of text and values, through attribu
Senior Mindset BookGet promoted, earn a bigger salary, work for top companies Start with a free chapterGet a free chapter from the Senior Engineer Mindset book and a sample audiobook chapter, followed by a Senior Mindset 101 email course. How to wait for DOM elements to show up in modern browsersRemember how careful we all were of the DOM ready event a few years ago? Writing JavaScript code outsid
Frequently we want to add scrolling to some part of the page or box. E.g. to highlight something or just scroll to an anchor. To provide better UX and feeling usually smooth scrolling is used. Previously to implement it we had to use plugins like “jQuery.scrollTo” or similar solutions. But dreams came true- there is a specification for native smooth scroll behavior API. Demo ...
Streams 雑感 WHATWG Streams の仕様を読みました。 雑感です。 第1印象は**「常識に囚われてはいけないのですね!」**でした。 仕様は ES6 で実装してから書いてるようで、既に動く実装があります。 ES6 Classes を使って書かれており、主要なクラスはReadableStream, ReadableStreamReader, WritableStreamの3つ。 Promise まず特筆すべき事は、 Streams はイベントを一切持たないという点です。 ワオ。 従来の JavaScript はイベント駆動です。DOM も XHR も WebSockets も EventSource もイベントを通知します。しかし、この新しい Streams はaddEventListenerを持っていません。代わりに、Promiseをイベントのように使っています。 これに
Vue.js が辛くなってきた。 ひとまず現状の辛さをダンプ 今日チームで改めて話し合って辛さがハッキリしてきたので、それをつらつらと書いてく。 (今のチームは僕を含めて Rails プログラマが多くて、フロントエンドを専門にやってる人はいない。) グローバル変数大量問題(もしくはイベント地獄問題) たくさんの状態(変数)が必要 && 複数 DOM にまたがるレンダリングがしたい。 今は、左ペインで選択して右ペインに出す、みたいな事をしている。 左ペインはタブで様々な種類の項目を選べて、選択したものを右側でリスト化して表示している。 これをやろうとするにあたって、方向性が2つあると思っていて 左ペインと右ペインでコンポーネントを分けて、親玉 ViewModel に変更を通知して親玉がレンダリング制御する -> イベント地獄 左ペインと右ペインの上位の親玉 ViewModel をつくって全て
var mockRegister = MyDispatcher.register; var mockRegisterInfo = mockRegister.mock; var callsToRegister = mockRegisterInfo.calls; var firstCall = callsToRegister[0]; var firstArgument = firstCall[0]; var callback = firstArgument; Jestは基本全てがモックされるので、要は「Dispatcherのregisterに与えられた引数が観測できるから、Storeのcallbackを捕捉してテストしたい内容に合わせて適宜実行せよ」ということである。 この動作、SinonのSpyにも同じような実装がある。spy.firstCallやspy.getCallが定義されており、n度
Flipboard launched during the dawn of the smartphone and tablet as a mobile-first experience, allowing us to rethink content layout principles from the web for a more elegant user experience on a variety of touchscreen form factors. Now we’re coming full circle and bringing Flipboard to the web. Much of what we do at Flipboard has value independent of what device it’s consumed on: curating the bes
不特定のユーザーが入力したMarkdownをブラウザ上でJavaScriptを使ってHTMLに変換するという場面においては、JavaScriptで変換してHTMLを生成するという処理の都合上どうしてもDOM-based XSSの発生を考えないわけにはいかない。かといって、MarkdownをパースしHTMLを生成するという処理すべてをXSSが存在しないように注意しながら自分で書くのも大変だし、markedやmarkdown-jsなどの既存の変換用のJSを持ってきてもそれらがXSSしないかを確認するのは結構大変だったりする。 そういった場合には、Markdownから生成されたHTMLをRickDOMを通すことで、万が一HTML内にJavaScriptが含まれていたとしてもそれらを除外し、許可された要素、許可された属性だけで構築された安全なHTMLに再構築することができる。さらに、そうやって生成
For a long time there has been a debate in web development as to whether web apps and sites should be rendered on the server or the client — or, of course, both. With a recent post by PPK the debate flamed up again and one thing that struck me as particularly unhelpful was the argument that where something is rendered would be automatically determine whether a given framework is (one dimensionally
In short, Fetch API- it's a new Promise- based standard for doing AJAX requests. Syntax for XHR was provided more then 10 years ago (XMLHttpRequest2 - about 4 years ago). Many things changed, we got HTML5, CSS3, also close to start using EcmaScript 6. From jQuery Deferred, $q and Native JavaScript Promises people became familiar and like promises in JS. It’s time for new laconic API to do AJAX-req
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く