並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 69件

新着順 人気順

javascript settimeout function return valueの検索結果1 - 40 件 / 69件

  • setTimeout を完璧に理解する

    setTimeout は、指定された時間以降に指定されたコードを実行する JavaScript の API です。ブラウザでも Node.js でも広く使われているのですが、実装はまちまちで、色々と特殊な条件も多く、挙動を完璧に理解している人は少ないと思います。この記事では、そんな setTimeout を可能な限り深堀りしてみようと思います。 先に書いておきますが、ものすごくニッチで細かい話ばかり並びます。突然私が、ただ純粋に setTimeout について調べたくなったので、その結果をまとめただけのものです。普通に開発している人には必要のない情報が多くなるでしょう。この記事は基礎から setTimeout を学ぼう、という方には全然向かないと思います。 また、JavaScript のイベントループについてある程度理解していることを前提とします。その詳しい理解には、@PADAone さん

    • 実装例から見る 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 | サイボウズエンジニアのブログ
      • Remix 3 発表まとめ - React を捨て、Web標準で新しい世界へ

        はじめに 2025年10月10日、カナダのトロントで開催されたイベント "Remix Jam 2025" で Ryan Florence と Michael Jackson が Remix 3 を発表しました。このセッションは、React Router の生みの親たちが、なぜ React から離れ、独自のフレームワークを作ることにしたのか、その理由と新しいビジョンを語った歴史的な発表です。 本記事では、1時間47分に及ぶセッションの内容を詳しく解説します。 なぜ Remix 3 を作るのか 💡 動画で確認する (3:17:30~) React への感謝と決別 Michael Jackson と Ryan Florence は、React に対して深い敬意を持っています。React は彼らのキャリアを変え、Web 開発の考え方を一変させました。React Router を10年以上メンテナ

          Remix 3 発表まとめ - React を捨て、Web標準で新しい世界へ
        • イベントループと TypeScript の型から理解する非同期処理

          この本は、ブルーベリー本の 8 章からインスパイアされて、 TS の型が示す情報から Promise というものを理解してみる、というアプローチで書いたJSの非同期処理の解説です。 これらの資料と合わせて読むことを推奨します。 JSのイベントループのイメージを掴む JSでは中々意識することが少ないですが、正しく理解するには OS レベルのスレッドの視点で考え始める必要があります。 ブラウザや Node.js では一つのスクリプト実行単位を1つのスレッドに割り当てます。それをメインスレッドと呼んだり、ブラウザだったら UI スレッドと呼んだりします。 例えばブラウザでは、これは秒間60回、つまり 16.6ms ごとにループを呼び出します。(node だったらこれがもっと短いです) 仮に setTimeout の実装がなかったとして、それ相当の擬似コードを書くのを試みます。 let handl

            イベントループと TypeScript の型から理解する非同期処理
          • Chromeに入るRecorder機能の利用と注意点 - 虎の穴ラボ技術ブログ

            こんにちは。虎の穴ラボのH.Hです。 今回は先日発表されたChromeの開発中の新機能であるRecorder機能について使用方法や利用する際の注意点などをまとめました。 Recoder機能とは ブラウザのChrome97で追加される予定の機能で、ブラウザの画面上で操作した記録を取得してくれる機能になります。 この記事を書いている2021年11月17日では一般に提供されているChromeの最新版は96となり、開発中の「Chrome Dev」もしくは「Chrome Canary」でRecorder機能を使用することができます。 利用している時の様子はChromeの開発者向けのページに公開されています。 developer.chrome.com 主な機能は以下の通りです。 ・操作の記録及び再実行(リプレイ)できる ・再実行時にパフォーマンスの記録・確認できる ・記録した内容の編集ができる ・操作

              Chromeに入るRecorder機能の利用と注意点 - 虎の穴ラボ技術ブログ
            • JavaScriptのforEachでawaitが効かない理由 - Qiita

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

              • BigQueryのアンチパターン認識ツールで独自のSQLリンターを開発しました - ZOZO TECH BLOG

                こんにちは、株式会社ZOZOで25卒の内定者アルバイトをしている村井です。この記事では業務で取り組んでいる、BigQueryで使うSQLのリンターの作成方法について紹介します。 目次 目次 課題と解決策 課題 解決策 BigQueryのアンチパターン認識ツール ミニマムな使い方 日本語がSQL内に含まれている際の問題 アンチパターンを定義する リンターとしてBigQueryのアンチパターン認識ツールを使用する際に生じる課題と解決策 構成 APIサーバ化 Chrome拡張 動作例 まとめ 課題と解決策 課題 社内では様々なチームがSQLを書いており、動作はするものの良くない書き方をしている場合があります。そういった構文を検知して、前もって修正する必要があります。 解決策 BigQueryのコンソールで入力されたSQLの不正構文を検知、修正案を提示できるようにしました。 BigQueryのアン

                  BigQueryのアンチパターン認識ツールで独自のSQLリンターを開発しました - ZOZO TECH BLOG
                • JavaScriptの基礎と向き合う - iimon TECH BLOG

                  よろしくお願いします!エンジニアのideです。 こちらはアドベントカレンダー23日目の記事になります! 今年は体のあちこちに痛みを感じることが多かったので、来年こそは健康に過ごせる一年になるといいなと願っています。 さて、今回は今年やってきたことを振り返るのもいい機会だなと思い、特に触れる機会が多かったJavaScriptについてまとめてみることにしました。 結果的に基本的な内容が中心となりましたが、改めて理解を深める良いきっかけになったので、これはこれでよしとしています! それではよろしくお願いいたします! [目次] テンプレート文字列 スプレッド構文 分割代入 プロパティ名の短縮記法 オプショナルチェーン nullish(??)とfalsy(||)チェック ディープコピー アロー関数 Promise async/await forEachの中でasync/awaitが効かない おわりに

                    JavaScriptの基礎と向き合う - iimon TECH BLOG
                  • 第2章 ブラウザ操作自動化の基本 ~非同期処理を扱うasync/await関数、自動化の鍵を握るPuppeteerコンポーネント | gihyo.jp

                    [速習] Puppeteer ~ヘッドレスChromeでテスト&スクレイピング 第2章ブラウザ操作自動化の基本 ~非同期処理を扱うasync/await関数、自動化の鍵を握るPuppeteerコンポーネント 第2章では、実際にヘッドレスChromeを自動化するうえで必要となる、最新のJavaScriptの構文やPuppeteerのAPIについて解説します。 進化し続けるJavaScript PuppeteerのAPIを解説する前に、第1章の冒頭で掲載したサンプルコードを見返してみましょう。もしかすると、中にはまったく見慣れない構文が見つかったかもしれません。 const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await b

                      第2章 ブラウザ操作自動化の基本 ~非同期処理を扱うasync/await関数、自動化の鍵を握るPuppeteerコンポーネント | gihyo.jp
                    • Next.jsのコンパイラから知るServer Actionsの完全解析 ~セキュリティ上の注意点も含めて~ - カミナシ エンジニアブログ

                      はじめに StatHackカンパニーの渡邉です。 私の普段の取り組みをこちらで紹介しているのでこちらもどうぞ。 note.kaminashi.jp 私たちKaminashiでは、さまざまなプロダクトにNext.jsを採用し始めています。 今回のブログではNext.jsの最も特徴的な機能の一つであるServer Actionsに関してフォーカスし、それがどういう仕組みで動いているのかコンパイラのソースコードを確認しながら解説し、 最後に実装上の注意点について述べます。 特にServer Actionsの具体的な中身の解説に関してはヘビーなので、実装上の注意点だけ見てもらうだけでも良いかもしれないです。 それではやっていきましょう。 Server Actionsとは? Server ActionsとはNext.js v14から正式にリリースされた機能で、従来フロントエンドのために記述していたR

                        Next.jsのコンパイラから知るServer Actionsの完全解析 ~セキュリティ上の注意点も含めて~ - カミナシ エンジニアブログ
                      • 【JS体操】第2問「画像の横長具合を比較しよう」〜正攻法&ハック部門の解説〜 - KAYAC Engineers' Blog

                        こんにちは! カヤック面白プロデュース事業部のおばらです。 普段は受託案件のデザイン・フロントエンド開発などを担当しています。 さて、『JS体操』第2問 いかがでしたか? 今回初めての方々 第1問に引き続きの方々 複数のアプローチで何通りも回答してくださった方々 普段業務で JavaScript をバリバリ書いているであろう方々 JavaScript を学んでいる学生の方々 などたくさんの方々が挑戦してくださいました。 とても嬉しいです。ありがとうございます! 『JS体操』とは? 『JS体操』とはカヤックが主催する JavaScript のコードゴルフ大会です。 もともとは社内の勉強会として始めた施策です。 その詳細は以下のブログ記事を御覧ください! techblog.kayac.com 第2問の詳細はこちら https://hubspot.kayac.com/js-taiso-002 も

                          【JS体操】第2問「画像の横長具合を比較しよう」〜正攻法&ハック部門の解説〜 - KAYAC Engineers' Blog
                        • Server Actions の同時実行制御と画面の状態更新

                          2024 年 5 月現在だと Next.js のドキュメントには明示的な記載がないが、「同時に実行可能な Server Action は常に1つだけ」という件について。 実は自分もこれをちゃんと認識しておらず、先日会社の先輩に教わって初めて知ったので、試したことなどを書き残しておく。 Next.js の場合、App Router (Router Reducer) によって、Server Action の実行が直列化 (キューイング) されるようになっている。 このキューイングの挙動を考慮すると、以下のような呼び出し方は危ういコードとなる。 "use client"; import { useState } from "react"; import { increment } from "./actions"; export default function Page() { const [

                            Server Actions の同時実行制御と画面の状態更新
                          • 悪名高きスクロール妨害広告を解析する - Qiita

                            <!-- Generated by まとめくす (https://2mtmex.com/) --> <div class="article_mid_v2"> <div id="article_mid_v2"> <script type="text/javascript"> (function(){ var ua = window.navigator.userAgent; var android_reg = /android/i; var android_rand = Math.floor(Math.random() * (100)) + 1; var ios_rand = Math.floor(Math.random() * (115)) + 1; if (ua.match(android_reg)) { if (100 >= android_rand) { var elements =

                              悪名高きスクロール妨害広告を解析する - Qiita
                            • 【KARAKURI LM 10本ノック】番外編: Chrome内蔵のローカルLLM (Gemini Nano)で「どこでもCopilot」を作ってみた

                              【KARAKURI LM 10本ノック】番外編: Chrome内蔵のローカルLLM (Gemini Nano)で「どこでもCopilot」を作ってみた 本記事中で紹介しているユーザスクリプト「どこでもCopilot」。ChromeビルトインのLLMで、任意のフォーム上で文章の続きをサジェスト。外部通信なし、無料で動作こんにちは、カラクリR&Dの吉田です。今回は、10本ノック「番外編」ということで、Google Chrome の最新版に先日(2024年8月22日)組み込まれたローカルLLMの話をします。 本記事の概要2024年8月22日に公開された Google Chrome の「バージョン128」にローカルLLM として Gemini Nano が組み込まれました。このLLMは、フロントエンド JavaScript から手軽に呼び出し可能で、ローカルLLMなので外部への通信は発生しません。

                                【KARAKURI LM 10本ノック】番外編: Chrome内蔵のローカルLLM (Gemini Nano)で「どこでもCopilot」を作ってみた
                              • 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
                                  • ECMAScript Record & Tuple polyfill はどのようにして実装されているのか | Wantedly Engineer Blog

                                    Record & Tuple とはRecord & Tuple は ECMAScript (JavaScript) に対する提案段階の機能で、構造化データのためのプリミティブ型を提供するというものです。RecordはObjectのプリミティブ版、TupleはArrayのプリミティブ版にあたります。 プリミティブとオブジェクトJavaScriptにおける値はプリミティブとオブジェクトの2種類に分けられます。 プリミティブはイミュータブルで、値の同等性にもとづいて比較されます。既存のプリミティブとして、null, undefined, number, string, boolean, bigint, symbol が存在しています。オブジェクトはデフォルトでは書き換え可能で、参照の同一性にもとづいて比較されます。これまで、複数のスカラー値をまとめて構造化データとして扱うには、オブジェクト (主

                                      ECMAScript Record & Tuple polyfill はどのようにして実装されているのか | Wantedly Engineer Blog
                                    • 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
                                          • Font with Built-In Syntax Highlighting

                                            Syntax Highlighting in Hand-Coded Websites The problem I have been trying to identify practical reasons why hand-coding websites with HTML and CSS is so hard (by hand-coding, I mean not relying on frameworks, generators or 3rd party scripts that modify the DOM). Let's say, I want to make a blog. What are the actual things that prevent me from making—and maintaining—it by hand? What would it take t

                                            • 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
                                              • 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
                                                • Node.js 16.x runtime now available in AWS Lambda | Amazon Web Services

                                                  AWS Compute Blog Node.js 16.x runtime now available in AWS Lambda This post is written by Dan Fox, Principal Specialist Solutions Architect, Serverless. You can now develop AWS Lambda functions using the Node.js 16 runtime. This version is in active LTS status and considered ready for general use. To use this new version, specify a runtime parameter value of nodejs16.x when creating or updating fu

                                                    Node.js 16.x runtime now available in AWS Lambda | Amazon Web Services
                                                  • Node.js v22の主な変更点 - 別にしんどくないブログ

                                                    引用元: https://nodejs.org/en/about/branding 2024年4月24日にリリースされたNode.js v22の主な変更点を紹介します。 Node.js v22はLTS(長期サポート)のバージョンになります。10月の後半にLTSとしてサポートが始まります。 nodejs.org require()がESMをサポート V8 12.4 アップデートによる JavaScript の機能 Array.fromAsync() Set methods union() intersection() difference() symmetricDifference() isSubsetOf() isSupersetOf() isDisjointFrom() Iterator Helpers map() filter() reduce() --runオプションによるpacka

                                                      Node.js v22の主な変更点 - 別にしんどくないブログ
                                                    • JavaScript ES6のAsync/Awaitで非同期処理とエラー処理、並列処理を解説!初心者向け完全ガイド - deve.K's Programming Primer - プログラミング初心者のための入門ブログ

                                                      この記事では、ES6のasync/await、およびPromises.all()を使用して非同期プログラミングを容易にする方法を学習します。 前回でのPromiseチュートリアルは以下で学ぶことができますので参照ください。 dev-k.hatenablog.com async/awaitとは asyncキーワード awaitキーワード Promise並列処理 async/awaitでのループ エラー処理 async/awaitでFetchを使用する方法 使用に関する注意点(ルール) 最後に async/awaitとは async/awaitは技術的に言えば、Promisesのシンタックスシュガー(Syntax sugar)となります。 シンタックスシュガーとは簡単に言ってしまえば、構文を省略しプログラムを書いていく事をシンタックスシュガーと言います。 ですが、これはプログラミング言語によっ

                                                        JavaScript ES6のAsync/Awaitで非同期処理とエラー処理、並列処理を解説!初心者向け完全ガイド - deve.K's Programming Primer - プログラミング初心者のための入門ブログ
                                                      • 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
                                                              • 進化が止まらない!Next.js13の基本機能をしっかり理解しよう | アールエフェクト

                                                                Next.jsは現在最も人気のあるReactベースのフルスタックのJavaScriptフレームワークです。バージョンがアップする毎に新しい機能が次々に追加されNext.js13からServer ComponentsなどReactの最新機能を利用したApp Routerが登場しました。App Routerはファイル名でルーティングを設定していた既存のPage Routerとは全く異なる機能で設定方法も一から学び直す必要があります。新たにプロジェクトを作成するのであればApp Routerを利用することが推奨されていますが同時に両方の機能を利用することも可能です。 次々に新しい機能が追加される反面、ネット上に公開されている記事もすぐにOutDatedなものになっています。この文書もすぐにOutdatedなものになってしまうと思いますが現在(2023年5月)の最新バージョン13.4のドキュメント

                                                                  進化が止まらない!Next.js13の基本機能をしっかり理解しよう | アールエフェクト
                                                                • 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
                                                                    • JavaScript Promiseについての初学者向け解説 - 概念と操作の基礎 - deve.K's Programming Primer - プログラミング初心者のための入門ブログ

                                                                      本日はJavaScriptのPromiseの操作とその概念について初学者様に解説致します。 非同期関数 Promise Promiseの状態 Promiseの作成 Promiseをチェーンする方法 Promiseを返す promiseのthenとfinallyの違い より高度な複数のPromise処理 最後に 前提の知識とスキルとして、少なくともES6の関数・高階関数・コールバック関数およびJavaScriptオブジェクトに精通している必要があります。 上記を学び終えてない方は、以下で学習できますので参照ください。 dev-k.hatenablog.com dev-k.hatenablog.com dev-k.hatenablog.com 非同期関数 JavaScriptにおいて非同期処理を行う際には、従来はコールバック関数を利用していました。 しかし、JavaScriptにおいて関数が第

                                                                        JavaScript Promiseについての初学者向け解説 - 概念と操作の基礎 - deve.K's Programming Primer - プログラミング初心者のための入門ブログ
                                                                      • 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
                                                                            • A Small Guide for Naming Stuff in Front-end Code

                                                                              Reading Time: 9 minutes Phil Karlton has famously said that the two hardest things in computer science are naming things and cache invalidation1. That’s still kinda true in front-end development. Naming stuff is hard, and so is changing a class name when your stylesheet is cached. For quite a few years, I’ve had a gist called “Tiny Rules for How to Name Stuff.” Which is what you think: little tiny

                                                                                A Small Guide for Naming Stuff in Front-end Code
                                                                              • 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