<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: deexter</title>
    <description>The latest articles on DEV Community by deexter (@deexter).</description>
    <link>https://dev.to/deexter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F460842%2Fef6a9b8c-041f-472a-b4c5-7e55a152937c.jpeg</url>
      <title>DEV Community: deexter</title>
      <link>https://dev.to/deexter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deexter"/>
    <language>en</language>
    <item>
      <title>Observable</title>
      <dc:creator>deexter</dc:creator>
      <pubDate>Fri, 20 Dec 2024 19:34:45 +0000</pubDate>
      <link>https://dev.to/deexter/observable-169</link>
      <guid>https://dev.to/deexter/observable-169</guid>
      <description></description>
      <category>emptystring</category>
    </item>
    <item>
      <title>Debugging and monitoring</title>
      <dc:creator>deexter</dc:creator>
      <pubDate>Thu, 25 Mar 2021 21:25:55 +0000</pubDate>
      <link>https://dev.to/deexter/debugging-and-monitoring-59ki</link>
      <guid>https://dev.to/deexter/debugging-and-monitoring-59ki</guid>
      <description>&lt;p&gt;I recently struggled with monitoring FE application.&lt;br&gt;
I had no idea how to monitor errors in your SPA, so I made some research of cloud monitoring tools, but I was not able to decide which one to choose.&lt;br&gt;
You are also able to listen window events, but is it good enough?&lt;br&gt;
Every tool has pros and cons.&lt;br&gt;
Could you help me with your experience and how do you monitor you application?&lt;br&gt;
I will appretiate your comments.&lt;/p&gt;

&lt;p&gt;I have just one more thing to ask, if you debug node.js application do you use just console.log to understand what is going on, or do you use debugger?&lt;/p&gt;

</description>
      <category>monitoring</category>
      <category>cloud</category>
      <category>question</category>
      <category>ask</category>
    </item>
    <item>
      <title>Facebook widget</title>
      <dc:creator>deexter</dc:creator>
      <pubDate>Fri, 05 Feb 2021 22:26:13 +0000</pubDate>
      <link>https://dev.to/deexter/facebook-widget-1b8j</link>
      <guid>https://dev.to/deexter/facebook-widget-1b8j</guid>
      <description>&lt;p&gt;I recently started to crate my app to create daily menus for restaurants.&lt;br&gt;
My idea was to provide widget with daily menus on facebook page and same for restaurant website.&lt;/p&gt;

&lt;p&gt;I know that is possilbe to share facebook widget on your site, but what if you want share your widget on facebook?&lt;/p&gt;

&lt;p&gt;I didn´t find any tutorials or article if it is possible.&lt;br&gt;
Do you think it is possible or my idea?&lt;br&gt;
Let me know if you have any experience in this.&lt;/p&gt;

</description>
      <category>facebook</category>
      <category>widget</category>
      <category>html</category>
      <category>question</category>
    </item>
    <item>
      <title>Ne(u)xt.JS SSR with dynamic metadata</title>
      <dc:creator>deexter</dc:creator>
      <pubDate>Sun, 24 Jan 2021 22:21:57 +0000</pubDate>
      <link>https://dev.to/deexter/ne-u-xt-js-ssr-with-dynamic-metadata-268c</link>
      <guid>https://dev.to/deexter/ne-u-xt-js-ssr-with-dynamic-metadata-268c</guid>
      <description>&lt;p&gt;Hi,&lt;br&gt;
In my recent project we decided to use server side rendering to increase SEO.&lt;/p&gt;

&lt;p&gt;Our goal is to store metadata like title and etc in CMS like contentful.&lt;br&gt;
So we have to make for every request for page request to contentful.&lt;/p&gt;

&lt;p&gt;This slowing down response even if it is very fast.&lt;br&gt;
This cost just 1 request, but what if I want data for my client side application?&lt;br&gt;
Sometimes query could be very slow.&lt;/p&gt;

