text:
[Extension Bug] Home Assistant crashes when searching for entities

Extension – Home Assistant

Author: @tonka3000

Description
When searching for entities, the Raycast HA extension crashes.
The current behavior
Searching for an entity throws an exception. I suspect (but have not verified) that the culprit is assuming that friendly_name exists as a property on the entity. See: https://github.com/raycast/extensions/blob/main/extensions/homeassistant/src/haapi.ts#L191
TypeError: Cannot read properties of undefined (reading 'toLowerCase')

Ea:index.js:7:19733

---
4: `+Object.keys(d).map(t=>`${t}: ${d[t]}`).join(`\r
5: `)+`\r
6: \r
7: `+a)),p.removeListener("error",ap),p.destroy()}});var va=b((h0,ha)=>{"use strict";var s1=pp();s1.createWebSocketStream=ia();s1.Server=fa();s1.Receiver=Ge();s1.Sender=Je();s1.WebSocket=s1;s1.WebSocketServer=s1.Server;ha.exports=s1});Ra(exports,{default:()=>xa});var o=$(require("@raycast/api")),I1=$(require("react"));var T1=$(require("@raycast/api"));var ip=1,Z=2,Se=3,be=4,sp=5;function mp(p){return{type:"auth",access_token:p}}function lp(){return{type:"get_states"}}function rp(p){let e={type:"subscribe_events"};return p&&(e.event_type=p),e}function Ne(p){return{type:"unsubscribe_events",subscription:p}}function op(){return{type:"ping"}}function np(p,e){return{type:"result",success:!1,error:{code:p,message:e}}}var te=!1,Ua="auth_required",Ia="auth_invalid",Fa="auth_ok";function up(p){if(!p.auth)throw be;let e=p.auth,a=e.expired?e.refreshAccessToken().then(()=>{a=void 0},()=>{a=void 0}):void 0,d=e.wsUrl;te&&console.log("[Auth phase] Initializing",d);function t(i,s,m){te&&console.log("[Auth Phase] New connection",d);let l=new WebSocket(d),r=!1,n=()=>{if(l.removeEventListener("close",n),r){m(Z);return}if(i===0){m(ip);return}let f=i===-1?-1:i-1;setTimeout(()=>t(f,s,m),1e3)},u=async f=>{try{e.expired&&await(a||e.refreshAccessToken()),l.send(JSON.stringify(mp(e.accessToken)))}catch(c){r=c===Z,l.close()}},_=async f=>{let c=JSON.parse(f.data);switch(te&&console.log("[Auth phase] Received",c),c.type){case Ia:r=!0,l.close();break;case Fa:l.removeEventListener("open",u),l.removeEventListener("message",_),l.removeEventListener("close",n),l.removeEventListener("error",n),l.haVersion=c.ha_version,s(l);break;default:te&&c.type!==Ua&&console.warn("[Auth phase] Unhandled message",c)}};l.addEventListener("open",u),l.addEventListener("message",_),l.addEventListener("close",n),l.addEventListener("error",n)}return new Promise((i,s)=>t(p.setupRetry,i,s))}var ie=!1,Te=class{constructor(e,a){this.options=a,this.commandId=1,this.commands=new Map,this.eventListeners=new Map,this.closeRequested=!1,this.setSocket(e)}get haVersion(){return this.socket.haVersion}get connected(){return this.socket.readyState==this.socket.OPEN}setSocket(e){let a=this.socket;if(this.socket=e,e.addEventListener("message",d=>this._handleMessage(d)),e.addEventListener("close",d=>this._handleClose(d)),a){let d=this.commands;this.commandId=1,this.commands=new Map,d.forEach(i=>{"subscribe"in i&&i.subscribe&&i.subscribe().then(s=>{i.unsubscribe=s,i.resolve()})});let t=this._queuedMessages;if(t){this._queuedMessages=void 0;for(let i of t)i.resolve()}this.fireEvent("ready")}}addEventListener(e,a){let d=this.eventListeners.get(e);d||(d=[],this.eventListeners.set(e,d)),d.push(a)}removeEventListener(e,a){let d=this.eventListeners.get(e);if(!d)return;let t=d.indexOf(a);t!==-1&&d.splice(t,1)}fireEvent(e,a){(this.eventListeners.get(e)||[]).forEach(d=>d(this,a))}suspendReconnectUntil(e){this.suspendReconnectPromise=e}suspend(){if(!this.suspendReconnectPromise)throw new Error("Suspend promise not set");this.socket.close()}close(){this.closeRequested=!0,this.socket.close()}async subscribeEvents(e,a){return this.subscribeMessage(e,rp(a))}ping(){return this.sendMessagePromise(op())}sendMessage(e,a){if(ie&&console.log("Sending",e),this._queuedMessages){if(a)throw new Error("Cannot queue with commandId");this._queuedMessages.push({resolve:()=>this.sendMessage(e)});return}a||(a=this._genCmdId()),e.id=a,this.socket.send(JSON.stringify(e))}sendMessagePromise(e){return new Promise((a,d)=>{if(this._queuedMessages){this._queuedMessages.push({reject:d,resolve:async()=>{try{a(await this.sendMessagePromise(e))}catch(i){d(i)}}});return}let t=this._genCmdId();this.commands.set(t,{resolve:a,reject:d}),this.sendMessage(e,t)})}async subscribeMessage(e,a,d){this._queuedMessages&&await new Promise((i,s)=>{this._queuedMessages.push({resolve:i,reject:s})});let t;return await new Promise((i,s)=>{let m=this._genCmdId();t={resolve:i,reject:s,callback:e,subscribe:(d==null?void 0:d.resubscribe)!==!1?()=>this.subscribeMessage(e,a):void 0,unsubscribe:async()=>{this.connected&&await this.sendMessagePromise(Ne(m)),this.commands.delete(m)}},this.commands.set(m,t);try{this.sendMessage(a,m)}catch{}}),()=>t.unsubscribe()}_handleMessage(e){let a=JSON.parse(e.data);ie&&console.log("Received",a);let d=this.commands.get(a.id);switch(a.type){case"event":d?d.callback(a.event):(console.warn(`Received event for unknown subscription ${a.id}. Unsubscribing.`),this.sendMessagePromise(Ne(a.id)));break;case"result":d&&(a.success?(d.resolve(a.result),"subscribe"in d||this.commands.delete(a.id)):(d.reject(a.error),this.commands.delete(a.id)));break;case"pong":d?(d.resolve(),this.commands.delete(a.id)):console.warn(`Received unknown pong response ${a.id}`);break;default:ie&&console.warn("Unhandled message",a)}}async _handleClose(e){if(this.commands.forEach(t=>{"subscribe"in t||t.reject(np(Se,"Connection lost"))}),this.closeRequested)return;this.fireEvent("disconnected");let a=Object.assign(Object.assign({},this.options),{setupRetry:0}),d=t=>{setTimeout(async()=>{ie&&console.log("Trying to reconnect");try{let i=await a.createSocket(a);this.setSocket(i)}catch(i){if(this._queuedMessages){let s=this._queuedMessages;this._queuedMessages=void 0;for(let m of s)m.reject&&m.reject(Se)}i===Z?this.fireEvent("reconnect-error",i):d(t+1)}},Math.min(t,5)*1e3)};this.suspendReconnectPromise&&(await this.suspendReconnectPromise,this.suspendReconnectPromise=void 0,this._queuedMessages=[]),d(0)}_genCmdId(){return++this.commandId}};var Ma=p=>p*1e3+Date.now();async function $a(p,e,a){let d=typeof location!="undefined"&&location;if(d&&d.protocol==="https:"){let m=document.createElement("a");if(m.href=p,m.protocol==="http:"&&m.hostname!=="localhost")throw sp}let t=new FormData;e!==null&&t.append("client_id",e),Object.keys(a).forEach(m=>{t.append(m,a[m])});let i=await fetch(`${p}/auth/token`,{method:"POST",credentials:"same-origin",body:t});if(!i.ok)throw i.status===400||i.status===403?Z:new Error("Unable to fetch tokens");let s=await i.json();return s.hassUrl=p,s.clientId=e,s.expires=Ma(s.expires_in),s}var cp=class{constructor(e,a){this.data=e,this._saveTokens=a}get wsUrl(){return`ws${this.data.hassUrl.substr(4)}/api/websocket`}get accessToken(){return this.data.access_token}get expired(){return Date.now()>this.data.expires}async refreshAccessToken(){if(!this.data.refresh_token)throw new Error("No refresh_token");let e=await $a(this.data.hassUrl,this.data.clientId,{grant_type:"refresh_token",refresh_token:this.data.refresh_token});e.refresh_token=this.data.refresh_token,this.data=e,this._saveTokens&&this._saveTokens(e)}async revoke(){if(!this.data.refresh_token)throw new Error("No refresh_token to revoke");let e=new FormData;e.append("action","revoke"),e.append("token",this.data.refresh_token),await fetch(`${this.data.hassUrl}/auth/token`,{method:"POST",credentials:"same-origin",body:e}),this._saveTokens&&this._saveTokens(null)}};function fp(p,e){return new cp({hassUrl:p,clientId:null,expires:Date.now()+1e11,refresh_token:"",access_token:e,expires_in:1e11})}var hp=p=>{let e=[];function a(t){let i=[];for(let s=0;s<e.length;s++)e[s]===t?t=null:i.push(e[s]);e=i}function d(t,i){p=i?t:Object.assign(Object.assign({},p),t);let s=e;for(let m=0;m<s.length;m++)s[m](p)}return{get state(){return p},action(t){function i(s){d(s,!1)}return function(){let s=[p];for(let l=0;l<arguments.length;l++)s.push(arguments[l]);let m=t.apply(this,s);if(m!=null)return m instanceof Promise?m.then(i):i(m)}},setState:d,subscribe(t){return e.push(t),()=>{a(t)}}}};var vp=(p,e,a,d)=>{if(p[e])return p[e];let t=0,i,s=hp(),m=()=>a(p).then(r=>s.setState(r,!0)),l=()=>m().catch(r=>{if(p.connected)throw r});return p[e]={get state(){return s.state},refresh:m,subscribe(r){t++,t===1&&(d&&(i=d(p,s)),p.addEventListener("ready",l),l());let n=s.subscribe(r);return s.state!==void 0&&setTimeout(()=>r(s.state),0),()=>{n(),t--,t||(i&&i.then(u=>{u()}),p.removeEventListener("ready",m))}}},p[e]};var wp=p=>p.sendMessagePromise(lp());function qa(p,e){let a=p.state;if(a===void 0)return;let{entity_id:d,new_state:t}=e.data;if(t)p.setState({[t.entity_id]:t});else{let i=Object.assign({},a);delete i[d],p.setState(i,!0)}}async function ja(p){let e=await wp(p),a={};for(let d=0;d<e.length;d++){let t=e[d];a[t.entity_id]=t}return a}var Ha=(p,e)=>p.subscribeEvents(a=>qa(e,a),"state_changed"),De=p=>vp(p,"_ent",ja,Ha),_p=(p,e)=>De(p).subscribe(e);async function gp(p){let e=Object.assign({setupRetry:0,createSocket:up},p),a=await e.createSocket(e);return new Te(a,e)}var ne=$(require("@raycast/api")),Fe=$(d2()),Me=$(i2());function s2(p){return p instanceof Error?p.message:"unknown error"}function Ud(p){let e=[];for(let d in p){let t=encodeURI(p[d]);e.push(`${d}=${t}`)}let a="";return e.length>0&&(a="?"),a+e.join("&")}var $e=class{constructor(e,a){this.token=a,this.url=e}urlJoin(e){return(0,Me.default)(this.url,e)}async fetch(e,a={}){let d=Ud(a),t=(0,Me.default)(this.url,"api",e+d);console.log(`send GET request: ${t}`);try{return await(await(0,Fe.default)(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`}})).json()}catch(i){console.log(i)}}async post(e,a={}){let d=this.url+"/api/"+e;console.log(`send POST request: ${d}`);let t=JSON.stringify(a);console.log(t);let i=await(0,Fe.default)(d,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`},body:t});if(console.log(`status: ${i.status}`),i.status<200||i.status>=300)throw new Error(`Status code ${i.status}`);return null}async callService(e,a,d){let t=d;try{await this.post(`services/${e}/${a}`,d=t)}catch(i){(0,ne.showToast)(ne.ToastStyle.Failure,"Error",s2(i))}}async openCover(e){return await this.callService("cover","open_cover",{entity_id:e})}async closeCover(e){return await this.callService("cover","close_cover",{entity_id:e})}async toggleCover(e){return await this.callService("cover","toggle",{entity_id:e})}async stopCover(e){return await this.callService("cover","stop_cover",{entity_id:e})}async toggleLight(e){return await this.callService("light","toggle",{entity_id:e})}async turnOnLight(e){return await this.callService("light","turn_on",{entity_id:e})}async turnOffLight(e){return await this.callService("light","turn_off",{entity_id:e})}async playMedia(e){return await this.callService("media_player","play_media",{entity_id:e})}async playPauseMedia(e){return await this.callService("media_player","media_play_pause",{entity_id:e})}async nextMedia(e){return await this.callService("media_player","media_next_track",{entity_id:e})}async previousMedia(e){return await this.callService("media_player","media_previous_track",{entity_id:e})}async pauseMedia(e){return await this.callService("media_player","media_pause",{entity_id:e})}async stopMedia(e){return await this.callService("media_player","media_stop",{entity_id:e})}async volumeUpMedia(e){return await this.callService("media_player","volume_up",{entity_id:e})}async volumeDownMedia(e){return await this.callService("media_player","volume_down",{entity_id:e})}async muteMedia(e){return await this.callService("media_player","volume_mute",{entity_id:e})}async setVolumeLevelMedia(e,a){return await this.callService("media_player","volume_set",{entity_id:e,volume_level:a})}async selectSourceMedia(e,a){return await this.callService("media_player","select_source",{entity_id:e,source:a})}async setClimateTemperature(e,a){return await this.callService("climate","set_temperature",{entity_id:e,temperature:a})}async setClimateOperation(e,a){return await this.callService("climate","set_hvac_mode",{entity_id:e,hvac_mode:a})}async setClimatePreset(e,a){let d=a;return a==="None"&&(d=null),await this.callService("climate","set_preset_mode",{entity_id:e,preset_mode:d})}async getStates(e){let a=await this.fetch("states");if(e){let d=a;return e.domain&&(d=a.filter(t=>t.entity_id.startsWith(e.domain))),e.query&&(d=d.filter(t=>t.entity_id.toLowerCase().includes(e.query.toLowerCase())||(t.attributes.friendly_name.toLowerCase()||"").includes(e.query.toLowerCase()))),d}return a}};var q6=va(),j6="auth_required",H6="auth_invalid",z6="auth_ok";function wa(p,e){let a=p.wsUrl;console.log("[Auth phase] Initializing WebSocket connection to Home Assistant",a);function d(t,i,s){console.log(`[Auth Phase] Connecting to Home Assistant... Tries left: ${t}`,a);let m=new q6(a,{rejectUnauthorized:!e}),l=!1,r=c=>{let w;c&&c.code&&c.code!==1e3&&(w=`WebSocket connection to Home Assistant closed with code ${c.code} and reason ${c.reason}`),u(w)},n=c=>{m.removeEventListener("close",r);let w="Disconnected from Home Assistant with a WebSocket error";c.message&&(w+=` with message: ${c.message}`),u(w)},u=c=>{if(c&&console.log(`WebSocket Connection to Home Assistant closed with an error: ${c}`),l){let S=new Error("Authentication failed.");S.name="AuthError",s(S);return}if(t===0){let S=new Error(`Connection to "${a}" failed.`);S.name="ConnectionError",s(S);return}let w=t===-1?-1:t-1;setTimeout(()=>d(w,i,s),1e3)},_=async()=>{try{p.expired&&await p.refreshAccessToken(),m.send(JSON.stringify({type:"auth",access_token:p.accessToken}))}catch(c){l=c===Z,m.close()}},f=c=>{let w=JSON.parse(c.data);switch(console.log(`[Auth phase] Received a message of type ${w.type}`,w),w.type){case H6:l=!0,m.close();break;case z6:m.removeEventListener("open",_),m.removeEventListener("message",f),m.removeEventListener("close",r),m.removeEventListener("error",n),i(m);break;default:w.type!==j6&&console.log("[Auth phase] Unhandled message",w)}};m.addEventListener("open",_),m.addEventListener("message",f),m.addEventListener("close",r),m.addEventListener("error",n)}return new Promise((t,i)=>d(3,t,i))}function W6(){let p=T1.preferences.instance?.value,e=T1.preferences.token?.value;return new $e(p,e)}var ye;async function _a(){if(ye)return console.log("return existing ws con"),ye;{console.log("create new home assistant ws con");let p=T1.preferences.instance?.value,e=T1.preferences.token?.value,a=T1.preferences.ignorecerts.value||!1,d=fp(p,e);return ye=await gp({auth:d,createSocket:async()=>wa(d,a)}),ye}}function ga(){return T1.preferences.instance?.value||!1}var g=W6();var h1=$(require("react"));function ya(){let[p,e]=(0,h1.useState)(),[a,d]=(0,h1.useState)(),[t,i]=(0,h1.useState)(!1),s=(0,h1.useRef)();return(0,h1.useEffect)(()=>{let m=!1;async function l(){if(!m){i(!0),d(void 0);try{if(s.current)await De(s.current).refresh();else{let r=await _a();_p(r,n=>{console.log("incoming entities changes");let u=Object.entries(n).map(([_,f])=>f);m||(console.log("set new entities"),e(u)),i(!1)}),s.current=r}}catch(r){if(!m){let n=r instanceof Error?r:new Error(r);d(n)}}}}return l(),()=>{m=!0}},[]),{states:p,error:a,isLoading:t}}var L=$(require("@raycast/api"));var v1=$(require("@raycast/api"));function Sa(p){let e=p.state,a=e.attributes.friendly_name?`${e.attributes.friendly_name} (${e.entity_id})`:`${e.entity_id}`;return _jsx(v1.List,{searchBarPlaceholder:"Search entity attributes"},_jsx(v1.List.Section,{title:`Attributes of ${a}`},Object.entries(e.attributes).map(([d,t])=>_jsx(v1.List.Item,{key:e.entity_id+d,title:d,accessoryTitle:`${t}`,actions:_jsx(v1.ActionPanel,null,_jsx(v1.CopyToClipboardAction,{content:`${t}`}))}))))}function k1(p){let e=g.urlJoin(`history?entity_id=${p.state.entity_id}`);return _jsx(L.OpenInBrowserAction,{title:"Open History in Browser",icon:{source:L.Icon.Text,tintColor:L.Color.PrimaryText},url:e,shortcut:{modifiers:["cmd"],key:"h"}})}function pe(p){let e=g.urlJoin(`logbook?entity_id=${p.state.entity_id}`);return _jsx(L.OpenInBrowserAction,{title:"Open Logbook in Browser",icon:{source:L.Icon.Text,tintColor:L.Color.PrimaryText},url:e,shortcut:{modifiers:["cmd","opt"],key:"l"}})}function R1(p){return p.state.attributes?_jsx(L.PushAction,{title:"Show Attributes",target:_jsx(Sa,{state:p.state}),shortcut:{modifiers:["cmd","shift"],key:"a"},icon:{source:L.Icon.List,tintColor:L.Color.PrimaryText}}):null}function B1(p){return _jsx(L.CopyToClipboardAction,{title:"Copy State Value",content:p.state.state,shortcut:{modifiers:["cmd","shift"],key:"v"}})}function U1(p){return _jsx(L.CopyToClipboardAction,{title:"Copy Entity ID",content:p.state.entity_id,shortcut:{modifiers:["cmd","shift"],key:"e"}})}var B=$(require("@raycast/api"));function dp(p){let e=p.attributes.media_title,a=p.attributes.media_artist;if(e&&a)return`${a} - ${e}`}function ba(p){let e=p.state,a=e.attributes.source_list,d=async s=>{s&&await g.selectSourceMedia(e.entity_id,s)},t=e.attributes.source,i=t?`Select Source (${t})`:"Select Source";return a&&Array.isArray(a)?(t&&(a=a?.filter(s=>s!==t)),_jsx(B.ActionPanel.Submenu,{title:i,icon:{source:B.Icon.TextDocument,tintColor:B.Color.PrimaryText},shortcut:{modifiers:["cmd","shift"],key:"s"}},a.map(s=>_jsx(B.ActionPanel.Item,{key:`${s}`,title:`${s}`,onAction:()=>d(`${s}`)})))):null}function Na(p){let e=p.state,a=async s=>{await g.setVolumeLevelMedia(e.entity_id,s)},d=e.attributes.volume_level,t=Array(100).fill(void 0).map((s,m)=>m+1),i=d?`Select Volume (${Math.round(d*100)}%)`:"Select Volume";return t&&Array.isArray(t)?_jsx(B.ActionPanel.Submenu,{title:i,icon:{source:B.Icon.Circle,tintColor:B.Color.PrimaryText},shortcut:{modifiers:["cmd","opt"],key:"v"}},t.map(s=>_jsx(B.ActionPanel.Item,{key:`${s}`,title:`${s}%`,onAction:()=>a(s/100)}))):null}function Ta(p){let e=p.state,a=dp(e);return a?_jsx(B.CopyToClipboardAction,{title:"Copy Track",content:a,shortcut:{modifiers:["cmd","shift"],key:"t"}}):null}var ae=$(require("@raycast/api"));function G6(){let p=[];for(let e=100;e>=0;e=e-10)p.push(e);return p}function Da(p){let e=p.state,a=e.attributes.supported_color_modes,d=async t=>{await g.callService("light","turn_on",{entity_id:e.entity_id,brightness_pct:`${t}`})};if(a&&Array.isArray(a)&&a.includes("brightness")){let t=G6();return _jsx(ae.ActionPanel.Submenu,{title:"Brightness",icon:{source:"lightbulb.png",tintColor:ae.Color.PrimaryText},shortcut:{modifiers:["cmd"],key:"b"}},t.map(i=>_jsx(ae.ActionPanel.Item,{key:`${i}`,title:`${i} %`,onAction:()=>d(i)})))}return null}var Y=o.Color.Blue,J6={on:o.Color.Yellow,off:o.Color.Blue},Va={opening:"cover-up.png",closing:"cover-down.png",open:"cover-open.png",closed:"cover-close.png"},Y6={temperature:"temperature.png",power:"power.png",update:"update.png",connectivity:"connectivity.png",carbon_dioxide:"carbon-dioxide.png",pressure:"pressure.png",humidity:"humidity.png"},X6=["battery-00.png","battery-10.png","battery-20.png","battery-30.png","battery-40.png","battery-50.png","battery-60.png","battery-70.png","battery-80.png","battery-90.png","battery-100.png"];function Z6(p){if(p.attributes.device_class){let e=p.attributes.device_class;if(e==="battery"){let d=parseFloat(p.state),t="battery-100.png";if(!isNaN(d)){let s=Math.floor(d/10),m=X6[s];m&&(t=m)}let i=Y;return d<=20?i=o.Color.Red:d<=30&&(i=o.Color.Yellow),{source:t,tintColor:i}}return{source:Y6[e]||"entity.png",tintColor:Y}}else return}function K6(p){let e=p.entity_id,a=p.attributes;if(e.startsWith("light")){let d=p.state.toLocaleLowerCase(),t=d==="unavailable"?"#bdbdbd":J6[d]||Y;return{source:a.icon&&a.icon==="mdi:lightbulb-group"?"lightbulb-group.png":"lightbulb.png",tintColor:t}}else{if(e.startsWith("person"))return{source:"person.png",tintColor:Y};if(e.startsWith("cover"))return{source:Va[`${p.state}`]||Va.open,tintColor:Y};if(e.startsWith("automation"))return{source:"automation.png",tintColor:Y};if(e.startsWith("climate"))return{source:"climate.png",tintColor:Y};if(e.startsWith("media_player"))return{source:"mediaplayer.png",tintColor:Y};if(e==="sun.sun")return{source:p.state.toLocaleLowerCase()==="below_horizon"?"weather-night.png":"white-balance-sunny.png",tintColor:Y};{let d=Z6(p);return d||{source:"entity.png",tintColor:Y}}}}function Ea(p){let[e,a]=(0,I1.useState)(),{states:d,error:t,isLoading:i}=ya(),{states:s}=p4(e,p.domain,void 0,d);return t&&(0,o.showToast)(o.ToastStyle.Failure,"Cannot search Home Assistant states.",t.message),s?_jsx(o.List,{searchBarPlaceholder:"Filter by name or ID...",isLoading:i,onSearchTextChange:a},s?.map(m=>_jsx(Q6,{key:m.entity_id,state:m}))):_jsx(o.List,{isLoading:!0,searchBarPlaceholder:"Loading"})}function Q6(p){let e=p.state,a=s=>{try{let m=s.entity_id;if(m.startsWith("cover")&&"current_position"in s.attributes){let l=s.attributes.current_position;if(l>0&&l<100)return`${l}% | `}else if(m.startsWith("climate")&&"current_temperature"in s.attributes)return`${s.attributes.current_temperature} | `}catch{}return""},d=s=>{if(s.entity_id.startsWith("light")&&s.state==="on"){let m=s.attributes.brightness||void 0;if(m!==void 0){let l=parseInt(m);if(!isNaN(l)){let r=l/255*100;return`${Math.round(r)}%`}}}else if(s.entity_id.startsWith("sensor")){let m=s.attributes.unit_of_measurement||void 0,l=s.state?.toLocaleLowerCase();if(m&&l&&l!=="unknown"&&l!=="unavailable")return`${s.state} ${m}`}else if(s.entity_id.startsWith("media_player")){let m=s.attributes.volume_level;if(m&&typeof m=="number"&&!Number.isNaN(m))return`\u{1F509} ${Math.round(m*100)}% | ${s.state}`}return s.state},t,i=s=>{let m;if(s.entity_id.startsWith("media_player")){let l=[],r=dp(s);r&&l.push(r);let n=s.attributes.media_channel;n&&l.push(n),m=l.join(" | ");let u=s.attributes.entity_picture;u&&(t=g.urlJoin(u))}return ga()?m:m?`${s.entity_id} | ${m}`:s.entity_id};return _jsx(o.List.Item,{key:e.entity_id,title:e.attributes.friendly_name||e.entity_id,subtitle:i(e),accessoryTitle:a(e)+d(e),actions:_jsx(e4,{state:e}),icon:t||K6(e)})}function e4(p){let e=p.state,a=p.state.entity_id.split(".")[0],d=p.state.entity_id;switch(a){case"cover":return _jsx(o.ActionPanel,null,_jsx(o.ActionPanel.Section,{title:"Controls"},_jsx(o.ActionPanel.Item,{title:"Toggle",onAction:async()=>await g.toggleCover(p.state.entity_id),icon:{source:"toggle.png",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Open",shortcut:{modifiers:["cmd"],key:"o"},onAction:async()=>await g.openCover(p.state.entity_id),icon:{source:o.Icon.ChevronUp,tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Close",shortcut:{modifiers:["cmd","shift"],key:"c"},onAction:async()=>await g.closeCover(p.state.entity_id),icon:{source:o.Icon.ChevronDown,tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Stop",shortcut:{modifiers:["cmd"],key:"s"},onAction:async()=>await g.stopCover(p.state.entity_id),icon:{source:o.Icon.XmarkCircle,tintColor:o.Color.PrimaryText}})),_jsx(o.ActionPanel.Section,{title:"Attribtues"},_jsx(R1,{state:e})),_jsx(o.ActionPanel.Section,{title:"Values"},_jsx(U1,{state:e}),_jsx(B1,{state:e})),_jsx(o.ActionPanel.Section,{title:"History"},_jsx(k1,{state:e}),_jsx(pe,{state:e})));case"light":return _jsx(o.ActionPanel,null,_jsx(o.ActionPanel.Section,{title:"Controls"},_jsx(o.ActionPanel.Item,{title:"Toggle",onAction:async()=>await g.toggleLight(p.state.entity_id),icon:{source:"toggle.png",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Turn On",shortcut:{modifiers:["cmd"],key:"o"},onAction:async()=>await g.turnOnLight(p.state.entity_id),icon:{source:"power-btn.png",tintColor:o.Color.Green}}),_jsx(o.ActionPanel.Item,{title:"Turn Off",shortcut:{modifiers:["cmd"],key:"f"},onAction:async()=>await g.turnOffLight(p.state.entity_id),icon:{source:"power-btn.png",tintColor:o.Color.Red}}),_jsx(Da,{state:e})),_jsx(o.ActionPanel.Section,{title:"Attributes"},_jsx(R1,{state:p.state})),_jsx(o.ActionPanel.Section,{title:"Values"},_jsx(U1,{state:e}),_jsx(B1,{state:e})),_jsx(o.ActionPanel.Section,{title:"History"},_jsx(k1,{state:e}),_jsx(pe,{state:e})));case"media_player":return _jsx(o.ActionPanel,null,_jsx(o.ActionPanel.Section,{title:"Controls"},_jsx(o.ActionPanel.Item,{title:"Play/Pause",onAction:async()=>await g.playPauseMedia(d),icon:{source:"play-pause.jpg",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Play",onAction:async()=>await g.playMedia(d),icon:{source:"play.png",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Pause",shortcut:{modifiers:["cmd"],key:"p"},onAction:async()=>await g.pauseMedia(d),icon:{source:"pause.png",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Stop",shortcut:{modifiers:["cmd"],key:"s"},onAction:async()=>await g.stopMedia(d),icon:{source:o.Icon.XmarkCircle,tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Next",shortcut:{modifiers:["cmd"],key:"arrowRight"},onAction:async()=>await g.nextMedia(d),icon:{source:"next.png",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Previous",shortcut:{modifiers:["cmd"],key:"arrowLeft"},onAction:async()=>await g.previousMedia(d),icon:{source:"previous.png",tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Volume Up",shortcut:{modifiers:["cmd"],key:"+"},onAction:async()=>await g.volumeUpMedia(d),icon:{source:o.Icon.SpeakerArrowUp,tintColor:o.Color.PrimaryText}}),_jsx(o.ActionPanel.Item,{title:"Volume Down",shortcut:{modifiers:["cmd"],key:"-"},onAction:async()=>await g.volumeDownMedia(d),icon:{source:o.Icon.SpeakerArrowDown,tintColor:o.Color.PrimaryText}}),_jsx(Na,{state:e}),_jsx(o.ActionPanel.Item,{title:"Mute",shortcut:{modifiers:["cmd"],key:"m"},onAction:async()=>await g.muteMedia(d),icon:{source:o.Icon.SpeakerSlash,tintColor:o.Color.PrimaryText}}),_jsx(ba,{state:e})),_jsx(o.ActionPanel.Section,{title:"Attributes"},_jsx(R1,{state:e})),_jsx(o.ActionPanel.Section,{title:"Values"},_jsx(U1,{state:e}),_jsx(B1,{state:e}),_jsx(Ta,{state:e})),_jsx(o.ActionPanel.Section,{title:"History"},_jsx(k1,{state:e}),_jsx(pe,{state:e})));case"climate":{let t=e.state==="heat"||e.state==="cool"||e.state==="heat_cool"||e.state=="auto",i=e.attributes.temperature||void 0,[s,m]=(0,I1.useState)(i),l=s?s+.5:void 0,r=s?s-.5:void 0,n=[];for(let f=26;f>16;f--)n.push(f);let u=e.attributes.preset_mode?e.attributes.preset_mode:"None",_=e.attributes.preset_modes;return _jsx(o.ActionPanel,null,_jsx(o.ActionPanel.Section,{title:"Controls"},t&&_jsx(o.ActionPanel.Submenu,{title:`Temperature (${s||"?"})`,shortcut:{modifiers:["cmd"],key:"t"},icon:{source:"temperature.png",tintColor:o.Color.PrimaryText}},n.map(f=>_jsx(o.ActionPanel.Item,{key:f.toString(),title:f.toString(),onAction:async()=>{await g.setClimateTemperature(d,f),m(f)}}))),e.attributes.hvac_modes&&_jsx(o.ActionPanel.Submenu,{title:`Operation (${e.state})`,shortcut:{modifiers:["cmd"],key:"o"},icon:{source:o.Icon.Gear,tintColor:o.Color.PrimaryText}},e.attributes.hvac_modes?.map(f=>_jsx(o.ActionPanel.Item,{key:f,title:f,onAction:async()=>{await g.setClimateOperation(d,f),(0,o.popToRoot)()}}))),_&&_jsx(o.ActionPanel.Submenu,{title:`Preset (${u})`,shortcut:{modifiers:["cmd"],key:"p"},icon:{source:o.Icon.List,tintColor:o.Color.PrimaryText}},_?.map(f=>_jsx(o.ActionPanel.Item,{key:f,title:f,onAction:async()=>{await g.setClimatePreset(d,f),(0,o.popToRoot)()}}))),l&&t&&_jsx(o.ActionPanel.Item,{title:"Increase Temp. 0.5",shortcut:{modifiers:["cmd"],key:"+"},onAction:async()=>{await g.setClimateTemperature(d,l),m(l)},icon:{source:"plus.png",tintColor:o.Color.PrimaryText}}),r&&t&&_jsx(o.ActionPanel.Item,{title:"Decrease Temp. 0.5",shortcut:{modifiers:["cmd"],key:"-"},onAction:async()=>{await g.setClimateTemperature(d,r),m(r)},icon:{source:"minus.png",tintColor:o.Color.PrimaryText}})),_jsx(o.ActionPanel.Section,{title:"Attributes"},_jsx(R1,{state:p.state})),_jsx(o.ActionPanel.Section,{title:"Values"},_jsx(U1,{state:e}),_jsx(B1,{state:e})),_jsx(o.ActionPanel.Section,{title:"History"},_jsx(k1,{state:e})))}default:return _jsx(o.ActionPanel,null,_jsx(o.ActionPanel.Section,{title:"Attributes"},_jsx(R1,{state:p.state})),_jsx(o.ActionPanel.Section,{title:"Values"},_jsx(U1,{state:e}),_jsx(B1,{state:e})),_jsx(o.ActionPanel.Section,{title:"History"},_jsx(k1,{state:e}),_jsx(pe,{state:e})))}}function p4(p,e,a,d){let[t,i]=(0,I1.useState)();return(0,I1.useEffect)(()=>{if(d){let s=d;e&&(s=s.filter(m=>m.entity_id.startsWith(e))),a&&(s=s.filter(m=>m.attributes.device_class===a)),p&&(s=s.filter(m=>m.entity_id.toLowerCase().includes(p.toLowerCase())||(m.attributes.friendly_name.toLowerCase()||"").includes(p.toLowerCase()))),s=s.slice(0,100),i(s)}else i([])},[p,d]),{states:t}}function xa(){return _jsx(Ea,{domain:""})}0&&(module.exports={});
8:
---

    at xa
    at ray-navigation-stack
nm:index.js:24:10558
al:index.js:24:10663
Is:index.js:24:9779
QO:index.js:24:8740
    at ray-root
Ef:index.js:24:10083

Raycast version
Version: 1.26.1

@sebr I will check that. I think your assumption with the friendly_name is right. I also need to find some times to check that :smile:.

@sebr Please let me know if your issue is now gone. Start the Store command before to make sure that you have the latest version.

Looks good now thanks!

repo: raycast/extensions


text:
[Confluence] Support Self-Hosted Confluence

Extension
https://www.raycast.com/tbrown/confluence
Description
Hello, I would like to use a self hosted instance of Confluence, using a custom domain and access token.
This setup would be similar to the functionality provided by a self-hosted Jira Search.
https://www.raycast.com/emanguy/jira-search-self-hosted
Who will benefit from this feature?
Large enterprises and organizations that use self-hosted Confluence.
Anything else?
No response

bringing it back to life!!

source: gharchive/issue

license: MIT

license_type: permissive

license_source: github-api


text:
Add "roam research" extension

Description
The plugin add roam research to search, view, quick note in daily notes.

Screencast

to use this plugin, you should have a roam research account and followed this https://roamresearch.com/#/app/developer-documentation/page/9XG0nfsah to get the backend token.
https://user-images.githubusercontent.com/23192045/215303868-114253c7-356f-4318-8556-749fe0c1fdbc.mp4
Checklist

[x] I read the extension guidelines
[x] I read the documentation about publishing
[x] I ran npm run build and tested this distribution build in Raycast
[x] I checked that files in the assets folder are used by the extension itself
[x] I checked that assets used by the README are placed outside of the metadata folder

This is approved when you add a CHANGELOG.md and some metadata images

Could you please use the built-in function to take the screenshots? It seems like the size is not right 😊

Could you please use the built-in function to take the screenshots? It seems like the size is not right 😊

YES, All the screenshots have been updated.

Hi! Love the idea.
First of all - the installation instructions aren't in the README. It took me a while to find them here.
Also, the "add graph" doesn't seem to be working for me? I took the name of the my graph, plus the token from https://relemma-git-feat-frontdesk.roamresearch.com/. It doesn't add - it just looks like this:

source: gharchive/pull-request

authors: dive2Pro pernielsentikaer ymshulman


text:
Update vuejobs extension

Description

Refactor List Sections, Add Icons and Enhance Package Info
In this pull request, we've introduced several changes:

Restructured Job Listings: Divided the list of items into three sections - 'Today', 'Yesterday', and 'Earlier' for improved readability and understanding of job post timings.

Added Icons: Introduced a 🔥 icon for the jobs posted either today or yesterday. This visually highlights the newest opportunities to the users.

Removed Unused Assets: Cleaned up the codebase by removing unused assets, reducing unnecessary load and maintaining a neat project structure.

Package Information Enhancements: Updated package information including package description, author info, versioning, and other relevant data for better understanding of the project.

The primary aim of these changes is to continually enhance user experience and uphold code efficiency.
Screencast

Checklist

[x] I read the extension guidelines
[x] I read the documentation about publishing
[x] I ran npm run build and tested this distribution build in Raycast
[x] I checked that files in the assets folder are used by the extension itself
[x] I checked that assets used by the README are placed outside of the metadata folder

There are no changed files in this PR @abusiraj84 🙂

very weird! let me check it


text:
Update Origin in README.md

Add Lenny`s fascinating Apache Solr skills to the origin story.

This guy must be a genius

*an Apache Solr genius 😉

authors: lennartp92 raynigon smonusbonus

repo: raynigon/lennybot


text:
Add LoadModelEx and UploadModel functions

To enable custom model and mesh batching in projects that use the official raylib and instancing, it is essential to have control over whether or not meshes are automatically uploaded to the GPU. In my opinion, this is the cleanest solution for achieving that flexibility.
New functions added:
// Load model from files (mesh and material) without automatically uploading vertex data to the GPU
Model LoadModelEx(const char *fileName, bool upload)
// Upload model data to the GPU (RAM and/or VRAM)
void UploadModel(const Model *model, bool dynamic)
The existing LoadModel function now calls LoadModelEx with upload = true.
Additionally, fixed LoadOBJ to match the behavior of other load functions by not automatically uploading meshes.

@devdad I'm afraid I don't like this approach, I try to avoid functions with that kind of bool flags.

@raysan5 ok np, but do you have some better suggestion, what we have now it is clearly not good too, because it force meshes to be uploaded straight away and to do work around is so hard because we can't call static LoadOBJ and other similar functions.

license: Zlib


text:
博文侧边栏 TOC 链接失效

测试网站 http://tommyjiang.github.io
所有博文的侧边栏 TOC 链接均失效，Chrome 调试显示链接内容均为href=#undefined。
请教如何解决，谢谢。

这情况有点诡异。。我也没遇过。。。你看看Hexo和Node的版本是多少，试试更新Hexo。。。

Hexo 版本号如下：
hexo: 3.2.2
hexo-cli: 1.0.2
os: Darwin 15.6.0 darwin x64
http_parser: 2.7.0
node: 6.3.0
v8: 5.0.71.52
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2h

Node版本号是v6.3.0。都已经是最新版了……

能否发一份带目录的文章（.md）文件，如大鱼海棠那一篇，到我的邮箱 raytaylorlin@gmail.com，我想本地看看具体是什么问题。。。

好的，发您邮箱了。

我这边拿你的文件本地测试没有问题，我的环境是
hexo: 3.2.2
hexo-cli: 1.0.1
http_parser: 2.6.1
node: 5.6.0

我也不清楚问题所在。node和http_parser比你低一些，不知道有没有影响。建议你hexo clean再hexo --debug server重新生成并看看在点进页面的时候，hexo控制台有没有报什么错。。。说不定重新生成一下就好了=。=

我刚更新 node 6.3.1 后又试了下 hexo server --debug，结果如下：
02:12:52.595 DEBUG Hexo version: 3.2.2
02:12:52.597 DEBUG Working directory: ~/Documents/Hexo/
02:12:52.665 DEBUG Config loaded: ~/Documents/Hexo/_config.yml
02:12:52.681 DEBUG Plugin loaded: hexo-deployer-git
02:12:52.683 DEBUG Plugin loaded: hexo-generator-archive
02:12:52.684 DEBUG Plugin loaded: hexo-generator-category
02:12:52.685 DEBUG Plugin loaded: hexo-generator-index
02:12:52.688 DEBUG Plugin loaded: hexo-generator-search
02:12:52.689 DEBUG Plugin loaded: hexo-generator-tag
02:12:52.690 DEBUG Plugin loaded: hexo-renderer-ejs
02:12:52.690 DEBUG Plugin loaded: hexo-renderer-markdown-it
02:12:52.691 DEBUG Plugin loaded: hexo-renderer-stylus
02:12:52.740 DEBUG Plugin loaded: hexo-server
02:12:52.746 DEBUG Plugin loaded: hexo-tag-echarts
02:12:52.754 DEBUG Loading database.
02:12:52.760 INFO  Start processing
02:12:52.847 DEBUG Processed: source/favicon.png
02:12:52.847 DEBUG Processed: source/weixin_favicon.png
02:12:52.880 DEBUG Theme config loaded.
02:12:52.881 DEBUG Processed: _config.yml
02:12:52.892 DEBUG Processed: source/css/style.styl
02:12:52.892 DEBUG Processed: source/js/prettify.js
02:12:52.921 DEBUG Processed: about/index.md
02:12:52.927 DEBUG Processed: categories/index.md
02:12:52.927 DEBUG Processed: _data/about.json
02:12:52.932 DEBUG Processed: _data/.DS_Store
02:12:52.932 DEBUG Processed: source/js/jquery.min.js
02:12:52.934 DEBUG Processed: _data/link.json
02:12:52.935 DEBUG Processed: _data/reading.json
02:12:52.942 DEBUG Processed: _drafts/2016-03-27-echarts-map.md
02:12:52.945 DEBUG Processed: _posts/2015-07-09-graduation-party.md
02:12:52.949 DEBUG Processed: _posts/2015-08-10-Simulink-m-file.md
02:12:52.949 DEBUG Processed: _posts/2015-10-01-jing-jin-tang-high-speed-railway.md
02:12:52.950 DEBUG Processed: _posts/2015-12-28-Trip-2015.md
02:12:52.952 DEBUG Processed: _posts/2016-03-16-migrate-to-hexo.md
02:12:52.954 DEBUG Processed: _posts/2016-03-17-Power-system-research.md
02:12:52.955 DEBUG Processed: _posts/2016-07-10-2016-07-10-bigfish-begonia-md.md
02:12:52.955 DEBUG Processed: _posts/2016-07-19-MATLAB-plot-color.md
02:12:52.983 DEBUG Processed: layout/about.ejs
02:12:52.983 DEBUG Processed: layout/archive.ejs
02:12:52.983 DEBUG Processed: layout/index.ejs
02:12:52.983 DEBUG Processed: layout/layout.ejs
02:12:52.983 DEBUG Processed: layout/page.ejs
02:12:52.983 DEBUG Processed: layout/post.ejs
02:12:52.983 DEBUG Processed: layout/tag.ejs
02:12:52.984 DEBUG Processed: layout/reading.ejs
02:12:52.987 DEBUG Processed: reading/index.md
02:12:52.987 DEBUG Processed: languages/default.yml
02:12:52.987 DEBUG Processed: languages/zh-CN.yml
02:12:52.987 DEBUG Processed: languages/zh-TW.yml
02:12:52.987 DEBUG Processed: tags/index.md
02:12:52.995 DEBUG Processed: source/css/images/side-user-cover.jpg
02:12:52.996 DEBUG Processed: source/css/lib/font-awesome.min.css
02:12:52.996 DEBUG Processed: source/css/lib/prettify-tomorrow-night-eighties.css
02:12:52.997 DEBUG Processed: source/js/materialize.min.js
02:12:52.997 DEBUG Processed: about/小猫.jpg
02:12:53.002 DEBUG Processed: uploads/Cat.jpg
02:12:53.002 DEBUG Processed: source/css/lib/materialize.min.css
02:12:53.017 DEBUG Processed: layout/_widget/category.ejs
02:12:53.017 DEBUG Processed: layout/_widget/blogroll.ejs
02:12:53.017 DEBUG Processed: layout/_widget/recent_posts.ejs
02:12:53.017 DEBUG Processed: layout/_widget/tag.ejs
02:12:53.017 DEBUG Processed: layout/_widget/tagcloud.ejs
02:12:53.017 DEBUG Processed: layout/_partial/after_footer.ejs
02:12:53.017 DEBUG Processed: layout/_partial/archive.ejs
02:12:53.017 DEBUG Processed: layout/_partial/article.ejs
02:12:53.017 DEBUG Processed: layout/_partial/archive_title.ejs
02:12:53.017 DEBUG Processed: layout/_partial/construction.ejs
02:12:53.017 DEBUG Processed: layout/_partial/feature_guide.ejs
02:12:53.017 DEBUG Processed: layout/_partial/float.ejs
02:12:53.017 DEBUG Processed: layout/_partial/footer.ejs
02:12:53.017 DEBUG Processed: layout/_partial/head.ejs
02:12:53.017 DEBUG Processed: layout/_partial/pagenav.ejs
02:12:53.017 DEBUG Processed: layout/_partial/header.ejs
02:12:53.017 DEBUG Processed: layout/_partial/menu_drawer.ejs
02:12:53.017 DEBUG Processed: layout/_partial/pagination.ejs
02:12:53.017 DEBUG Processed: layout/_partial/search.ejs
02:12:53.017 DEBUG Processed: layout/_partial/side_nav.ejs
02:12:53.017 DEBUG Processed: layout/_partial/simple_article.ejs
02:12:53.017 DEBUG Processed: layout/_partial/slider.ejs
02:12:53.019 DEBUG Processed: source/css/font/roboto/Roboto-Bold.eot
02:12:53.019 DEBUG Processed: source/css/font/roboto/Roboto-Light.eot
02:12:53.019 DEBUG Processed: source/css/font/roboto/Roboto-Bold.woff
02:12:53.020 DEBUG Processed: source/css/font/roboto/Roboto-Bold.woff2
02:12:53.020 DEBUG Processed: source/css/font/roboto/Roboto-Light.woff
02:12:53.020 DEBUG Processed: source/css/font/roboto/Roboto-Light.woff2
02:12:53.020 DEBUG Processed: source/css/font/roboto/Roboto-Medium.eot
02:12:53.021 DEBUG Processed: source/css/font/roboto/Roboto-Medium.woff
02:12:53.021 DEBUG Processed: source/css/font/roboto/Roboto-Regular.eot
02:12:53.021 DEBUG Processed: source/css/font/roboto/Roboto-Medium.woff2
02:12:53.022 DEBUG Processed: source/css/font/roboto/Roboto-Regular.woff
02:12:53.022 DEBUG Processed: source/css/font/roboto/Roboto-Regular.woff2
02:12:53.022 DEBUG Processed: images/2015-Graduation-Party.png
02:12:53.024 DEBUG Processed: source/css/font/font-awesome/FontAwesome.otf
02:12:53.025 DEBUG Processed: source/css/font/font-awesome/fontawesome-webfont.eot
02:12:53.026 DEBUG Processed: source/css/font/font-awesome/fontawesome-webfont.woff
02:12:53.026 DEBUG Processed: source/css/font/font-awesome/fontawesome-webfont.woff2
02:12:53.026 DEBUG Processed: source/css/font/roboto/Roboto-Bold.ttf
02:12:53.027 DEBUG Processed: source/css/font/roboto/Roboto-Light.ttf
02:12:53.027 DEBUG Processed: source/css/font/roboto/Roboto-Medium.ttf
02:12:53.027 DEBUG Processed: source/css/font/roboto/Roboto-Regular.ttf
02:12:53.033 DEBUG Processed: layout/_partial/plugin/analytics.ejs
02:12:53.033 DEBUG Processed: layout/_partial/plugin/comment.ejs
02:12:53.033 DEBUG Processed: layout/_partial/plugin/google_code_prettify.ejs
02:12:53.033 DEBUG Processed: layout/_partial/plugin/mathjax.ejs
02:12:53.033 DEBUG Processed: layout/_partial/plugin/main_javascript.ejs
02:12:53.033 DEBUG Processed: layout/_partial/plugin/noscript.ejs
02:12:53.033 DEBUG Processed: layout/_partial/plugin/reward.ejs
02:12:53.033 DEBUG Processed: layout/_partial/post/category.ejs
02:12:53.033 DEBUG Processed: layout/_partial/post/gallery.ejs
02:12:53.033 DEBUG Processed: layout/_partial/post/tablecontents.ejs
02:12:53.033 DEBUG Processed: layout/_partial/post/tag.ejs
02:12:53.033 DEBUG Processed: layout/_partial/post/time.ejs
02:12:53.033 DEBUG Processed: layout/_partial/post/title.ejs
02:12:53.034 DEBUG Processed: source/css/font/font-awesome/fontawesome-webfont.ttf
02:12:53.035 DEBUG Processed: source/css/font/font-awesome/fontawesome-webfont.svg
02:12:53.040 DEBUG Processed: images/Tianjin-railway-station.jpg
02:12:53.324 DEBUG Generator: page
02:12:53.324 DEBUG Generator: post
02:12:53.324 DEBUG Generator: archive
02:12:53.324 DEBUG Generator: category
02:12:53.324 DEBUG Generator: index
02:12:53.324 DEBUG Generator: search
02:12:53.324 DEBUG Generator: tag
02:12:53.328 DEBUG Generator: asset
02:12:53.335 INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
02:12:53.349 DEBUG Database saved
02:12:57.472 DEBUG Rendering index: index.html
GET / 200 32.221 ms - -
GET /css/lib/font-awesome.min.css 200 390.082 ms - -
GET /css/style.css 200 390.000 ms - -
GET /css/lib/prettify-tomorrow-night-eighties.css 200 395.132 ms - -
GET /css/lib/materialize.min.css 200 396.719 ms - -
GET /js/jquery.min.js 200 1.151 ms - -
GET /js/prettify.js 200 1.259 ms - -
GET /weixin_favicon.png 200 0.515 ms - -
GET /js/materialize.min.js 200 3.313 ms - -
GET /about/%E5%B0%8F%E7%8C%AB.jpg 200 1.519 ms - -
GET /css/font/roboto/Roboto-Regular.woff2 200 0.822 ms - -
GET /css/font/font-awesome/fontawesome-webfont.woff2?v=4.5.0 200 0.681 ms - -
GET /css/font/roboto/Roboto-Medium.woff2 200 0.317 ms - -
GET /css/font/roboto/Roboto-Light.woff2 200 0.220 ms - -
GET /search.xml 200 0.424 ms - -
02:12:59.096 DEBUG Rendering post: 2016/07/10/2016-07-10-bigfish-begonia-md/index.html
GET /2016/07/10/2016-07-10-bigfish-begonia-md/ 200 17.526 ms - -
GET /css/lib/font-awesome.min.css 200 0.445 ms - -
GET /css/lib/materialize.min.css 200 1.496 ms - -
GET /css/style.css 200 87.971 ms - -
GET /css/lib/prettify-tomorrow-night-eighties.css 200 93.401 ms - -
GET /js/jquery.min.js 200 0.542 ms - -
GET /weixin_favicon.png 200 0.640 ms - -
GET /js/prettify.js 200 1.852 ms - -
GET /js/materialize.min.js 200 3.396 ms - -
GET /about/%E5%B0%8F%E7%8C%AB.jpg 200 1.571 ms - -
GET /css/font/roboto/Roboto-Regular.woff2 200 0.484 ms - -
GET /css/font/font-awesome/fontawesome-webfont.woff2?v=4.5.0 200 0.326 ms - -
GET /css/font/roboto/Roboto-Medium.woff2 200 0.305 ms - -
GET /css/font/roboto/Roboto-Light.woff2 200 0.227 ms - -
GET /search.xml 200 0.150 ms - -
GET /css/font/roboto/Roboto-Bold.woff2 200 0.456 ms - -

我换了个主题发现还有这问题，目录里的链接最后还是undefined……

找到原因了，是node中没装hexo-toc……
感谢作者的帮助。

authors: raytaylorlin tommyjiang

repo: raytaylorlin/hexo-theme-raytaylorism

license: mit

license_source: bigquery


text:
PR review speed

Category

[ ] Bug
[ ] Feature Request
[x] Question

Brief Intro
Idea about solving the speed of reviewing PR
More Details
It seems that currently reviewing PR speed is kind of slow. Want to create this issue to get some feedback about the speed of reviewing PR.

Here are some ideas how to solve it.

Add more reviewers
Get a plan for each week or each month. How many PRs need to be reviewed. We can rank the importance of PRs. Like fatal bug, new features, small issues, PR waiting time etc. Based on the rank to clean up PRs in the queue.

@kelvinlauKL @rwenderlich @vincentngo

@remlostime Thanks for bringing this up, you've brought up good points.
As the repo gets more popular, we'll be adding more reviewers. Traffic certainly has picked up lately. We generally plan for a couple of PRs per week per reviewer, but the Swift 4 migration created a backlog of things for us to take a look at.
I do acknowledge the need for a more speedy resolution to resolve the bucket of PRs though. Thanks again for the feedback, it's appreciated.

@kelvinlauKL Thanks for the reply. That helps.

authors: kelvinlauKL remlostime

repo: raywenderlich/swift-algorithm-club


text:
Openblt to STM Nucleo-64 - Rising Embedded Mx

https://razielgdn.github.io/risingembeddedmx/post/2024/04/15/star-with-openblt-project.html?
April-15-24Starting the Implementation of OpenBlt ProjectI am beginning work on implementing the OpenBLT project on a Nucleo 64 platform with an STM32-F446RE...

Testing comments for this site

repo: razielgdn/custom-application-test


text:
Performance of batch inserts

Hello,
I am looking to migrate from another SQL wrapper. However, for my app the speed is really important, as it downloads data from the internet, parses and writes to DB. And it turned out that when I refactored it (for safety) to use prepared statements instead of raw string concatenation, the performance dropped drastically.
So, any benchmarks maybe, or a word on how such implementation compares to "regular" ones?

Hi,
You did not give me a whole lot of data here, but let me try to answer with a few statements (sorry for stating the obvious in some places):

Line by line insert is usually pretty slow, but it depends on the actual database and the table definition, e.g. indexes, etc.
A single-use prepared statement is usually slower than a single direct execution.
Once prepared, the (repeated) use of a prepared statement is often faster than a direct execution. But if the prepared statement still is a single line insert, then the performance will likely be dominated by slow insert performance.
Batch inserts are a good compromise, in my view. The combine the ease of direct execution and (usually) higher performance. Obviously, the performance is dominated by the database itself.
Since sqlpp11 operates with expressions instead of string representations, it provides considerable type safety, and it takes care of escaping.

I understand that this is not exactly the information you asked for, but I hope it helps anyway?
Best,
Roland

I understand, I am still a newbie when it comes to databases (or maybe even programming in general lol).
Yes, in the beginning I was doing batch inserts by creating commands as raw strings (up to 100 rows at once, depending on the downloaded data). After rewriting the code to use prepared statement, even though it is reused all the time, it only sends rows one by one. So as you stated in the 3rd point, the problem with performance is probably caused by the overhead of a query.
I would use a batch prepared statement if the amount of data was not varying... But maybe I should implement some buffer... well, w/e.
From what I've seen in (at least a bit of) the code, I see that the queries are built by writing from expressions to a string stream? That's probably the slowest part, but I guess when your entire library is based on such principle, it is most likely already well optimized. It should be even possible to make it constexpr, though probably only partially...
Well, thanks for a clarification, and for extrapolating from incomplete data :)

I understand, I am still a newbie when it comes to databases (or maybe even programming in general lol).

Enjoy :-)

