Chrome Dev Summit 2018 の内容を共有。 発表の中では少し端折ったところもありましたので、こちらで参照いただけますと幸いです。このスライドを見た上で、YouTube に上がっている動画を見ることでより深い理解につながれば幸いです。 CDS 2018 の YouTube 動画はこちら: https://www.youtube.com/playlist?list=PLNYkxOF6rcIDjlCx1PcphPpmf43aKOAdF
The past months we have been working on CacheIR, an overhaul of the IC code in SpiderMonkey's JITs. CacheIR has allowed us to remove thousands of lines of boilerplate and code duplication. It has also made it much easier to add new optimizations. This post describes how CacheIR works, why it's much better than what we had before, and some plans we have for the future. IC stubs Both the Baseline JI
PreactでVDOMがどのように機能するかを示すフローチャート 仮想DOM(VDOMあるいはVNode)は魅力的です✨ しかし複雑で、理解が難しいものでもあります???? React や Preact 、その他同様のJSのライブラリでは、これをコアで使っています。残念ながら私は、これを詳細かつ分かりやすく説明している優れた記事や資料を見つけられませんでした。ですから、自分で書こうと思い立ったのです。 備考:これは非常に長い記事です。内容をシンプルに表すために画像を山ほど挿入しましたが、それゆえにさらに長い記事になってしまいました。 私は Preact のコードとVDOMを使いました。容量が小さくて済み、将来、簡単に見なおすことができるからです。しかし、概念のほとんどはReactにも共通していると思います。 皆さんがこれを読んだ後、仮想DOMをよく理解できるようになり、できればReactや
JavaScriptでは、初見の人にはさっぱりわからないけれども、ある程度慣れた人は当たり前に使うイディオムが結構たくさんあります。知ってしまえば何てことはないので、私の知っている限りのイディオムとその意味を解説します。 (7/3追記: twitter等で教えていただいた内容を追加しました) +v (数値化) var v = "123"; console.log(+v + 100) // 223 console.log(v + 100) // 123100 vを数値化する方法では最もメジャーです。parseFloat(v) に比べて高速なのに加えて、parseFloatとは細かい挙動が異なります(例えば空文字列の場合、parseFloatならば NaN になりますが、 +v の場合はゼロになります)。必ず数値になることが保証されており、文字列などで数値化出来ない場合はNaNが返ります。 v
Theory Type of code Execution context Activation object / Variable object Property attributes Built-ins and DontDelete Undeclared assignments Firebug confusion Deleting variables via eval Browsers compliance Gecko DontDelete bug IE bugs Misconceptions `delete` and host objects ES5 strict mode Summary A couple of weeks ago, I had a chance to glance through Stoyan Stefanov’s Object-Oriented Javascri
世界一誤解された言語javascriptとecmascriptの話。 ──この誤解に関して、私は真に驚くべき証明を見つけたが、このブログはそれを書くには狭すぎる。 JavaFXはじめました。 題のとおりです。本当にこれだけなんで他に話すことが無いですが説明しないとわからないと思うので説明しようと思います。「知ってるよ!」って人は恐らく今回は新しく得るものはないでしょう。 Object.create()はprototype.jsが元で追加されましたが、アレとは挙動が違います。クラスベースを模倣するために使っているかと思われますが、確かにObject.create()はクラスベースを模倣します。しかし、不完全です。むしろダメダメです。それがObject.create()を使ってはいけない理由です。 なぜダメか、簡単なことです。prototypeプロパティとconstructorプロパティを変更
ゴール: getter/setterを含むクラス定義をエコ楽に記述できる(get/set) クラスの継承もエコ楽に正しく記述できる(extend) とにかく長いキーワードや余計なものはプログラマには書かせない constructorの代わりに、newを使える様にする prototypeも__proto__もプログラマには見せない書かせない Object.definePropertyやObject.setPrototypeOfなども見せない書かせない ついでに外部からアクセスできないprivateな変数も使える様にする ※npmにbase-class-extendとして登録しました。 ※参考: [JavaScript] そんな継承はイヤだ - クラス定義 - オブジェクト作成 この記事のゴールは、以下の様にクラス定義がエコ楽にできること。 // animal-ex.js 'use stric
JavaScript のオブジェクト作成においてクラス定義で継承を実装する方法はいくつかあります。 正しい継承はどうあるべきか、基本から検証しながら考えてみたいと思います。 ※正しくクラス定義がエコ楽にできる様に追加記事書きました。 [JavaScript] getter/setterも使えるエコ楽なクラス定義 - もちろん継承も - private変数も 一番簡単なオブジェクトの作成方法 典型的な JavaScript のオブジェクトを簡単に作成してみて、それらを確認してみましょう。 var obj1 = {x: 12, y: "ab"}; var obj2 = new Object; // または new Object() obj2.x = 34; obj2.y = "cd"; // obj < Object var obj3 = [12, "ab"]; var obj4 = new
JSの軽量クライアントサイドルーティングライブラリをなんとなくまとめました。 ここで述べるルーティングライブラリとは、文字列、または正規表現によって定義したパスに対してコールバックをマッピングできるライブラリを指します。また、ルーティング機能のみを提供するものを中心として紹介します。backbone.js等のフレームワークは省いています。 kazitori.js Example class Router extends Kazitori beforeAnytime:["testBefore"] befores: '/<int:id>':['testShow'] routes : '/':'index' '/<int:id>':'show' '/<string:username>/<int:id>':'post' index:()-> # console.log "index" $('.cu
jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history. In addition, jQuery BBQ provides a full .deparam() method, along with both hash state management, and fragment / query string parse and merge utility methods. This plugin and the jQuery urlInternal plugin supersede the URL Utils plugin. Release v1.2.1 Tested with jQuery 1.3.2, 1.4.1, 1.4.2 in
The jQuery Address plugin provides powerful deep linking capabilities and allows the creation of unique virtual addresses that can point to a website section or an application state. It enables a number of important capabilities including: Bookmarking in a browser or social website Sending links via email or instant messenger Finding specific content using the major search engines Utilizing browse
JavaScriptでよく使われるコード片に即時関数というものがあります。無名関数を宣言して即実行することで、ブロックスコープの存在しないJavaScriptにおいて擬似的にブロックスコープを再現します。 var a = "global"; (function(){ var a = "local"; alert(a); //local })(); alert(a); //global 一番有名なのはこの(function(){ ... })()の形式なのですが、なぜfunctionの外側にカッコが必要なのか不思議に思ったことはないでしょうか? ためしにfunction(){ ... }()と書いてみると、Syntax Errorが発生します。 なぜfunction(){ ... }()はSyntax Errorなのか JavaScriptにはfunction文とfunction式があって、
WebKit’s FTL JIT (Faster Than Light Just In Time compiler) has switched to a new backend — Bare Bones Backend (B3) replaces LLVM as the low-level optimizer in the FTL JIT. Just a decade ago, JavaScript – the programming language used to drive web page interactions – was thought to be too slow for serious application development. But thanks to continuous optimization efforts, it’s now possible to w
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く