&lt;p&gt;Is there possibility to render meta tags server side and rest of content with SPA?&lt;br&gt;
I thing this will have negative impact for SEO.&lt;/p&gt;

&lt;p&gt;Is there any other and better way, than static site generator?&lt;/p&gt;

&lt;p&gt;Have you ever struggled with this?&lt;br&gt;
I’ll be very happy if you share your experience.&lt;/p&gt;

</description>
      <category>question</category>
    </item>
    <item>
      <title>Vue3 event emitter</title>
      <dc:creator>deexter</dc:creator>
      <pubDate>Fri, 08 Jan 2021 20:51:19 +0000</pubDate>
      <link>https://dev.to/deexter/vue-3-event-emitter-49cj</link>
      <guid>https://dev.to/deexter/vue-3-event-emitter-49cj</guid>
      <description>&lt;p&gt;I recently have been asked to make micro-frontend with webpack plugin &lt;a href="https://webpack.js.org/concepts/module-federation/"&gt;Module federation&lt;/a&gt;&lt;br&gt;
This micro-frontend used vuex library before, but it was used only for opening/closing modals.&lt;/p&gt;

&lt;p&gt;So we tended to replace it with something more simple.&lt;br&gt;
Among our candidates was &lt;a href="https://github.com/developit/mitt"&gt;mitt&lt;/a&gt;, which is very tiny library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;mitt&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mitt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;emitter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mitt&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our first try was register emitter in mounted lifecycle method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;defineComponent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="nx"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;   
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;emitter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;open-modal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shouldDisplay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;ModalType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ThankYou&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="p"&gt;});&lt;/span&gt; 
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works only if you use emitter in another component, but if you want emit outside of vue component, it does not work.&lt;br&gt;
This is probably caused, because you have to have instance of Vue app and if you use recommended &lt;a href="https://v3.vuejs.org/api/composition-api.html#getcurrentinstance"&gt;getcurrentinstance&lt;/a&gt; you get null outside of vue components.&lt;/p&gt;

&lt;p&gt;If you want to use it like we do, with hooks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;emitter&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../utils/emitter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useModal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;openModal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;emitter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open-modal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;closeModal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;emitter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open-modal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;openModal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;closeModal&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You have to register event listener also with hook&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Modal&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;isOpen&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shouldDisplay&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;close&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;modal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;closeModal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Modal&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;defineComponent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;CustomModal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Modal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;closeModal&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useModal&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;onMounted&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;emitter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;open-modal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;shouldDisplay&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;ModalType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ThankYou&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;closeModal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;shouldDisplay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do you have also experience with event emitter?&lt;br&gt;
Share your ideas.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>mitt</category>
      <category>emitter</category>
      <category>vue3</category>
    </item>
    <item>
      <title>setTimeout in nodeJS</title>
      <dc:creator>deexter</dc:creator>
      <pubDate>Mon, 31 Aug 2020 07:31:07 +0000</pubDate>
      <link>https://dev.to/deexter/settimeout-in-nodejs-8oc</link>
      <guid>https://dev.to/deexter/settimeout-in-nodejs-8oc</guid>
      <description>&lt;p&gt;We recently started with building new messaging service, that should be made with request reply pattern.&lt;/p&gt;

&lt;p&gt;We had no much experience how nodeJS works so we struggled with setting timeout.&lt;br&gt;
Initialy we thought this should work&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PKBJEL16--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ff6atg9h84f8ju9ct451.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PKBJEL16--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ff6atg9h84f8ju9ct451.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
If you will write code like us you will never get out of while loop, because setTimeout will never be executed.&lt;/p&gt;

&lt;p&gt;It is caused because nodeJs has event loop and you have to pass context&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z_GRbfud--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pc8l1ialtiuknzlm8orh.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z_GRbfud--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pc8l1ialtiuknzlm8orh.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever struggled with same problem?&lt;br&gt;
Share your ideas.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>eventloop</category>
    </item>
  </channel>
</rss>
