Yusuke Wada - 2024/3/15 Ya8 2024 - ã¤ãã㼠令åå å¹´ææ°ç(ä»®)
laisoãããæ¸ãã¦ãã®ã»ã¼ãªãã ãã© Honoã¯æååã§ãStreamã§ããªãã§ãè¿ãããããµã¼ãã¼ãµã¤ããReactã§æ¸ããããtsconfig.jsonã§é©åã«è¨å®ããã°JSXãªãã§ããããããViteã®dev-serverãããããããµã¼ãã¼ãã¯ã©ã¤ã³ããåæã«éçºããã«ãã§ãã¦ããã¡ããAPIãçããã®ãå¾æã§ãéReact SPAç°å¢ï¼APIä»ãï¼ï¼ä½ãã®ã«åãã¦ããã ä½ãæ¹è§£èª¬ãã¾ããããã©ã人ã¯ããã«ããã¸ã§ã¯ãä½ã£ã¦ãããcloneããã¦ã³ãã¼ããã¦ãã ããã ã¾ããcreate-honoãã¦ãcloudflare-pagesã®ãã³ãã¬ã¼ããé¸ã¶ãbunãããã±ã¼ã¸ããã¼ã¸ã£ã¼ã«ä½¿ã£ã¦ãã
htmxã«ã¤ãã¦ã¡ãã£ã¨éãã§ããããã£ãã®ã§éãã ãCloudflare Workersã®ä¸ã§Honoãåããã¦ãTSXã§HTMLãè¿ãã¤ã¤ããã®ä¸ã«htmxãã®ã£ãããã¿ãããªæ§æãð¹ððð ð¾ðððð ð©ððððððð...ã§ã使ããããªï¼ https://wild-meadow-79c7.windymelt.workers.dev/ ãªããä¸ç¬ã§ã§ããã ãã£ãã㨠pnpm create cloudflare@latestãã¦Hello, Worldããã¸ã§ã¯ããä½æãã¦ãã®ã¾ã¾ãããã¤(ãã®æç¹ã§ https://wild-meadow-79c7.windymelt.workers.dev/ ãçãããããã) ãã£ã¬ã¯ããªãã§ããã®ã§ããã«å ¥ã£ã¦pnpm i honoãã tsconfig.jsonã®compilerOptionsã®jsxã¾ã
2æ9æ¥ãäºåãã¦ããéãHono v4ããªãªã¼ã¹ãã¾ããã ãã®Hono v4ã®ãªãªã¼ã¹ã¨åæã«ãHonoã使ã£ãã¡ã¿ãã¬ã¼ã ã¯ã¼ã¯ãHonoXããå ¬éãã¾ããã ä»åã¯HonoXã®ããã¤ãã®ç¹å¾´ã«ã¤ãã¦æ¸ãã¦ã¿ããã¨æãã¾ããããã¯ä½¿ãæ¹ã¨ããããä½è ç®ç·ã®ææ³ã¿ãããªãã®ã§ãã ã¡ã¿ãã¬ã¼ã ã¯ã¼ã¯ HonoXã¨ã¯ä¸è¨ã§è¨ãã¨ãHonoã¨Viteãçµã¿åãããã¡ã¿ãã¬ã¼ã ã¯ã¼ã¯ãã§ããHonoXèªä½ãæ©è½ãæä¾ããªãã®ãèã§ãã ããå°ãã ãå ·ä½çã«è¨ãã¾ããHonoXã§æ±ãã®ã¯ãHonoã®ã¤ã³ã¹ã¿ã³ã¹ããã®ãã®ã§ããã¤ã¾ãããªããHonoXã§ã¢ããªãä½ãã¨ãããã¨ã¯ãHonoã®ã¢ããªãä½ãããã¨ã«ãªãã¾ãããã®è¨¼æ ã«ã¨ã³ããªã¼ãã¤ã³ãã«ãªãapp/server.tså ã§åºã¦ããappã¯Honoã®ã¤ã³ã¹ã¿ã³ã¹ãªã®ã§ãhono/devã«ãããã«ãã¼é¢æ°showRoutes()ããã®ã¾ã¾ä½¿
Warning HonoX 㯠2024 å¹´ 2 æç¾å¨ã¢ã«ãã¡ã¹ãã¼ã¸ã¨ãªã£ã¦ãã¾ããã»ãã³ãã£ãã¯ãã¼ã¸ã§ã³ã«å¾ããã«ç ´å£çãªå¤æ´ãè¡ãããå¯è½æ§ãããã¾ãã HonoX 㯠Hono 㨠Vite ããã¼ã¹ã«ãããã«ã¹ã¿ã㯠Web ãã¬ã¼ã ã¯ã¼ã¯ã§ãã以ä¸ã®ãããªç¹å¾´ãããã¾ãã ãã¡ã¤ã«ãã¼ã¹ã®ã«ã¼ãã£ã³ã° é«é㪠SSR BYORï¼Bring Your Own Rerenderï¼ï¼ã¬ã³ããªã³ã°ã¨ã³ã¸ã³ãèªç±ã«é¸æã§ãã¾ã islands ãã¤ãã¬ã¼ã·ã§ã³ ããã«ã¦ã§ã¢ï¼ããã¯ã¨ã³ã㯠Hono ã¨ãã¦åä½ãããããå¤ãã® Hono ã®ããã«ã¦ã§ã¢ ã使ç¨ã§ãã¾ã HonoX ãå§ãã æ°ãã HonoX ã®ããã¸ã§ã¯ããä½æããããã«ã¯ãhono-create ã³ãã³ãã使ç¨ãã¾ãã
ãHonoã®v4ã2æ9æ¥ã«ãªãªã¼ã¹ããã¾ããã¨ããè¨äºã«ã¦Hono v4ã§ã¯SSGã¢ã¼ãããµãã¼ããããã¨çºè¡¨ããã£ãããã®æ©è½ã試ãç®çã§ä»ã¾ã§Next.jsã®SSGã¢ã¼ãã§æ§ç¯ãã¦ããå人ããã°ãHonoã®SSGæ©è½ã§æ¸ãæããã ããã° https://yuheinakasaka.github.io/gialog-diary/ ãªãã¸ã㪠https://github.com/YuheiNakasaka/gialog-diary å ã®å人ããã°ã§ã¯r7kamuraããã®r7kamura/gialog: Blog template to use GitHub Issues as article editor.ã¨ãããã³ãã¬ã使ã£ã¦ãããããã¯GitHub IssuesãCMSã¨ãã¦ç¨ãã¦è¨äºãæ¸ããissueã®ä½æãªã©ã®ã¤ãã³ããããã¯ã«ãã¦GitHub Actionsãèµ·åããã¦è¨
ããã«ã¡ã¯ï¼ã©ã¯ã¹ã«ã®ç°åã§ãï¼ è»½éãã¤é«éãªWebãã¬ã¼ã ã¯ã¼ã¯ã§ããHonoã¨ãæ°é²æ°éã®JSã©ã³ã¿ã¤ã ã§ããDenoã使ã£ã¦ã社å ãã¼ã«ãä½ã£ã¦ã¿ã¾ããã®ã§ç´¹ä»ãã¾ãã ä½ã£ããã¼ã« æè¡ã¹ã¿ã㯠index.tsx ã®å 容 Tips Honoã§Twindã使ã Honoã®JSXã§Alpine.jsã使ã Hono+Denoã§esbuildã使ã ãããã« ä½ã£ããã¼ã« ããã¯ããã°åãã®ã¢ã¤ãã£ããç»åã¸ã§ãã¬ã¼ã¿ãä½ãã¾ããã ã¿ã¤ãã«ãå ¥åãã¦ã èæ¯ç»åã¨æåè²ãé¸ãã§ã æåã®ä½ç½®ã¨å¤§ããã調æ´ãã¦ã å¾ã¯ãDownloadããã¿ã³ãæ¼ãã°ç»åãæã«å ¥ãã¾ãã ããã¯ä»¥åãå¼ç¤¾ãã¶ã¤ã³çµç¹ã§ä½ããããZoomèæ¯ã¸ã§ãã¬ã¼ã¿ãã«å¤åã«å½±é¿ããã¦ãã¾ãã ãã¡ãã®ãã¶ã¤ãã¼ããã°ãæ¯éã覧ãã ããï¼ note.com æè¡ã¹ã¿ã㯠ãã®ãã¼ã«ã¯å©ç¨é »åº¦ãããã¾ã§å¤ããªãã¨æ
ãã®è¨äºã¯ä»¥å7æã«èªåã§æ¸ãããHono + htmx + Cloudflare is a new stackãã¨ããè¨äºãä¸é¨ä¿®æ£ãã訳ãããã®ã§ãã Hono + htmx + Cloudflareã¯æ°ããã¹ã¿ã㯠以åãããã¯ã¨ã³ãã¨ã³ã¸ãã¢ã ã£ã身ããããã°ãReactã¯è¤éã ã¨æãããã¨ãããã¾ããããã«ï¼ç§ã¯ãã¬ã¼ã ã¯ã¼ã¯éçºè ãªã®ã§ããï¼ãã¬ã¼ã ã¯ã¼ã¯éçºè ã«ã¨ã£ã¦ã¯ãã¤ãã¬ã¼ã·ã§ã³ã®ä»çµã¿ãä½ããã¨ã¯åä»ã§ãããããããã°ãã°Reactã使ããã¨ã«ãªãã¾ãã Reactã®åªä½ãªç¹ã®ä¸ã¤ã¯ãJSXãã§ããæåè¦ãæãJSXã¯å¥å¦ã«æãã¾ãããããªãã§JavaScriptã®ä¸ã«HTMLã®ã¿ã°ãå ¥ã£ã¦ãããã ï¼ããããããä¸åº¦æ £ããã¨ãJSXã¯æè»ã§ãæ¸ãããããã¨ã«æ°ã¥ãã¾ããã ä»æ¥ã¯ãããããJSXããµã¼ãã¼ãµã¤ãã®ãã³ãã¬ã¼ãã¨ãã¦ä½¿ãæè¡ã¹ã¿ãã¯ãç´¹ä»ãã¾ããããã¯ã¤
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}