並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 61件

新着順 人気順

javascript settimeout call functionの検索結果1 - 40 件 / 61件

  • 実装例から見る React のテストの書き方 - Cybozu Inside Out | サイボウズエンジニアのブログ

    2024/04/17: 更新 内容を更新した記事を書きましたので、よかったらこちらも併せて、ご覧ください。 zenn.dev こんにちは!フロントエンドエキスパートチームの@nus3_です。 kintone のフロントエンド刷新プロジェクト(フロリア)では、品質を保ったまま開発を加速させるためにフロントエンドのテストを積極的に行っています。 今回はそんなフロントエンドのテストの実装例をいくつか紹介します。この記事がフロントエンドのテストを行う上での参考になれば幸いです。 テストに使用する主なパッケージ コンポーネントのテスト 補足: Testing Library の記法をチェックしてくれるeslint-plugin-testing-library カスタムフックのテスト 補足: React v18 では @testing-library/react の renderHook を使う 参考

      実装例から見る React のテストの書き方 - Cybozu Inside Out | サイボウズエンジニアのブログ
    • JavaScriptを事前コンパイルする。不可能と言われた挑戦に挑む開発者。|直也テック

      今回はポッドキャスト「devtools.fm」に出演したOliver Medhurst氏の回をご紹介します。彼はPorffor(ポーファー)というプロジェクトの作者です。Porfforは「JavaScriptをWebAssemblyへと事前にコンパイルする(Ahead of Time Compiler、AOTコンパイラ)」という、多くの人が「不可能だ」と考えてきた仕組みに挑む研究プロジェクトです。 この記事では動画の流れに沿って、Porfforとは何か、なぜ事前コンパイルが難しいとされてきたのか、そしてその技術的な仕組みや将来像までを順を追って整理していきます。 Oliver Medhurst氏とは何者かOliver Medhurst氏冒頭、ホストのAndrew氏とJustin氏は、Porfforという「JavaScriptの事前コンパイラ」の存在に驚いたと語り、まずはOliver氏の経歴

        JavaScriptを事前コンパイルする。不可能と言われた挑戦に挑む開発者。|直也テック
      • JavaScriptのforEachでawaitが効かない理由 - Qiita

        背景 JavaScriptでは forEach という配列から要素を取り出して反復処理できる関数があります。 前の記事 JavaScriptのforEach内でbreakができない理由【備忘録】 では、 forEach の中では break が使えず、途中でループを抜けることができない理由についてまとめました。 今回はその続きとして、forEach の内部で await を使った場合に、非同期処理の完了を待たずに次の処理へ進んでしまう、という挙動について理由を調べてみました。 forEach内でawaitしてみる forEach の中で await して得られた値を配列に追加し、 forEach の直後に配列を console.log で出力する例で確認します。 for文の感覚でいえば、イテレーション中の await で都度処理を待ってくれるイメージなので、全ての要素への処理が終わったら配

        • Patterns for Reactivity with Modern Vanilla JavaScript – Frontend Masters Blog

          “Reactivity” is how systems react to changes in data. There are many types of reactivity, but for this article, reactivity is when data changes, you do things. Reactivity Patterns are Core to Web Development We handle a lot with JavaScript in websites and web apps since the browser is an entirely asynchronous environment. We must respond to user inputs, communicate with servers, log, perform, etc.

            Patterns for Reactivity with Modern Vanilla JavaScript – Frontend Masters Blog
          • Announcing TypeScript 5.2 - TypeScript

            Today we’re excited to announce the release of TypeScript 5.2! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s edi

              Announcing TypeScript 5.2 - TypeScript
            • Bringing Javascript to WebAssembly for Shopify Functions - Shopify

              Bringing Javascript to WebAssembly for Shopify FunctionsWhile we’re working on getting our Shopify Functions infrastructure ready for the public beta, we thought we’d use this opportunity to shine some light on how we brought JavaScript to WebAssembly, how we made everything fit within our very tight Shopify Function constraints, and what our plans for the future look like. At Winter Editions 2023

                Bringing Javascript to WebAssembly for Shopify Functions - Shopify
              • Deno 1.12 へのアップデートと変更事項まとめ - 虎の穴ラボ技術ブログ

                皆さんこんにちは、暑い中ですがお元気ですか?おっくんです。 去る 2021 年 7 月 13 日に Deno 1.12 がリリースされました。 今回も、リリースノートを参考に 変更事項の気になるところを紹介したいと思います。 実行環境 macOS Catalina 10.15.7 Docker イメージ denoland/deno:centos(確認時点では Deno 1.12.0 でした) Deno 1.12 Deno 1.12 での変更事項をDeno 1.12 リリースノートを元に確認します。 deno.com Web Crypto API の対応メソッドが増えました Deno 1.12 では、 以下のWeb Crypto APIの 3 つの実装が追加されました。 crypto.subtle.generateKey キー生成 crypto.subtle.sign 署名 crypto.s

                  Deno 1.12 へのアップデートと変更事項まとめ - 虎の穴ラボ技術ブログ
                • Node.js compatibility for Cloudflare Workers – starting with Async Context Tracking, EventEmitter, Buffer, assert, and util

                  Node.js compatibility for Cloudflare Workers – starting with Async Context Tracking, EventEmitter, Buffer, assert, and util2023-03-23 Over the coming months, Cloudflare Workers will start to roll out built-in compatibility with Node.js core APIs as part of an effort to support increased compatibility across JavaScript runtimes. We are happy to announce today that the first of these Node.js APIs –

                    Node.js compatibility for Cloudflare Workers – starting with Async Context Tracking, EventEmitter, Buffer, assert, and util
                  • Announcing TypeScript 5.2 RC - TypeScript

                    Today we’re excited to announce our Release Candidate of TypeScript 5.2! Between now and the stable release of TypeScript 5.2, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: npm install -D typescript@rc Here’s a quick list of what’s new in TypeScript 5.2! using Declarations and Explic

                      Announcing TypeScript 5.2 RC - TypeScript
                    • Neko - A brief history and porting to Javascript

                      In the early 90’s, being a frisian kid obsessed with computers there weren’t a ton of ways to get access to new software or learn more about computers. The two main ways were exchanging 3.5” diskettes with friends, or go to the library. One book I remember more than others was “Windows for Kinderen” (“Windows for Kids”) by Addo Stuur. I must have been around 10 years old and was obsessed by this b

                        Neko - A brief history and porting to Javascript
                      • Announcing TypeScript 5.4 - TypeScript

                        Today we’re excited to announce the release of TypeScript 5.4! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s edi

                          Announcing TypeScript 5.4 - TypeScript
                        • Powerful Scheme interpreter in JavaScript | LIPS Scheme

                          ;; &() is object literal used with quasiquote (let ((obj `&(:name "LIPS Scheme" :version ,lips.version))) ;; you can access JavaScript properties ;; with dot notation, print is display + newline (print (string-append obj.name " " obj.version)) ;; you can mix scheme and JavaScript (setTimeout (lambda () (alert (JSON.stringify obj))) 1000) #void) With LIPS you can mix Scheme and JavaScript. You can

                            Powerful Scheme interpreter in JavaScript | LIPS Scheme
                          • Wasm core dumps and debugging Rust in Cloudflare Workers

                            Wasm core dumps and debugging Rust in Cloudflare Workers2023-08-14 A clear sign of maturing for any new programming language or environment is how easy and efficient debugging them is. Programming, like any other complex task, involves various challenges and potential pitfalls. Logic errors, off-by-ones, null pointer dereferences, and memory leaks are some examples of things that can make software

                              Wasm core dumps and debugging Rust in Cloudflare Workers
                            • Comprehensive guide to JavaScript performance analysis using Chrome DevTools

                              Comprehensive guide to JavaScript performance analysis using Chrome DevTools Let's see how to navigate the Chrome Devtools Performance tab to effectively analyse and improve the performance of your JavaScript while avoiding common errors. Our use case will be improving the rendering FPS of a real-world canvas library. A few weeks ago a colleague of mine and I were looking at the canvas engine comp

                                Comprehensive guide to JavaScript performance analysis using Chrome DevTools
                              • Announcing TypeScript 5.4 Beta - TypeScript

                                Today we are excited to announce the availability of TypeScript 5.4 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: npm install -D typescript@beta Here’s a quick list of what’s new in TypeScript 5.4! Preserved Narrowing in Closures Following Last Assignments The NoInfer Utility Type Object.groupBy and Map.groupBy Support for require() c

                                  Announcing TypeScript 5.4 Beta - TypeScript
                                • Patterns for Memory Efficient DOM Manipulation with Modern Vanilla JavaScript – Frontend Masters Blog

                                  Patterns for Memory Efficient DOM Manipulation with Modern Vanilla JavaScript I’ll discuss best practices to avoid excess memory usage when managing updating the DOM to make your apps blazingly fast™️. DOM: Document Object Model – A Brief Overview When you render HTML, the live view of those rendered elements in the browser is called the DOM. This is what you’ll see in your developer tools “Elemen

                                    Patterns for Memory Efficient DOM Manipulation with Modern Vanilla JavaScript – Frontend Masters Blog
                                  • Scheme in the browser: A Hoot of a tale -- Spritely Institute

                                    Scheme in the browser: A Hoot of a taleDave Thompson — October 10, 2023 Hey there, it’s been a while! We’re back to share some more exciting news about Guile Hoot, a WebAssembly toolchain and Scheme→WASM compiler. In our last post we demonstrated that the Guile Hoot toolchain can be used to assemble programs written in WebAssembly Text (WAT) format, which allowed us to develop for the WASM-4 fanta

                                      Scheme in the browser: A Hoot of a tale -- Spritely Institute
                                    • graphql/dataloader を読んだ話

                                      graphql/dataloader のドキュメント及びソースコードを全て読んだので、その話を書く。 読むことにした第一の理由は仕事で使うからだが、以下の特徴から自分のプログラミング学習教材として適していそうだと考えたからでもある。 広く使われている OSS である GitHub の星が 11k npm trends で検索しても多くの人がダウンロードしている コードの量が少ない 実装は src/index.js に全て書かれている コメント含めて 500 行にも満たず、しかもその 1/3 くらいはコメント テストカバレッジが高い 常に 100% 初めて読むコードでテストカバレッジが高いと、テストコードを読むことで期待される挙動を確認できるので嬉しい npm trends によると、一週間で 200 万件近くダウンロードされているようだ。 目次 graphql/dataloader とは

                                        graphql/dataloader を読んだ話
                                      • AbortController is your friend

                                        AbortController is your friend One of my favorite new features of JS is the humble AbortController, and its AbortSignal. It enables some new development patterns, which I'll cover below, but first: the canonical demo. It's to use AbortController to provide a fetch() you can abort early: Sorry, your browser doesn't support an inline demo. And here's a simplified version of the demo's code: fetchBut

                                          AbortController is your friend
                                        • New Architecture is here · React Native

                                          React Native 0.76 with the New Architecture by default is now available on npm! In the 0.76 release blog post, we shared a list of significant changes included in this version. In this post, we provide an overview of the New Architecture and how it shapes the future of React Native. The New Architecture adds full support for modern React features, including Suspense, Transitions, automatic batchin

                                            New Architecture is here · React Native
                                          • ChatGPT Translate翻訳環境構築 - 井出草平の研究ノート

                                            ChatGPT TranslateをWindows環境においてDeepLのアプリのように使うための設定書である。グローバルホットキー(Ctrl+Alt+T)で翻訳できるように設定してある。DeepLに対する優位性と課題はある。 本マニュアルで構築する「ChatGPT Translate」の自動翻訳環境は、定番の翻訳ツールであるDeepLと比較して明確な一長一短がある。 【利点】DeepLより優れている点 圧倒的な翻訳精度と文脈理解(最大の利点): 単なる直訳ではなく、前後の文脈、細かなニュアンス、高度な専門用語を深く汲み取り、人間が書いたような極めて自然な文章に翻訳できる。 ノイズや乱れに対する強力な補正力: コピー時に混ざった不自然な改行や、OCR(画像文字認識)の誤字脱字、砕けたスラングなどでも、AIが文脈から自動推測して綺麗に補正しながら翻訳してくれる。 【欠点】DeepLに劣ってい

                                              ChatGPT Translate翻訳環境構築 - 井出草平の研究ノート
                                            • Announcing TypeScript 5.4 RC - TypeScript

                                              Today we’re excited to announce our Release Candidate of TypeScript 5.4! Between now and the stable release of TypeScript 5.4, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: npm install -D typescript@rc Here’s a quick list of what’s new in TypeScript 5.4! Preserved Narrowing in Closur

                                                Announcing TypeScript 5.4 RC - TypeScript
                                              • Explicit Resource Management: Exploring JavaScript's and TypeScript's new feature | iliazeus

                                                One of my favorite new features of JavaScript and TypeScript is explicit resource management. It brings new syntax, using foobar = ..., that enables RAII, reducing boilerplate when managing the lifecycle of various resources. In this article, I will explore this feature as implemented in TypeScript 5.2.0 with the disposablestack polyfill. I will mention both sync and async resources, DisposableSta

                                                • async/await周りで苦しんだ箇所の例と対策 | DevelopersIO

                                                  どうも。CX事業本部Delivery部のえーたん(@eetann092)です。 今まで雰囲気でJavaScript(TypeScript)のasync/await、Promiseを使っていて最近苦しんだため、ハマったところの例と対策を備忘録として残しておきます。 await付け忘れ やらかした例 まず、awaitを付け忘れた例です。 import { setTimeout } from "timers/promises"; const unit = 1000; async function logSleepLog(msg: string) { console.log(msg); await setTimeout(1.5 * unit); console.log(msg); } (async () => { logSleepLog("hoo"); console.log("finish");

                                                    async/await周りで苦しんだ箇所の例と対策 | DevelopersIO
                                                  • Announcing TypeScript 5.2 Beta - TypeScript

                                                    Today we are excited to announce the availability of TypeScript 5.2 Beta. To get started using the beta, you can get it through NuGet, or through npm with the following command: npm install -D typescript@beta Here’s a quick list of what’s new in TypeScript 5.2! using Declarations and Explicit Resource Management Decorator Metadata Named and Anonymous Tuple Elements Easier Method Usage for Unions o

                                                      Announcing TypeScript 5.2 Beta - TypeScript
                                                    • What does the image decoding attribute actually do?

                                                      Err... thanks for the technical explanation. But what does this actually mean in real life? Which setting should you use? Does it even matter? And if it does, why don't those clever browser engineers just set it to the best setting? Well recently I ranted on Twitter about this (as I am often want to do!) in a long thread that really should have been a blog post. So here is that blog post. Some mis

                                                        What does the image decoding attribute actually do?
                                                      • jott - js_gc_in_wasm

                                                        # 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

                                                        • Web Sessions at Google I/O 2023の気になった発表のまとめ - console.lealog();

                                                          まとめプレイリストが公開されてたので、その中から気になったやつを流し見した。 https://www.youtube.com/playlist?list=PLOU2XLYxmsIJGxIV8Lt8gF_79Z334LQ6h What's new in Web https://www.youtube.com/watch?v=x9rh0Du4Czg ブラウザで使える最新機能のご紹介 `dialog`要素はいいぞ `showModal()`のほう フォーカスやタブ管理までブラウザがやってくれるし、スタッキングコンテキストも安心 CSS transform `transform: scale(1)`を`scale: 1`って書けるように 複数の組み合わせでもコードがごちゃつかない 新しいCSSの単位 `lv(h|w|min|max)`、`sv(h|w|min|max)`、`dv(h|w|min|m

                                                            Web Sessions at Google I/O 2023の気になった発表のまとめ - console.lealog();
                                                          • Were React Hooks a Mistake? | jakelazaroff.com

                                                            The web dev community has spent the past few weeks buzzing about signals, a reactive programming pattern that enables very efficient UI updates. Devon Govett wrote a thought-provoking Twitter thread about signals and mutable state Devon Govett on X Easy to forget, but the debate about signals is the same one we had about 2-way data binding vs unidirectional data flow 10 years ago. Signals are muta

                                                              Were React Hooks a Mistake? | jakelazaroff.com
                                                            • JavaScriptによるZ80エミュレータでの「手抜き」回転行列 - Qiita

                                                              3EB0 LD A,B0H 84 ADD A,H D660 SUB A,60H D8 RET C 1F RRA 5F LD E,A 9F SBC A,A E60F AND A,0FH 3C INC A 47 LD B,A 3ECE LD A,CEH 92 SUB A,D D69C SUB A,9CH D8 RET C CB47 BIT 0,A 2802 JR Z,+4 CB20 SLA B CB4F BIT 1,A 2804 JR Z,+6 CB20 SLA B CB20 SLA B E67C AND A,7CH 57 LD D,A CB22 SLA D 0F RRCA 0F RRCA 1F RRA 67 LD H,A 9F SBC A,A E680 AND A,80H 92 SUB A,D 6F LD L,A 3001 JR NC,+3 25 DEC H 16F3 LD D,F3H 19

                                                                JavaScriptによるZ80エミュレータでの「手抜き」回転行列 - Qiita
                                                              • Ezno in '23

                                                                It's been a minute since the previous announcement so I thought would give some updates and share some upcoming problems. This follows the initial announcement and includes some smaller things I shared on Twitter since the announcement post. Never heard of Ezno? It is a parser, partial executor, optimizer and type checker for JavaScript! Read the initial announcement. New changes Classes, getters

                                                                  Ezno in '23
                                                                • Introducing TanStack Start Middleware – Frontend Masters Blog

                                                                  TanStack Start is one of the most exciting full-stack web development frameworks I’ve seen. I’ve written about it before. In essence, TanStack Start takes TanStack Router, a superb, strongly-typed client-side JavaScript framework, and adds server-side support. This serves two purposes: it gives you a place to execute server-side code, like database access; and it enables server-side rendering, or

                                                                    Introducing TanStack Start Middleware – Frontend Masters Blog
                                                                  • Browser-Powered Desync Attacks: A New Frontier in HTTP Request Smuggling

                                                                    This request triggered an extremely suspicious intermittent 400 Bad Request response from various websites that were running AWS Application Load Balancer (ALB) as their front-end. Investigation revealed that ALB was mysteriously adding a 'Transfer-Encoding: chunked' header while downgrading the request to HTTP/1.1 for forwarding to the back-end, without making any alterations to the message body:

                                                                      Browser-Powered Desync Attacks: A New Frontier in HTTP Request Smuggling
                                                                    • CTA Modal: How To Build A Web Component — Smashing Magazine

                                                                      In this article, Nathan Smith explains how to create modal dialog windows with rich interaction that will only require authoring HTML in order to be used. They are based on Web Components that are currently supported by every major browser. I have a confession to make — I am not overly fond of modal dialogs (or just “modals” for short). “Hate” would be too strong a word to use, but let’s say that

                                                                        CTA Modal: How To Build A Web Component — Smashing Magazine
                                                                      • JavaScript版『FEDORA』リリース - Qiita

                                                                        5月10日の記事の続きだが、PC-8001向けゲーム『FEDORA』(ASCII, Vol.7, No.7 (1983年7月), pp.143-149)を、JavaScript上で動かしてみた。 5月22日時点でのプログラムリストも、以下に公開しておくことにする。 <!DOCTYPE html><head><meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>FEDORA by Koichi Yasuoka, May 22, 2025</title> <script> var pc8001=new Object(); pc8001.memory=new Array(65536); pc8001.memory.fill(0x76); ["0000 C3 00 E0", "

                                                                          JavaScript版『FEDORA』リリース - Qiita
                                                                        • An overview of Node.js: architecture, APIs, event loop, concurrency

                                                                          Warning: This blog post is outdated. Instead, read chapter “An overview of Node.js: architecture, APIs, event loop, concurrency” in “Shell scripting with Node.js”. This blog post gives an overview of how Node.js works: What its architecture looks like. How its APIs are structured. A few highlights of its global variables and built-in modules. How it runs JavaScript in a single thread via an event

                                                                          • JavaScript vs JavaScript. Fight!

                                                                            With software development, we are often presented with alternative choices for libraries and tools that appear to accomplish the same sort of things. Each one will advertise its key advantages, and we attempt to weigh the pros and cons. Sometimes, the differentiators have less to do with what we are accomplishing and everything with how we accomplish it. In those cases, it isn't always as clear wh

                                                                              JavaScript vs JavaScript. Fight!
                                                                            • JavaScriptによるPC-8001エミュレータにおける2000年問題 - Qiita

                                                                              5月29日の記事で、私(安岡孝一)はこう書いた。 N-BASICのルーチンのうち 0018 1文字出力(メッセージ出力用) 093A 画面幅設定 1602 時計読み込み(ランダムのモト) 52ED 文字列出力 を独自実装する必要があったため、かなり作業が難航した。結論として「1602 時計読み込み(ランダムのモト)」は実装しきれなかった 昨日の記事で、カレンダークロックμPD1990ACの読み込みをエミュレートできたので、今なら「1602 時計読み込み(ランダムのモト)」が実装できる。ただ、N-BASICのカレンダー用バッファは、EA76に秒(BCD 2桁)、EA77に分(BCD 2桁)、EA78に時(BCD 2桁)、EA79に日(BCD 2桁)、EA7Aに月(下位4ビット)、EA7Bに年(BCD 2桁)を入れることになっており、2000年問題が発生する。年をEA7B~EA7Dに拡張(BC

                                                                                JavaScriptによるPC-8001エミュレータにおける2000年問題 - Qiita
                                                                              • The seventh way to call a JavaScript function without parentheses

                                                                                The seventh way to call a JavaScript function without parentheses Published: 12 September 2022 at 13:00 UTC Updated: 18 September 2022 at 17:20 UTC I thought I knew all the ways to call functions without parentheses: alert`1337` throw onerror=alert,1337 Function`x${'alert\x281337\x29'}x``` 'alert\x281337\x29'instanceof{[Symbol['hasInstance']]:eval} valueOf=alert;window+'' x=new DOMMatrix;matrix=al

                                                                                  The seventh way to call a JavaScript function without parentheses
                                                                                • JavaScriptによるPC-8001エミュレータにおけるドットスクロール - Qiita

                                                                                  214FF3 LD HL,F34FH 1100F3 LD DE,F300H 1A LD A,(DE) 060A LD B,0AH ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2B DEC HL 10E6 DJNZ -24 7D LD A,L FE3F CP A,3FH C8 RET Z 217800 LD HL,0078H 19 ADD HL,DE EB EX DE,HL 214F00 LD HL,004FH 19 ADD HL,DE 18D4 JR -42 <!DOCTYPE html><head><meta charset="UTF-8" /> <meta htt

                                                                                    JavaScriptによるPC-8001エミュレータにおけるドットスクロール - Qiita