<?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>Forem: Yahya Messelmi</title>
    <description>The latest articles on Forem by Yahya Messelmi (@yahyamesselmi).</description>
    <link>https://forem.com/yahyamesselmi</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%2F2695531%2F83fc0cb9-a913-4753-bf1b-9b5014292cba.png</url>
      <title>Forem: Yahya Messelmi</title>
      <link>https://forem.com/yahyamesselmi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yahyamesselmi"/>
    <language>en</language>
    <item>
      <title>Noor JS The New JavaScript UI library</title>
      <dc:creator>Yahya Messelmi</dc:creator>
      <pubDate>Sun, 12 Jan 2025 16:26:45 +0000</pubDate>
      <link>https://forem.com/yahyamesselmi/noor-js-the-new-javascript-ui-library-1lgm</link>
      <guid>https://forem.com/yahyamesselmi/noor-js-the-new-javascript-ui-library-1lgm</guid>
      <description>&lt;p&gt;&lt;strong&gt;NoorJs&lt;/strong&gt; a lightweight UI JavaScript framework designed to help you build fast, efficient, and scalable applications. NoorJs is built around the concept of First-Time-Rendering, which means your component is rendered once at the start and won't be re-rendered unless you explicitly choose to. You have full control over when and how your components are rendered, allowing for optimized performance.&lt;/p&gt;

&lt;p&gt;Unlike other frameworks, NoorJs renders components directly to the DOM without relying on a Virtual DOM (VDOM). You can modify your component's view effortlessly by calling a simple function, without triggering a re-render.&lt;/p&gt;

&lt;p&gt;NoorJs also introduces a powerful way to manage state. You can listen for changes to specific states and react accordingly, ensuring your components stay in sync with your data. Additionally, lifecycle functions enable you to perform tasks like data fetching or state updates at key points in your component's lifecycle.&lt;/p&gt;

&lt;p&gt;Sharing data between components is made incredibly simple with the Channel API. Whether you're passing data to child components, parent components, or components outside of the direct scope, the Channel API allows for seamless and efficient data flow.&lt;/p&gt;

&lt;p&gt;Continue reading these docs to explore how NoorJs can transform your approach to building modern web applications.&lt;/p&gt;

&lt;p&gt;Key Features :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lightweight Library&lt;/li&gt;
&lt;li&gt;First-Time-Rendering&lt;/li&gt;
&lt;li&gt;Element-Based Components&lt;/li&gt;
&lt;li&gt;Direct DOM Rendering&lt;/li&gt;
&lt;li&gt;Effortless View Modification&lt;/li&gt;
&lt;li&gt;Powerful State Management&lt;/li&gt;
&lt;li&gt;Channel API&lt;/li&gt;
&lt;li&gt;Explicit Rendering Control&lt;/li&gt;
&lt;li&gt;Provides modern framework feature like JSX&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This's simple counter app will show you the power of NoorJs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&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;createRoot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;renderRoot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Component&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;@noorjs/core&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// app component&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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;Component&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// initializing the component by call the element plug function and setting the component HTML tag&lt;/span&gt;
  &lt;span class="nf"&gt;element&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&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="c1"&gt;// setting a counter state&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;getCounter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCounter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// adding an event listener to increase the counter state whenever the component is clicked&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;onClick&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// increasing the counter state&lt;/span&gt;
    &lt;span class="nf"&gt;setCounter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// rerendering the app when the counter is clicked&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This runs once&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// returning an arrow function that returns the JSX to be rendered&lt;/span&gt;
  &lt;span class="k"&gt;return &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;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;getCount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// creating the root&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createRoot&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// render the component&lt;/span&gt;
&lt;span class="nf"&gt;renderRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;]);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this simple counter app we initialized our App component by using the element plug function then we created the counter state with &lt;code&gt;0&lt;/code&gt; as initial value ,then we added an &lt;code&gt;onClick&lt;/code&gt; event listener with setEvent function to increase the counter state and rerender the component with this.render method (This Is The Power Of &lt;strong&gt;NoorJs&lt;/strong&gt;. Render It When You Need It) then we returned JSX.&lt;/p&gt;

&lt;p&gt;NoorJs treats each component as an HTML element that you choose when you initialize your component. For more examples see the &lt;a href="https://github.com/MESSELMIyahya/NoorJs/blob/main/docs/doc.md" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚧 &lt;strong&gt;NoorJs&lt;/strong&gt; is still under development and it has many bugs and issues and needs your help and contributions to make it stable&lt;/p&gt;

&lt;p&gt;Please see the &lt;a href="https://github.com/MESSELMIyahya/NoorJs/issues" rel="noopener noreferrer"&gt;Issues&lt;/a&gt; and get started by contributing to it&lt;/p&gt;

&lt;p&gt;GITHUB&lt;br&gt;
&lt;a href="https://github.com/MESSELMIyahya/NoorJs" rel="noopener noreferrer"&gt;https://github.com/MESSELMIyahya/NoorJs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>news</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