I would use a batch prepared statement if the amount of data was not varying... But maybe I should implement some buffer...

Maybe. I suggest to do experiments first, to see if that's really likely to solve anything.

I see that the queries are built by writing from expressions to a string stream? That's probably the slowest part

Within the library: yes.

but I guess when your entire library is based on such principle, it is most likely already well optimized.

Oh, I am sure this could be faster. This is not optimized at all.
OTOH, the library has been in use in the payments industry for almost a decade now, and afaict, performance of this library has never been an issue. And a colleague once told me that they actually did some comparison with a "regular" library (as you called it). sqlpp11 was considerably faster.
Thus, as above with the buffering: Yes, some performance improvements are certainly possible, but do measurements and experiments first.

It should be even possible to make it constexpr, though probably only partially...

Partially: Sure.
However, the whole stream is known at compile time. It should give the compiler a lot of room for optimization already.

Well, thanks for a clarification, and for extrapolating from incomplete data :)

Happy to.

Edit: Is it possible in this library to pass the values into prepared statement in a loop?

Parameters are essentially represented as a tuple, which is not ideal for iteration in a loop.
Multi-line inserts can be filled in a loop, though.

Yes, you're right about the compiler being able to optimize by itself.
And yes, I get it about the tuple, it's the same in the other library I'm using currently :)
Though it is nice it's possible with multiline inserts.
Alright, thank you for all the assistance. I think I can close now.


