Electron
ä¸æåã¯ãä½ãèããã« ipcMain 㨠ipcRenderer ã§ããåããè¡ãªã£ã¦ããã®ã§ãããæè¿ã¯ contextBridge ãæãã®ãã»ãªãªã¼ã¨ãªã£ã¦ã¾ããwww.electronjs.org ã¬ã³ãã©ã¼ããã»ã¹ â ã¡ã¤ã³ããã»ã¹ ä¾ã¨ãã¦ãã¬ã³ãã©ã¼ããã»ã¹ããã¢ããªã®çµäºãè¡ãªâ¦
www.electronjs.orgä¾ãã°ãåç»ãåçããã¢ããªãå¶ä½ããã¨ããªã©ãé·æéå ¥åããªãã¦ãPCãã¹ãªã¼ãã¢ã¼ãã«å ¥ãããªãããã«ãããå ´åãããã¾ãã ãããªã¨ãã¯ãelectron.powerSaveBlockerã使ãã°ãã¹ãªã¼ãã¢ã¼ãã«å ¥ããã¨ãé²ããã¨ãã§ãã¾ãâ¦
Macç¨ã«æ¸ãåºããElectronã¢ããªãã«ã¡ã©ã«ã¢ã¯ã»ã¹ã§ããªãã¨ãã®å¯¾ç ð·
ãã¨ã®çºç«¯ navigator.mediaDevices.getUserMediaã使ã£ã¦ãã¦ã§ãã«ã¡ã©ã«ã¢ã¯ã»ã¹ããMacã¢ããªãä½ã£ã¦ãã¦ã electron . ã§èµ·åããéã«ã¯åé¡ãªãã®ã«ãelectron-packagerã使ã£ã¦ã¢ããªæ¸ãåºãããã¨ãã«ã¡ã©ã®æ åãåå¾ã§ããã«å°ã£ãã®ã§å¯¾çã調â¦
ã¿ã¤ãã«ã®éãã§ãããMacã§electron-builderã§æ¸ãåºããã¢ããªãéããã¨ããã¨ãå£ãã¦ããããéãã¾ãããã´ãç®±ã«å ¥ããå¿ è¦ãããã¾ãããã¨è¡¨ç¤ºãããéã¯æ¡å¼µå±æ§ãåé¤ããã¨éããããã«ãªãã¾ãã xattr -rc ã¢ããªåã§OKã§ãã
Electron + node-dmxã§ã¢ããªãä½ã£ãéãã²ããã¶ãã«electron-rebuildã使ã£ãã®ã§ãããå»æ¢äºå®ï¼This package has been deprecatedï¼ã«ãªã£ã¦ãããã¨ã«æ°ã¥ãã¾ãããblog.kimizuka.orgwww.npmjs.comç´è¿ã§ãã¹ããã³ã±ã¦ããã®ãä¸å®ã§ã¯ããã®ã§ããâ¦
2æã«ãWebããã³ãã¨ã³ãæè¡ã§ä½ãä½é¨åã³ã³ãã³ãåå¼·ä¼ããããã®ã«åå ããã¦ããã ããDMXã®ä¾¿å©ããçæãã¦ããããã¼ã£ã¨æ¬²ããã£ããDMXã³ã³ããã¼ã©ã¼ã¨èª¿å ã¦ãããï¼ãã£ãã¼ï¼ããã¤ãã«æã«å ¥ãããã¨ãã§ããã®ã§ãLEDé»çã調å ã§ããElecâ¦
çµè« const { app } = require('electron'); const window = new BrowserWindow({ width: 375, height: 812, webPreferences: { devTools: false } }); ã¨ãBrowserWindowã®ã¤ã³ã¹ã¿ã³ã¹ãä½æããéã«æ¸¡ããªãã·ã§ã³ã§ãã£ããããã¼ãã¼ã«ãç¡å¹åã§ãããâ¦
çµè« electron-nextå ã®electron-is-devã®ãã¼ã¸ã§ã³ã2.Xã¾ã§ä¸ããã°åãã¾ãã { "private": true, "version": "1.0.0", "main": "main/index.js", "name": "electron-typescript-next", "productName": "ElectronTypescriptNext", "scripts": { "clean":â¦
ãã¨ã®çºç«¯ æ®æ®µãElectronã¢ããªãå¶ä½ããéã¯ã Next.jsã®Electron + TypeScriptã®example ã使ã£ã¦ãã¾ããgithub.com yarn create next-app --example with-electron-typescript app-nameã§ãElectron + Next.jsã®éå½¢ãä½æã§ããã®ã§é常ã«ä¾¿å©ã§ããâ¦
Electronã§BrowserWindowã«localhostã表示ããã³ã¼ããæ¸ãã¾ããã PCå ã«æ¢ã«localhostãç«ã¡ä¸ãã£ã¦ããã°ããããã®ã¾ã¾ãç«ã¡ä¸ãã£ã¦ããªããã°èµ·åãã¦ããBrowserWindowã«è¡¨ç¤ºãã¾ãã éçãªãµã¼ããèµ·åããã ããªã®ã§ãExpressã¯å¿ è¦ãªãã®ã§ãâ¦
Azure Kinect DKãNode.jsãElectronãã使ãããã®ã©ã¤ãã©ãªãè¦ã¤ããã®ã§è©¦ãã¦ã¿ããã¨æãã¾ããgithub.com Azure Kinect DKã¨ã¯ azure.microsoft.com Azure Kinect ã¯ãæ´ç·´ãããã³ã³ãã¥ã¼ã¿ã¼ ãã¸ã§ã³ã¨é³å£°ã¢ãã«ãé«åº¦ãª AI ã»ã³ãµã¼ãAzure Coâ¦
ãã¤ã¦ãelectron-packageã§Macã¢ããªãæ¸ãåºãéã®èª¿æ»çµæãã¾ã¨ãã¾ãããblog.kimizuka.orgä»åã¯ãWindowsã¢ããªãã¼ã¸ã§ã³ã§ãã 試ããã㨠ã¾ãã¯ãåç´ã«ã electron-packager . 'ã¢ããªå' --icon=icon.png --platform=win32 --arch=x64 ã¨ãpngâ¦
æè¿ãElectronã¢ããªãå¶ä½ããéã¯ã Next.jsã®Electron + TypeScriptã®example ã使ã£ã¦ãã¾ããgithub.comå æ¥ã yarn dev ã§ã¯publicãã£ã¬ã¯ããªã®ç»åãèªã¿è¾¼ããã®ã«ãyarn dist ã§æ¸ãåºããã¢ããªããã¯èªã¿è¾¼ããªãã¨ããäºæ ã«åºä¼ããã®ã§ã調â¦
ããã¾ã§ã¯ãYarn Workspacesã®åºæ¬çãªä½¿ãæ¹ ãYarn Workspacesã§è¤æ°ã®Expoããã¸ã§ã¯ãã管çããæ¹æ³ ãè¨äºã«ãã¦ãã¾ãããblog.kimizuka.org blog.kimizuka.orgä»åã¯ãYarn Workspacesã使ã£ã¦è¤æ°ã®Next.js + Electronããã¸ã§ã¯ãã管çãã¾ãã â¦
screen.getAllDisplaysã使ãã°ãå©ç¨å¯è½ãªãã£ã¹ãã¬ã¤ãé åã§åå¾ãããã¨ãã§ãã¾ããwww.electronjs.org const displays = screen.getAllDisplays(); // ãã£ã¹ãã¬ã¤ã®é åãåå¾ ãã®éãé åã®é åºãããããããªãï¼èªèãããé ï¼ï¼ã®ã§ãåã¯åº§â¦
ãã¼ã«ã«ã«ã¦ã§ããµã¼ããç«ã¦ã¦ãå¥ã®ããã¤ã¹ããã¢ã¯ã»ã¹ããéããã¼ã«ã«IPã調ã¹ãã®ãé¢åãªã®ã§ã常æ表示ããã¦ãããããªãã¾ãã ãããªã¨ããããã¾ã§ã¯ IP in menubar ã¨ããã¢ããªã使ã£ã¦ãMacã®ã¡ãã¥ã¼ãã¼ã«IPã¢ãã¬ã¹ã表示ãã¦ããã®ã§ãâ¦
èµ·åããéã«ãã»expressã§ãµã¼ããç«ã¦ãï¼ãã¼ãã¯3000ï¼ ã»publicãã£ã¬ã¯ããªã®ä¸èº«ããã¹ãã£ã³ã°ãã ã»socket.ioã§ãµã¼ãã¨ã¯ã©ã¤ã¢ã³ãã®éä¿¡ãè¡ãï¼ipcéä¿¡ã®ä»£æ¿ï¼ ã»Google Chromeãèµ·åãhttp://localhost:3000ãéãï¼Chromeã®ãã¦ã³ãã¼ãã¯â¦
4å¹´ãããã¶ãã«ã·ãªã¢ã«éä¿¡ãè¡ãElectronã¢ããªãä½ãã¾ããããã¼ãããªããã electronã¨serialportãæ®éã«çµã¿åãããã¨ã¨ã©ã¼ãåºã rebuildããã¨ä½¿ãã ã¨ãã4å¹´åã®è¨æ¶ãããã¾ãã¦ãã¾ãã¯ãelectron + serialportã§ä¸èº«ã空ã£ã½ã®ã¢ããªãä½â¦
é常ã«ç®ãæªãã¦2æéã«1åãããç®è¬ãåºããªãã¨ãããªããã§ããããã£ããå¿ãã¦ãã¾ãäºãå¤ãã2æéããã«Pushéç¥ãéã£ã¦ãããMacã¢ããªãä½ã£ã¦ã¿ã¾ããã ãµã¼ãPushã§ã¯ãªããã¼ã«ã«Pushã§å®è£ ãã¦ãã¾ãã JavaScript const { app, Notificatâ¦
Electronã§BrowserWindowã®ã¤ã³ã¹ã¿ã³ã¹ãçæããéã«ãªãã·ã§ã³ã¨ãã¦ãtransparent: trueã渡ãã¨èæ¯ãéæãªã¢ããªãä½æã§ãã¾ãã const mainWindow = new BrowserWindow({ transparent: true }); Macã ã¨ããã§åé¡ãªãã®ã§ãããWindowsã ã¨ã consâ¦
æè¿ãWebVRã®éçºããã¦ããã®ã§ãããhttpsãå¿ é ãã¤ã確èªã«ã¯Oculus Questã使ãã®ã§ãlocalhostãhttpsã«ãã¦ãQuestãããã«ç¹ããªãã¨é¢åããã¦ãã£ã¦ããã¾ããã ï¼æåã¯ãã¡ãã¡ãµã¼ãã«ã¢ãããã¦ç¢ºèªãã¦ããï¼èªåã§è¨¼ææ¸ãçºè¡ããããmkcâ¦
electron 㨠mdns ãåæã«ä½¿ããã¨æã£ãã¨ããã App threw an error during load Error: The module '/Users/nanashi/develop/node_modules/mdns/build/Release/dns_sd_bindings.node' was compiled against a different Node.js version using NODE_MODUâ¦
Electronã§Macã¢ããªãã¤ããã¨ãããªãªã¼ã¹ã®äºå®ã¯ãªããã®ã®ã¢ããªã¢ã¤ã³ã³ããªãªã¸ãã«ã®ãã®ã«ããããªã¨æããMacã¢ããªã®ã¢ã¤ã³ã³ã®ã¤ãããããè²ã 調ã¹ã¾ããã ã¢ã¤ã³ã³ãã¡ã¤ã«ï¼.icnsï¼ã®ã¤ãããã æ¬å½ã«è²ã 調ã¹ã¾ãããããããªãµã¤ãºã®ç»åâ¦