この資料は以下のイベントの登壇用の殴り書きです
https://hack-at-delta.connpass.com/event/350588/
今までの資料を引用して話すので、この資料はアウトラインです。
import { | |
startTransition, | |
Suspense, | |
use, | |
useActionState, | |
useEffect, | |
} from "react"; | |
import { render, screen, fireEvent, act } from "@testing-library/react"; | |
import { describe, it, expect } from "vitest"; | |
import Counter from "./Counter"; |
/* wrangler dev main.ts --remote */ | |
import { parse } from "cache-control-parser"; | |
async function handleSwrTime( | |
request: Request, | |
env: Env, | |
ctx: ExecutionContext | |
) { | |
// mock response | |
const createNewResponse = () => { |
/** | |
* アクセシビリティ自動修正スクリプト | |
* | |
* 以下の問題を検出し修正します: | |
* 1. コントラスト比の問題 | |
* 2. aria-hidden属性がない装飾的要素 | |
* 3. アクセシブルな名前がないボタン | |
* 4. ビューポートのuser-scalable=noとmaximum-scale問題 | |
* 5. タイトル要素の欠如 | |
* 6. html要素のlang属性の問題 |
/** | |
with wrangler.json | |
"assets": { | |
"binding": "assets", | |
"directory": "public", | |
"run_worker_first": true | |
}, | |
*/ | |
import tsBlankSpace from "ts-blank-space"; | |
export default { |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>esm.sh+react+tailwind demo</title> | |
<script type="importmap"> | |
{ | |
"imports": { |
/** | |
~/sandbox/cfhandson via 🦕 v2.2.8 | |
$ deno run -A x.ts | |
v1.2.2 | |
[ { "$a": "duck", "$b": 42, "$c": [ 10, 11, 12 ] } | |
**/ | |
import duckdb, { INTEGER, LIST, listValue, VARCHAR } from "@duckdb/node-api"; | |
import { DuckDBInstance } from "@duckdb/node-api"; |
この資料は以下のイベントの登壇用の殴り書きです
https://hack-at-delta.connpass.com/event/350588/
今までの資料を引用して話すので、この資料はアウトラインです。
// vite.config.ts | |
// src/sw.ts => /sw.js build on dev | |
// add to index.html: <script vite-ignore type="module">navigator.serviceWorker.register("/sw.js")</script> | |
import { defineConfig, Plugin } from "vite"; | |
import path from "node:path"; | |
import { fileURLToPath } from "node:url"; | |
const dirname = path.dirname(fileURLToPath(import.meta.url)); | |
function sw({ |
addEventListener("install", (event) => { | |
event.waitUntil(skipWaiting()); | |
console.log("Service worker install"); | |
}); | |
addEventListener("activate", (event) => { | |
event.waitUntil(self.clients.claim()); | |
console.log("Service worker activate"); | |
}); |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE DeriveGeneric #-} -- FromJSON と Show の自動導出に必要 | |
module Main (main) where | |
import qualified Network.HTTP.Req as Req | |
import qualified Data.Aeson as Aeson | |
import Control.Monad.IO.Class (liftIO) | |
import GHC.Generics (Generic) -- DeriveGeneric に必要 |