text:
RO-2864 Update master dependencies

This change is the result of running gating/update_dependencies/*
See update_dependencies in https://rpc-openstack.atlassian.net/wiki/spaces/RE/pages/19005457/RE+for+Projects for more details.
Issue: RO-2864

recheck_dep_update

recheck_dep_update

recheck_dep_update

recheck_dep_update

recheck_dep_update

recheck_dep_update

recheck_dep_update

recheck_release

recheck_release

recheck_release

recheck_release

recheck_release

recheck_release

recheck_release

repo: rcbops/rpc-openstack


text:
Arg and Config changes

I need to do the following:

[ ] Change notion of Args to be:
Value = Const(value)
|  Arg(string field)
|  Lambda([](Values genargs, Values configargs)->Expr)

[ ] Define VType (is there a better name? Should this actually be the same as Type?) This will be a container for bool,int,string, Type* meaning valid types to pass through to as configs.

[ ] Every Value has a static VType

[ ] Make sure that genargs are always Consts

[ ] Allow configparams to be a lambda when using a generator.

[ ] Determine how this affects setting default configs on generators.

This will allow me to actually be able to specify configs in terms of the container's configs.
This will also allow me to only require configs when needed.

@leonardt, just as a warning this will be a rather large change that I will probably need help with updating the C api as well as pycoreir

Fixed


text:
Showcase PR for unit tests and coverage

Refactoring of cache-related functions
TestCacheKey and TestMemcacheRegion unit tests
Code coverage of unit tests: https://app.codecov.io/github/rdimaio/rucio/tree/feature-7007-common/lib%2Frucio
New unit test workflow: https://github.com/rdimaio/rucio/actions/runs/10292105272

Welcome to Codecov :tada:
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.
Thanks for integrating Codecov - We've got you covered :open_umbrella:

Closing in favour of PR to main repository: https://github.com/rucio/rucio/issues/6545

authors: codecov-commenter rdimaio

repo: rdimaio/rucio


text:
Fix/with theme styles order refactor

Description
Adjustments to fix some inconsistencies with the style merge order according to these rules

References
JIRA TICKET
Testing
TBA

Test Execution Passed.

Test Execution Passed.

Test Execution Passed.

Test Execution Passed.

Test Execution Failed.

Test Execution Failed.

Test Execution Failed.

Test Execution Failed.

Test Execution Failed.

Test Execution Passed.

Test Execution Passed.

Test Execution Passed.

Test Execution Passed.

The componentConfig seems to work as expected with nested tones/modes, but that doesn't seem to be the case for in-line styles.
For example, this works:
window.CONTEXT.updateTheme({
  componentConfig: {
    Tile: {
      style: {
        mode: {
          focused: {
            radius: 100
          }
        }
      }
    }
  }
});

but this doesn't in Tile.stories.js:
{
  type: Tile,
  style: {
    mode: {
      focused: {
        radius: 100
      }
    }
  }
}

Test Execution Passed.

The componentConfig seems to work as expected with nested tones/modes, but that doesn't seem to be the case for in-line styles.
For example, this works:
window.CONTEXT.updateTheme({
  componentConfig: {
    Tile: {
      style: {
        mode: {
          focused: {
            radius: 100
          }
        }
      }
    }
  }
});

but this doesn't in Tile.stories.js:
{
  type: Tile,
  style: {
    mode: {
      focused: {
        radius: 100
      }
    }
  }
}

Fixed in most recent

Test Execution Failed.

:tada: This PR is included in version @lightningjs/ui-components-v2.15.1 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

repo: rdkcentral/Lightning-UI-Components


text:
RDK-39119: Implement LED control

Reason for change:
Implement LED control
Test Procedure: None
Risks: Low
Change-Id: If3e38f36b3f9ca5713bb6fd52db9eb140ab32c36 Signed-off-by:Anooj Cheriyan Anooj_Cheriyan@comcast.com

New patch created: https://github.com/rdkcentral/rdkservices/pull/3548

repo: rdkcentral/rdkservices


text:
drawing mol with a non zero confID results in bad confID error

Describe the bug
Goal is to make a new Chem.Mol of a given conformer in the application of using o3a align to get the best scoring conformer.  I followed the description outlined in the rdkit blog post https://greglandrum.github.io/rdkit-blog/posts/2023-02-04-working-with-conformers.html and encountered a bug (or misunderstanding) in the visualization of the mol for the different conformers that do not have id=0.
To Reproduce
notebook as done in and go to last line to render a new molecule with the conformer of interest:
https://greglandrum.github.io/rdkit-blog/posts/2023-02-04-working-with-conformers.html
cp = Chem.Mol(esomeprazole,confId=5)
cp
results in
ValueError: Bad Conformer Id in Chem.Draw
Expected behavior
The draw mol function does a hard assumption that it must be confId=0, but when plucking conformers out of a set, it would be nice to keep its ID so as to maintain its id origin.  Could the drawing function take the first conformer to draw?
Alternative drawing tools such as py3dmol will render the conformer correctly since the confId does not seem to be referenced,

Confirmed. Thanks for the bug report @kekulai-fredchang
Here's a short reproducible
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import rdDistGeom
m = Chem.AddHs(Chem.MolFromSmiles('CCCCCCC'))
rdDistGeom.EmbedMolecule(m)
m.GetConformer().SetId(5)
d2d = Draw.MolDraw2DCairo(200,200)
d2d.DrawMolecule(m)

FWIW: this doesn't happen with the SVG molecule renderer. It seems to be specific to MolDraw2DCairo

@greglandrum
sorry, kind of new here. is there API to create svg instead of image using function same class as MolDraw2DCairo

@greglandrum sorry, kind of new here. is there API to create svg instead of image using function same class as MolDraw2DCairo

Yes. There is a MolDraw2DSVG

repo: rdkit/rdkit


text:
JS: Implement in-place aromatisation/kekulisation and avoid undesired exception

Small PR to add in-place aromatisation/kekulisation (similarly to JSMol::set_new_coords()) and avoid that an exception is thrown if an attempt is made to aromatise a molecule that was not previously sanitized (e.g., a query mol).

implemented in-place aromatisation/kekulisation
avoid that attempting to aromatise a query mol throws an exception due calcImplicitValence() not having been called
add unit tests for the above

@greglandrum Sure, I'll rename the functions. Please wait before merging.


text:
Remove case sensitivity from e-mail invite

This PR aims at implementing #405

Coverage remained the same at 91.55% when pulling c2ba17206ee2e1f9f91edc3da3bdcd86d99f56ba on ubrostock:405-email-case-insensitive into c8a1794143db47e7dfc49dbce7785731ba348b8d on rdmorganiser:dev.

repo: rdmorganiser/rdmo


text:
Redmatic-Paket ohne Node-Module

Wäre es möglich, ein Redmatic-Paket (insbesondere für Updates) ohne die einzelnen Node-Module zu schnüren? Also nur mit den Core-Komponenten wie nodejs, node-red usw.
Hintergrund:
Da ich einige der vorinstallierten Nodes nicht benötige und um Speicher zu sparen und die Palette schlanker zu halten, habe ich diese deinstalliert. Wenn ich dann auf eine neue Redmatic-Version aktualisiere, sind die Nodes wieder installiert und ich muss diese erneut deinstallieren. Ein anderes Problem tritt ein, wenn in dem Update-Paket nicht die neuesten Versionen der Nodes sind. Habe ich diese Nodes bereits über die Palette aktualisiert, werden sie dann durch das Redmatic-Update wieder auf eine ältere Version zurückgesetzt.

dup: https://github.com/rdmtc/RedMatic/issues/351
see also https://homematic-forum.de/forum/viewtopic.php?f=77&t=58583&p=581054&

authors: hobbyquaker jensrossbach

repo: rdmtc/RedMatic


text:
🛑 SuperPi@Home is down

In 8fbd4b0, SuperPi@Home (https://piathome.utools.club) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SuperPi@Home is back up in 70be1fa.

repo: rdpupptime/upptime


text:
Warning: Failed prop type: Invalid prop data of type object supplied to BootstrapTable, expected array.

I have these warning but my tables render fine.

My data prop is static prop.  of type.
PropTypes.instanceOf(List).isRequired,
It is part of a immutable record.
here is my table class
import React, { Component } from 'react'
import BootstrapTable from 'react-bootstrap-table-next';
import cellEditFactory from 'react-bootstrap-table2-editor';
import Avatar from 'material-ui/Avatar';
import PropTypes from 'prop-types';
import { List } from 'immutable';
import Button from 'material-ui/Button';
import TextField from '@material-ui/core/TextField';

var compKey
var compTier
var Tier1 = []
var Tier2 = []

class AdminTable extends Component {
  static propTypes = {
    tier1CompetitorData: PropTypes.instanceOf(List).isRequired,
    tier2CompetitorData: PropTypes.instanceOf(List).isRequired,
    updateTier1Competitor: PropTypes.func.isRequired,
    updateTier2Competitor: PropTypes.func.isRequired,
    removeTier1Competitor: PropTypes.func.isRequired,
    removeTier2Competitor: PropTypes.func.isRequired
  };

  constructor() {
    super()
    this.removeCompetitor = this.removeCompetitor.bind(this)
    this.picFormatter = this.picFormatter.bind(this)
    this.updateScore = this.updateScore.bind(this)
  }

  removeCompetitor() {
    if (compTier === '1') {
      this.props.removeTier1Competitor(compKey);
    }
    if (compTier === '2') {
      this.props.removeTier2Competitor(compKey);
    }
  }

  updateScore(event) {
    event.preventDefault();
    const score = event.target.elements.score.value
    console.log("SCORE::", event.target.elements.score.value)

    const scoreUpdate = {
      score: score
    }

    if (score && compTier === '1') {
      this.props.updateTier1Competitor(compKey, scoreUpdate);
    }
    if (score && compTier === '2') {
      this.props.updateTier2Competitor(compKey, scoreUpdate);
    }

  }

  picFormatter(cell, row) {
    return (

        <Avatar src={row.pic} />

    );
  }

  render() {
    console.log("RBTABLE::", this.props.tier1CompetitorData);

    const columns = [
      {
        dataField: 'key',
        text: 'id'
      }, {
        dataField: 'rider',
        text: 'Rider'
      }, {
        dataField: 'horse',
        text: 'Horse'
      }, {
        dataField: 'tier',
        text: 'Tier'
      }, {
        dataField: 'pic',
        text: 'Pic',
        formatter: this.picFormatter
      }, {
        dataField: 'competition',
        text: 'Competition'
      }, {
        dataField: 'score',
        text: 'Score'
      }, {
        dataField: 'description',
        text: 'Description'
      }
    ];

    // Tier1 = this.props.tier1CompetitorData
    // Tier2 = this.props.tier2CompetitorData

    this.selectRow = {
      mode: 'checkbox',
      clickToSelect: true,
      clickToEdit: true,
      onSelect: (row, isSelect, rowIndex, e) => {
        compKey = row.key;
        compTier = row.tier;
      }
    };

    this.cellEdit = {
      mode: 'click',
      errorMessage: 'error',
      onTableChange: this.updateScore
    };

    this.cellEdit = {
      mode: 'click'
    };

    return (

Tier 1 Competitors

Select and remove as needed

            <Button variant="raised" size="small" color="secondary" onClick={this.removeCompetitor} type="submit">Remove</Button>

          <BootstrapTable
            keyField="key"
            striped={true}
            hover={true}
            data={this.props.tier1CompetitorData}
            columns={columns}
            selectRow={this.selectRow}
            cellEdit={cellEditFactory({ mode: 'click' })}
          />

          <form onSubmit={this.updateScore}>

                <TextField label="Select then update score" id="score" type="text" name="score" />

            <Button variant="raised" size="small" color="secondary" id="updateCompetitorScoreBtn" type="submit">Submit</Button>
          </form>

Tier 2 Competitors

Select and remove as needed

              <Button variant="raised" size="small" color="secondary" onClick={this.removeCompetitor} type="submit">Remove</Button>

            <BootstrapTable
              keyField="key"
              striped={true}
              hover={true}
              data={this.props.tier2CompetitorData}
              columns={columns}
              selectRow={this.selectRow}
              cellEdit={cellEditFactory({ mode: 'click' })}
            />

            <form onSubmit={this.updateScore}>

                  <TextField label="Select then update score" id="score" type="text" name="score" />

              <Button variant="raised" size="small" color="secondary" id="updateCompetitorScoreBtn" type="submit">Submit</Button>
            </form>

    )
  };
}

export default AdminTable;

The parent class where im passing the data down is a connected redux class
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { List } from 'immutable';
import { createSelector } from 'reselect';
import { getCompetitor1Filter, getVisibleCompetitors1 } from '../../../selectors/competitor1Selector';
import { getCompetitor2Filter, getVisibleCompetitors2 } from '../../../selectors/competitor2Selector';
import AddCompetitor from '../../components/competitors/addCompetitor';
import * as competitor1Actions from '../../../actions/competitor1Actions'
import * as competitor2Actions from '../../../actions/competitor2Actions'
import AdminTable from '../../components/tables/adminTable';

export class AdminPage extends Component {
    static propTypes = {
        loadTier1Competitors: PropTypes.func.isRequired,
        loadTier2Competitors: PropTypes.func.isRequired,
        competitors1: PropTypes.instanceOf(List).isRequired,
        competitors2: PropTypes.instanceOf(List).isRequired,
        updateCompetitor1: PropTypes.func.isRequired,
        updateCompetitor2: PropTypes.func.isRequired,
        removeCompetitor1: PropTypes.func.isRequired,
        removeCompetitor2: PropTypes.func.isRequired
    };

    componentWillMount() {

         this.props.loadTier1Competitors();
         this.props.loadTier2Competitors();
    }

    render() {
        console.log("ADMINPROPS::",this.props)
        return (

AdminPage

                    <AdminTable
                        tier1CompetitorData={this.props.competitors1}
                        tier2CompetitorData={this.props.competitors2}
                        updateTier1Competitor={this.props.updateCompetitor1}
                        updateTier2Competitor={this.props.updateCompetitor2}
                        removeTier1Competitor={this.props.removeCompetitor1}
                        removeTier2Competitor={this.props.removeCompetitor2}
                    />
                    <AddCompetitor
                        {...this.props}
                    />

        );
    }
}

//=====================================
//  CONNECT
//-------------------------------------

const mapStateToProps = createSelector(
    getCompetitor1Filter,
    getVisibleCompetitors1,
    getCompetitor2Filter,
    getVisibleCompetitors2,
    (filterType1, competitors1, filterType2, competitors2) => ({
        filterType1,
        competitors1,
        filterType2,
        competitors2
    })
);

const mapDispatchToProps = Object.assign(
    {},
    competitor1Actions,
    competitor2Actions
);

export default withRouter(connect(mapStateToProps,mapDispatchToProps)(AdminPage));

Do these tables have issues with using immutable list items?
I get 2 of these warnings whenever the component comes up.  The table works fine but they are annoying to persist in the console when your actively developing.    Any advice would be greatly appreciated.  I love the tables otherwise.
Lastly here is a console log of my data prop.

I'm not very familiar with List, but if that possible to change to an Array before feed into Table?

@dnbr2002 because table only accept data as array, if we need to support List, I think react-bootstrap-table will have one more dependency for immutable.js. So please change to array and do let me know native JS is able to handle List  that I will consider to support, thanks


text:
Suppress yarnpkg is not a command when only npm is installed

Inheriting stdout is how CRNA shows init status to the developer, but maybe it should be buffered until we're sure that yarn is installed for the "attempt installing with yarn first" version. Or maybe it's OK to just show this -- there's a lot of other output users see immediately after.

FWIW this is what we do in CRA.

@gaearon thanks! Very useful.

authors: dikaiosune gaearon

repo: react-community/create-react-native-app


text:
'videoQuality' feature is not working.

I have only tested in Android, 'videoQuality' feature is not working. I recorded a video of 10 seconds with videoQuality 'low' and it gives me a size of 51 MB and BitRate is 41921 kbps.
As well as 'durationLimit' is also not working. I set it to '5' but it is exceeding to 5.

+1


text:
If you want to work on this, how are you supposed to npm-link it to another project?

I just ran npm link ../react-navigation from within the app I'm working on, and I'm getting the following error:
No dimensions set for key window
I've tried changing main in package.json to lib-rn as well.

It seems the issue was that my project was React Native 44, and for whatever reason linking to react-navigation pinned at 43.2 was the issue.

repo: react-community/react-navigation


text:
[Feature]: 翻译 examples/modal/

What is the new or updated feature that you are suggesting?
增加中文版本示例
Why should this feature be included?
增加中文版本示例

我翻译examples/modal，时间2021.12.28-2022.12.29

repo: react-document/reactrouter


text:
Expo Support

Feature Request
Add Expo Support. With Expo growing and more developers joining the RN community, many of them will start with Expo and face the same issue I'm facing, cookie management in the app.
Why it is needed
I'm trying to develop an app made to authenticate through a webpage and then get redirected to the app. WebBrowser and AuthSession from Expo are ruled out since we can't cover all the use cases, leaving us with WebView. We can't access and we don't want to access the cookies in the WebView, we want to decouple the login from the REST API calls that we do after and only get the cookie in that moment.
Possible implementation
I have no experience in this area
Code sample
The perfect outcome would be to run the command: expo install @react-native-community/react-native-cookies

Hey @safaiyeh, are there any news about Expo support?

Still in discussion @Djokic

@antoniogoulao - can you clarify your use case?

I'm trying to develop an app made to authenticate through a webpage and then get redirected to the app. WebBrowser and AuthSession from Expo are ruled out since we can't cover all the use cases

what use cases aren't covered?

leaving us with WebView.

apple will not allow you on the store if you provide authentication through a webview, they will tell you to use SFSafariViewController/SFAuthenticationSession

We can't access and we don't want to access the cookies in the WebView, we want to decouple the login from the REST API calls that we do after and only get the cookie in that moment

so you want to get the cookies via login in webview and then use that to make api calls in react-native, right?

@Djokic - can you explain in detail what your use case is? I want to make sure that whatever we come up with for Expo managed workflow will work for you

I’m trying to log in to external service though a WebView, read cookies from WebView (including HTTPOnly)  and use them to make requests in react-native. In the end I would like to clear cookies from both RN and WebView.

Hi @brentvatne, it's the same case as @Djokic. In my use case, the app needs to support SAML Auth. I can't change, from the app, the RelayState to where the SSO is going to redirect the user to a URI that makes the app redirect and in some custom implementations of the protocol, it's not possible to ask to configure the SSO service to redirect after login according to the app (using a custom header for instance) accessing the service.
Could HTTPCookieStorage.shared.cookies be used in this case?

which functions from this library do you need specifically to be able to accomplish your goal? is there any way you can provide me with access and an example of integrating with an endpoint so i can ensure that whatever we include in expo ends up meeting your requirements?

@brentvatne from this library I would need to get the cookies for a given hostname, delete the cookies for that hostname, and optionally set from response. Unfortunately I don't have any instance or endpoint I can provide

Any way I can help you more with this request? Was it clear enough?

we plan to work on this for sdk38!
i understand the request. if you can give me access to some endpoint and demonstrate how you would build this with react-native-cookies in it's current form that would be helpful for me to understand further!

@brentvatne Is there any ETA for the feature?

we do quarterly sdk releases so if it makes it in to sdk38 it will be available in the managed workflow at the end of june

For the time being, I've found a workaround to manage cookies in expo that others might find interesting. I've only tested it on Android using the expo app (expo: 37).

@antoniogoulao I'm facing something similar. Tried many different alternatives and end up creating a PR https://github.com/react-native-community/react-native-webview/pull/1465 to include a clearCookies method in the react-native-webview for iOS and Android. Let's see if it will be merged.
In RN 0.62.2, the RCTNetwork interface was exposed so, in theory, you could do something like this:
import React, { useRef } from 'react';
import { Button } from 'react-native';
import WebView from 'react-native-webview';
import Networking from 'react-native/Libraries/Network/RCTNetworking';

const App = () => {

  const webView = useRef();
  const reload = () => webView.current.reload();
  const clearCookies = () => Networking.clearCookies((cleared) => console.log(cleared));

  return (
    <>
      <Button title="Clear cookies" onPress={clearCookies} />
      <Button title="Reload" onPress={reload} />
      <WebView
        ref={webView}
        style={{ height: 500 }}
        source={{uri: 'https://www.theguardian.com/international'}}
      />
    </>
  );
};

But, as commented here, it doesn't work on iOS.
While it's not possible to clearCookies at client side, I think the best option would be to configure your idP to force reauthentication (thanks @brentvatne  for the tip). If you're using Azure AD and SAML, this article might be helpful.

For which SDK version is this feature to be included?

Closing as this package will not be included with expo

authors: Djokic NickCis antoniogoulao brentvatne pdandradeb safaiyeh thargenediad

repo: react-native-community/cookies


text:
Modify 'Header Search Path' for native iOS app to integrate react-nat…

Modify 'Header Search Path' for native iOS app to integrate react-native-blur from react-native package.json.
In file included from /Users/OceanHorn/SourceTree/mmms/node_modules/react-native-blur/ios/VibrancyViewManager.m:1:
/Users/OceanHorn/SourceTree/mmms/node_modules/react-native-blur/ios/VibrancyViewManager.h:1:9: fatal error: 'React/RCTViewManager.h' file not found
#import <React/RCTViewManager.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Hey @OceanHorn!
Looks good to me! I'll release a patch version with this patch 😉

authors: Kureev OceanHorn


text:
NativeModule.RNDeviceInfo is null RN 0.61.2

Bug
We just moved our app to RN 0.61.2, and we have the following issue on Android:

Environment info
System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 111.60 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.2 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 24, 25, 26, 27, 28
      Build Tools: 25.0.2, 27.0.3, 28.0.3
      System Images: android-24 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.2 => 0.61.2
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native: 0.61.2

Library version: 4.0.1
Steps To Reproduce
Use RN 0.61.2 and only do an import
import DeviceInfo from 'react-native-device-info';

there is no way to link manually with this version of react native, can be the issue

Same problem for me

Any time you have a native module that's null, it's a project setup problem, and debugging those is a time-sink for maintainers - sorry
If you can reproduce this by cloning this repo and running the example (or just copying the refresh-example.sh script and using it) then it's an issue
But it's not an issue - I'm using this fine in RN0.61.2

Look at the volume of these issues - none of them problems with the module :-(
https://github.com/react-native-community/react-native-device-info/issues?q=is%3Aissue+sort%3Aupdated-desc+RNDeviceInfo+is+null+is%3Aclosed

@mikehardy I guess it happens mostly after react-native upgrade, and it looks like a lot of users are experiencing this issue. It would be nice to have any solution here...
I am using react-native 0.61.5 and unfortunately having this issue as well.. 😪

@matanrokach there is no real "solution" because there is no module-specific "problem". It's the underlying technology. In react-native if you want to use a native module, you must link it in. There are a few ways to do this - you have to pick one and implement it correctly. Or you have a problem.
As a maintainer, all I can do is show people examples of exactly how to do it correctly, whether they do so or not is out of my control.
RN59 https://github.com/react-native-community/react-native-device-info/blob/master/refresh-example-rn59.sh#L33
RN60+ https://github.com/react-native-community/react-native-device-info/blob/master/refresh-example.sh#L29
What most people miss is setting up the linking correctly when they go from RN59 to RN60. Specifically https://github.com/facebook/react-native/blob/master/template/ios/Podfile#L2 https://github.com/facebook/react-native/blob/master/template/ios/Podfile#L15 and https://github.com/facebook/react-native/blob/master/template/android/app/build.gradle#L218

i have tried everything but its not working for me :(
`# platform :ios, '9.0'
target 'ABC' do
pod 'React', :path => '../node_modules/react-native', subspecs: [
'Core',
'CxxBridge',
'DevSupport',
'RCTText',
'RCTNetwork',
'RCTWebSocket',
'RCTAnimation',
'RCTActionSheet',
'RCTBlob',
'RCTCameraRoll',
'RCTGeolocation',
'RCTImage',
'RCTPushNotification',
'RCTSettings',
'RCTTest',
'RCTVibration',
'RCTLinkingIOS'
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
`
can you help me out here ? thank you

@ShooterArk looks like you're trying to do pods with rn59? Is that right? That's basically unsupportable at this point. You need RN60+ in order to do Xcode 11 well, and you need Xcode 11 to do iOS13 which is a requirement (or about to be), right? At the same time, this library used to work fine but I used react-native link back in the RN59 days, I did not add it as a pod.

authors: RuairiOliver ShooterArk ajouve matanrokach mikehardy


text:
Menu is always visible even when isOpen is false

Video:

Code:
class Menu extends Component {

  render() {
    return (
      <View style={{flex: 1, backgroundColor: '#ededed', paddingTop: 50}}>
        <List containerStyle={{marginBottom: 20}}>
          { this.props.routes.map((r, i) => (<ListItem key={i} title={r.title} onPress={() => console.log('Pressed ' + r.title)} /> )) }
        </List>
      </View>
    );
  }
}

export default class Main extends Component {

  constructor(props) {
    super(props);
    this.state = {isOpen: false};
    this.toggleSideMenu = this.toggleSideMenu.bind(this)
  }

  toggleSideMenu () {
    this.setState({isOpen: !this.state.isOpen})
  }

  updateSideMenuState(isOpen) {
    this.setState({ isOpen, });
  }

  render() {
    const routes = [
      {title: 'First Scene', text: 'Hi!', index: 0},
      {title: 'Second Scene', text: 'Hello!', index: 1},
    ];

    const menu = (<Menu navigator={this.props.navigator} routes={routes} />);

    return (
        <SideMenu isOpen={this.state.isOpen} onChange={(isOpen) => this.updateSideMenuState(isOpen)} menu={menu}>
          <View style={{paddingTop: 50}}>
            <Text>Hi!</Text>
          </View>
        </SideMenu>
    );
  }
}

Can you also post a Menu code? That will help to exclude a possibility of usage mistake

@Kureev thanks helping! I believe the code you're talking about is posted above:
class Menu extends Component {

  render() {
    return (
      <View style={{flex: 1, backgroundColor: '#ededed', paddingTop: 50}}>
        <List containerStyle={{marginBottom: 20}}>
          { this.props.routes.map((r, i) => (<ListItem key={i} title={r.title} onPress={() => console.log('Pressed ' + r.title)} /> )) }
        </List>
      </View>
    );
  }
}

I'm using the List component from react-native-elements.
Let me know if you're looking for something else.

Yep, i have the same error but only on android, on ios works perfectly, so at the moment i unable to resolve the problem

@Kureev @alusor @davidcaseria Did you fix this? I too got the same issue

@Kureev  @alusor  @davidcaseria  if backgroundColor is set for the container this issue will not occur. After setting back ground color it is working fine in IOS

@railsfactory-sivamanikandan Yes, setting the backgroundColor and flex fixes the issue.

authors: Kureev alusor davidcaseria railsfactory-sivamanikandan


text:
viewConfig is not defined

Was getting this when trying to render a Animated.createAnimatedComponent(Circle) within an Svg. Think it was broken by this commit on Oct 12.
Was able to fix it in my fork by adding:
    componentDidMount() {
        this.viewConfig = this.root.viewConfig;
    }

to Shape.

This seems like has been fixed in latest react-native version.
I'm closing this now. feel free to reopen this if the problem still exists

authors: magicismight tuckerconnelly

repo: react-native-community/react-native-svg


text:
Is it possible to start splashscreen?

Would it be possible to have a Splashscreen.start() or Splashscreen.open() to programmatically open the splashscreen while app is running ?

I'm afraid It only can be used while starting app, but I think it can come true by creating a new package.

okay thanks

authors: cyqresig logileifs


text:
[BUG]: onPlaybackRateChangeData is missing in 6.0.0-beta.6 and not documented as a breaking change

Version
v6 (Beta)
What platforms are you having the problem on?
iOS
Architecture
Old architecture
What happened?
onPlaybackRateChangeData appears missing ; this was in 5.2 on iOS the only way to detect start and stop of the video reliably and now it's gone.  I can try out OnPlaybackStateChange
Reproduction
repository link
Reproduction
The event is missing.

The types was not correct, this PR fixes the onPlaybackRateChangeData type https://github.com/react-native-video/react-native-video/pull/3651

linked Pr merge, to be retested on 6.0.0-beta.9

authors: eedeebee freeboub

repo: react-native-video/react-native-video


text:
Smooth transition from screen with headerTransparent: true to another with it false in the same stack

Current Behavior

What code are you running and what is happening?
Non transparent header is randomly popping up in the layout after navigating back from a screen with the headerTransparent property set to true.
Include a screenshot if it makes sense.

Expected Behavior

What do you expect should be happening?
The non transparent header should have either an entering transition or a padding at the top while it's not fully transitioned preventing this inconsistent behavior.

How to reproduce
Demo on snack
Your Environment

software
version

react-navigation
3.3.0

react-native
0.57.1

node
11.10.0

npm or yarn
yarn 1.13.0

Oh, I hadn't thought about nesting another stack. Thanks for the suggestion!
I'm going to use the suggested workaround rather than using the headerMode: 'screen' property since I want to have normal header transitions across other screens on the stack.

This works well in the latest alpha.

repo: react-navigation/stack


text:
feat: pass navigationOptions to cardInterpolator

In many apps navigation options are used as a config for custom interpolator so it's vital to pass them through.

I don't feel very good about this change. I think the style interpolator shouldn't be aware of navigation options. If the goal is to customize CardStyleInterpolator/HeaderStyleInterpolator per screen, maybe it makes more sense to support specifying the interpolator in navigationOptions?

Maybe that's the point. But I'm still not bad with this change even if it's not used in given use case

@satya164 That was exactly my use case – determining the screen I was processing.
Having separate interpolators is definitely way cleaner and less hacky. That would be great to have.

Closing in favor of #155

authors: osdnk satya164 tchayen


text:
Docs/more examples into docs

Proposed changes

Types of changes

[ ] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

[ ] Lint and unit tests pass locally with my changes
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in downstream modules

Closing issues

Fixes #
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

:tada: This PR is included in version 0.28.0 :tada:
The release is available on:

v0.28.0
GitHub release

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 0.27.1 :tada:
The release is available on:

v0.27.1
GitHub release

Your semantic-release bot :package::rocket:

authors: casaper macrozone

repo: react-page/react-page


text:
CANNON.Ray(...).intersectBody doesn't update direction itself

new CANNON.Ray(vFrom, vTo).intersectBody(body) method doesn't work without using ray.updateDirection method (and it was a private method in cannon.js).
body.addEventListener("collide", ({ contact }) => {
  if (!grounded) {
    const vFrom = body.position;
    const vTo = new CANNON.Vec3(0, -1, 0);
    const ray = new CANNON.Ray(vFrom, vTo);
    ray.updateDirection(); // <------ I shouldnt need to update the direction
                            //         manually before using intersectBody
    ray.intersectBody(contact.bi);
    grounded = ray.result.hasHit;
  }
});

A bug also encountered here but you should dig into the code.
Also, thanks for your port and fork !

Try providing a RaycastResult when calling intersectBody:
body.addEventListener('collide', ({ contact: { bi } }) => {
  if (!grounded) {
    const vTo = new CANNON.Vec3(0, -1, 0)
    const ray = new CANNON.Ray(body.position, vTo)
    const result = new CANNON.RaycastResult()
    ray.intersectBody(bi, result)
    grounded = result.hasHit
  }
})

Thanks for your fast reply, but should I do this even if its a deprecated method ?
See https://github.com/react-spring/cannon-es/blob/dda84a95bd1812050b4338c3b71ae3093e351d6f/src/collision/Ray.ts#L127

This does not work:
  body.addEventListener("collide", ({ contact: bi }) => {
    if (!grounded) {
      const vTo = new CANNON.Vec3(0, -1, 0);
      const ray = new CANNON.Ray(body.position, vTo);
      const result = new CANNON.RaycastResult();
      ray.intersectBody(bi, result);
      grounded = ray.result.hasHit;
    }
  });

This work:
body.addEventListener("collide", ({ contact }) => {
if (!grounded) {
const vTo = new CANNON.Vec3(0, -1, 0);
const ray = new CANNON.Ray(body.position, vTo, true);
const result = new CANNON.RaycastResult();
ray.intersectBody(contact.bi, result);
grounded = ray.result.hasHit;
}
});
The only difference is the destructuration of contact.

The problem I see is that we don't want to call updateDirection in any intersection method unless it's truly necessary (it is not insignificant to performance) - and the way in which it's consumed by the World does not require calling updateDirection.
I'll remove the optional result param, and instead add an optional doSkipUpdateDirection param that defaults to false, and is set to true by the World.

This does not work:

Your destructuring isn't correct:
body.addEventListener("collide", ({ contact: bi }) => {

should be
body.addEventListener("collide", ({ contact: { bi } }) => {

After doing more digging I will need to consider this further. Updating the intersect methods API as I suggested above would cause undesirable behavior when initializing the Ray with a RayOptions that contains a result prop - and I believe this pattern may be useful for memory sharing.
The Ray intersect methods were not initially intended for raycasting, but they are suitable for it. Maybe be could develop another layer of abstraction for user-facing raycasts.

authors: codynova nestarz

repo: react-spring/cannon-es


text:
Table multiselect does not work

I cloned the react-toolbox-example. I then copied the code from the playground from http://react-toolbox.com/#/components/table. The multiselect works in the playground but not when it is copied to the example. Is the code base different in the playground compared to the main code base?

Ok, it works when I download the code and import from the Component directory but does not work when importing from lib, which means the lib code has not been generated as  yet.

repo: react-toolbox/react-toolbox


text:
Cannot resolve module 'sass-loader': scss generator generates vanilla css file and is missing sass-loader dependency

Steps to reproduce:
Select scss generator and postcss

Adding an scss file results in loading error

Workaround

Rename App.css to App.scss
Change reference from App.css to App.scss in Main.js
Install sass-loader

$ npm install --save-dev node-sass sass-loader

Restart webpack server with npm start

I couldn't get your workaround to work. We need a fix for this.

forked to inspect and this appears to be fixed on master. closing.

authors: neilsarkar oktalk