Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

V8 Torque is a language that allows developers contributing to the V8 project to express changes in the VM by focusing on the intent of their changes to the VM, rather than preoccupying themselves with unrelated implementation details. The language was designed to be simple enough to make it easy to directly translate the ECMAScript specification into an implementation in V8, but powerful enough t
Photo by Lautaro Andreani on UnsplashReact hooks are pretty great, can’t we agree? For the most part, they allow you to write clean, extensible, and easy-to-understand functional components with clearly defined behavior. When compared to old class-based lifecycle methods and local state management, you’d wonder how React ever got so popular. The React team certainly sees hooks as the future and lo
Blog JavaScript Performance in the Wild 2020 We rendered a million web pages to find out what makes the web slow We rendered the top 1 million pages on the web, tracking every conceivable performance metric, logging every error, noting every requested URL. To our knowledge this produces the first dataset that connects performance, errors, and library use on the web. In this article we analyze what
# JavaScript Garbage Collection with WebAssembly is Possible Today *by [@bwasti](https://twitter.com/bwasti)* **** tl;dr - Using [WeakRefs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef), you can pretty easily implement automatic memory management for objects exposed from WebAssembly with JavaScript's garbage collector. *(Keep in mind "automatic memory ma
Intro 従来の History API を改善する Navigation API の仕様策定と実装が進んでいる。 これは、 History API の使いにくかった部分を補うだけではなく、「JS で画面遷移をする」という現状のミッシングピースに取り組み、 SPA が抱える多くの問題だけでなく MPA すら改善する可能性がある。 この API の目的と仕様を解説しつつ、実装のメモを残す。 画面遷移と SPA の軌跡 Web は HTML の取得と描画を繰り返す、画面遷移(Navigation)を前提としたアーキテクチャ(のちに SPA からの逆算で MPA と呼ばれる)が基本であり、ブラウザなどの実装もそれに最適化されている。 一方「アプリケーション」の設計手法をそのまま Web に持ち込んだ SPA は、この Navigation によってもたらされる UX の低下を防ぐ部分がある一方
結論普通は自ウインドウのlocationを操作するためhrefとassignは同じ挙動になりますが、自身とは異なるウインドウを操作する場合には挙動が異なります。具体的には実行中のコードと異なるオリジンを持つウインドウのlocationを操作しようとしたとき、 location.href = url; ではオリジンの検査は行われず、操作は成功します。location.assign(url); ではDOMException (SecurityError) が発生します。以下がそのデモです。iframe内に表示している https://example.com はこの文書自身とは異なるオリジンであるため、このようなiframeのlocationをassignで操作しようとするとエラーになります。 <!doctype html> <html> <head> <script> "use strict"
TL;DR JavaScriptとWebAssemblyの間の値渡しには気を使おう(なるべく値のコピーを避けよう)。 JSはとても高速で、単純なループではWASM並の速度が出るので、WASMの使い所はよくよく考えるべき。 はじめに 1000^2級の画像の全ピクセルをループして、(簡単に言うと)RGBA値の最も大きい値を抽出する、という処理をブラウザ上で突然したくなりました。ピクセル数が1,000,000だと、RGBAなので配列長は4,000,000となります。ブラウザで扱いたくないサイズ感です。 ここで、①WASMで高速化、ダメなら②サーバーサイドで計算させる…という算段をして、とりあえずWASMを試してみました。色々チューニングした結果、ブラウザ上で現実的な速度が出ることがわかりました(数十msの世界)。 RGBA値の計算について 本記事では深く説明しませんが、今回やりたい処理は「下記式
SSR was never the problem. The problem was, and still is, the client-side hydration. For all the effort we've put into Server Rendering on the web, we still haven't found a universally good solve for balancing the developer costs with end user costs. Regardless of how we optimize for server rendering, hydration hangs over us. That JavaScript that needs to be run on page initialization, that makes
Photo by Matthew Manuel on UnsplashLast Wednesday, on 9th March 2022, Microsoft announced their support of a remarkable proposal for the further development of JavaScript and TypeScript. So far, this is only a suggestion that is available as a so-called Stage 0 proposal, but Microsoft has already announced that they want to submit this proposal to the TC39 (Technical Committee 39) on time. If this
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く