<?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: Julio Santacruz</title>
    <description>The latest articles on DEV Community by Julio Santacruz (@julio_santacruz).</description>
    <link>https://dev.to/julio_santacruz</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%2F865047%2Fc5600ade-9e4b-4060-a14a-2fb64c4a3824.jpg</url>
      <title>DEV Community: Julio Santacruz</title>
      <link>https://dev.to/julio_santacruz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/julio_santacruz"/>
    <language>en</language>
    <item>
      <title>🚀Los 7 Métodos para proteger tus APIs que debes conocer</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Wed, 24 Dec 2025 07:36:10 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/los-7-metodos-para-proteger-tus-apis-que-debes-conocer-ljm</link>
      <guid>https://dev.to/julio_santacruz/los-7-metodos-para-proteger-tus-apis-que-debes-conocer-ljm</guid>
      <description>&lt;p&gt;Si quieres trabajar como Backend, ya sabes que las APIs son como la puerta principal de tu casa digital. Si no las proteges bien, cualquiera podría entrar y robarte todo. Estos son 7 métodos clave para blindar tus APIs (Este post es mas informativo, for noobs, for beginners, for non technical peopel, y/o estudiantes, esto es para informar :D).&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ Rate Limiting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;¿Qué es?&lt;/strong&gt; Ponerle límites de velocidad a tu API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;¿Cómo funciona?&lt;/strong&gt; Solo deja que un usuario haga X peticiones en cierto tiempo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;¿Cómo lo implemento?&lt;/strong&gt; Usando middlewares, proxies como NGINX o librerías que controlen el número de peticiones por IP o token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;¿Qué previene?&lt;/strong&gt; Ataques de fuerza bruta o spam.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Imagina que tienes un servicio y un usuario está enviando peticiones de manera constante para saturar tu servidor. Si no implementas Rate Limiting, el usuario puede consumir todos los recursos del sistema, afectar a otros usuarios y provocar caídas del servicio..&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2️⃣ CORS (Cross-Origin Resource Sharing)
&lt;/h2&gt;

&lt;p&gt;¿Qué es? Un sistema de permisos para decidir qué sitios pueden usar tu API.&lt;/p&gt;

&lt;p&gt;¿Cómo funciona? Solo deja pasar a “dominios de confianza”.&lt;/p&gt;

&lt;p&gt;¿Cómo lo implemento? Configurando reglas en el servidor o en frameworks como Express, Django o .NET para definir los orígenes permitidos.&lt;/p&gt;

&lt;p&gt;¿Qué previene? Que cualquiera desde cualquier web intente robar tus datos.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Imagina que tienes un servicio con acceso a informacion sensible y no cualquiera debe acceder, al configurar el CORS estas creando una lista de quien si puede acceder a tu API con acceso a la informacion&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ SQL y NoSQL Injection
&lt;/h2&gt;

&lt;p&gt;¿Qué es? Cuando un atacante mete código malicioso en tus consultas a la base de datos.&lt;/p&gt;

&lt;p&gt;¿Cómo funciona? Se aprovechan de entradas sin validar para manipular, robar o borrar info.&lt;/p&gt;

&lt;p&gt;¿Cómo lo implemento? Usando queries parametrizadas, ORMs y validando siempre la entrada del usuario.&lt;/p&gt;

&lt;p&gt;¿Qué previene? Robos de información o borrados masivos de datos.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Es como si llenas un formulario para pedir un libro en la biblioteca y alguien en vez de escribir “Harry Potter” pone: “dame Harry Potter y la llave del almacén”&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4️⃣ Firewalls
&lt;/h2&gt;

&lt;p&gt;¿Qué es? Una barrera digital que separa tráfico bueno del malo.&lt;/p&gt;

&lt;p&gt;¿Cómo funciona? Filtra peticiones y bloquea las sospechosas.&lt;/p&gt;

&lt;p&gt;¿Cómo lo implemento? Configurando un WAF (Web Application Firewall) o reglas de firewall en la infraestructura (AWS, Azure, GCP).&lt;/p&gt;

&lt;p&gt;¿Qué previene? Ataques directos y accesos no autorizados.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Es como un guardia en la entrada de un edificio: deja pasar a los residentes y niega acceso a todos los demas.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5️⃣ VPNs (Virtual Private Networks)
&lt;/h2&gt;

&lt;p&gt;¿Qué es? Una conexión segura y encriptada que esconde tu identidad online.&lt;/p&gt;

&lt;p&gt;¿Cómo funciona? Redirige tu tráfico por un túnel cifrado y cambia tu IP.&lt;/p&gt;

&lt;p&gt;¿Cómo lo implemento? Configurando una VPN corporativa para que solo quienes estén conectados puedan acceder a la API.&lt;/p&gt;

&lt;p&gt;¿Qué previene? Robos de datos en redes públicas y rastreo de ubicación.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Imagina que tu API solo debe ser accesible desde la red de tu empresa. Cuando te conectas desde tu casa o desde una red pública, primero establece una conexión VPN.&lt;br&gt;
La VPN crea un túnel cifrado que hace que su dispositivo se comporte como si estuviera dentro de la red de la oficina, permitiéndole acceder a la API de forma segura sin exponerla a internet.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6️⃣ CSRF (Cross-Site Request Forgery)
&lt;/h2&gt;

&lt;p&gt;¿Qué es? Un ataque que engaña al usuario para ejecutar acciones sin saberlo.&lt;/p&gt;

&lt;p&gt;¿Cómo funciona? El atacante hace que tu navegador mande una petición falsa en tu nombre.&lt;/p&gt;

&lt;p&gt;¿Cómo lo implemento? Usando tokens CSRF, cabeceras personalizadas y validaciones en el servidor.&lt;/p&gt;

&lt;p&gt;¿Qué previene? Acciones no autorizadas como transferencias o cambios de contraseñas sin tu consentimiento.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Imagina que estás logueado en el sistema de tu banco en una pestaña del navegador. Luego visitas una página maliciosa que, sin que lo notes, envía una petición para transferir dinero usando tu sesión activa.&lt;br&gt;
Si la API no valida un token CSRF, el servidor cree que la petición es legítima y pierdes dinero.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7️⃣ XSS (Cross-Site Scripting)
&lt;/h2&gt;

&lt;p&gt;¿Qué es? Insertar scripts maliciosos en páginas web.&lt;/p&gt;

&lt;p&gt;¿Cómo funciona? El código se ejecuta en el navegador del usuario.&lt;/p&gt;

&lt;p&gt;¿Cómo lo implemento? Escapando y validando todo contenido dinámico, y usando cabeceras como Content-Security-Policy (CSP).&lt;/p&gt;

&lt;p&gt;¿Qué previene? Robos de cookies, datos sensibles o redirecciones a sitios falsos.&lt;br&gt;
👉 &lt;em&gt;Ejemplo: _Un usuario malicioso logra insertar código en una página pública. Cada visitante que entra ejecuta ese código sin saberlo. La validación de datos y CSP evitan que contenido no confiable se ejecute en el navegador..&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 En resumen
&lt;/h2&gt;

&lt;p&gt;Tus APIs son como una casa llena de objetos valiosos: datos, usuarios y procesos de negocio. Si dejas la puerta abierta, tarde o temprano alguien entrará.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rate Limiting&lt;/strong&gt; &lt;em&gt;es el control de acceso al servicio.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CORS&lt;/strong&gt; &lt;em&gt;es la lista de invitados en tu fiesta.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL Injection&lt;/strong&gt; &lt;em&gt;son formularios llenados con trampas.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firewalls&lt;/strong&gt; &lt;em&gt;son tus guardias en la entrada.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPNs&lt;/strong&gt; &lt;em&gt;son pasadizos secretos.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSRF&lt;/strong&gt; &lt;em&gt;son firmas falsas en contratos.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XSS&lt;/strong&gt; &lt;em&gt;son mensajes escondidos en tus cajas de cereal.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🔐 Implementar estas medidas no significa que tu API será invulnerable, pero sí que tendrás varias capas de defensa. Como en la vida real, no basta con solo cerrar la puerta: necesitas cerradura, alarma, cámaras y, si es posible, un buen perro guardián 🐶.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>backend</category>
    </item>
    <item>
      <title>gojs for dummies (para mi :D) #Español</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Mon, 10 Apr 2023 21:24:27 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/gojs-for-dummies-para-mi-d-espanol-3d55</link>
      <guid>https://dev.to/julio_santacruz/gojs-for-dummies-para-mi-d-espanol-3d55</guid>
      <description>&lt;h1&gt;
  
  
  Que es GoJS?
&lt;/h1&gt;

&lt;p&gt;Partamos dede el principio &lt;strong&gt;GoJS es una biblioteca de JavaScript&lt;/strong&gt; que te permite crear &lt;strong&gt;diagramas o elementos interactivos 100% del lado del cliente.&lt;/strong&gt;  &lt;strong&gt;GoJS&lt;/strong&gt; admite templates para todos los elementos gráficos y uniónes de datos con propiedades de objetos gráficos para modelar datos. &lt;strong&gt;Solo necesita guardar y restaurar el modelo&lt;/strong&gt;. El modelo de gojs  consta de objetos simples de JavaScript, y tienen integracion con todos los frameworks de Frontend (React - Angular -Vue). Tiene muchas herramientas y comandos predefinidos, que implementan los comportamientos estándar que necesitan la mayoría de los diagramas. &lt;br&gt;
&lt;strong&gt;&lt;em&gt;La personalización de la apariencia y el comportamiento es principalmente una cuestión de establecer propiedades.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mbo2AMpD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jff68a6qkx17eplkeigx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mbo2AMpD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jff68a6qkx17eplkeigx.jpg" alt="yo mirando gojs" width="750" height="500"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Tu primer diagrama con GoJS - React
&lt;/h2&gt;

&lt;p&gt;Para crear tu primer diagrama con React y GoJs debes iniciar un projecto de react e instalar :&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`npm install gojs gojs-react`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;El siguiente paso seria crear el componente del elemento, primero debemos importar ReactDiagram de gojs-react&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;ReactDiagram&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="s1"&gt;gojs-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;y lo llamamos con los siguientes argumentos&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;ReactDiagram&lt;/span&gt;
        &lt;span class="nx"&gt;initDiagram&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;divClassName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;diagram-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="nx"&gt;nodeDataArray&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;linkDataArray&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;onModelChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="sr"&gt;/&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;El siguiente paso sera asignarle un unos estilos al elemento div para que el canvas sea visible&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* App.css */&lt;/span&gt;
&lt;span class="nc"&gt;.diagram-component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&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;Ahora vamos escribir una funcion que que inicia el diagrama ( initDiagram )&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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;initDiagram&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;$&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GraphObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;make&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Para establecer la licencia declaramos go.Diagram.licenseKey = "..."; (no es necesaria una licencia durante el desarrollo)&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;diagram&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Diagram&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undoManager.isEnabled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// Esta propiedad nos permite interactuar con el modelo&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undoManager.maxHistoryLength&lt;/span&gt;&lt;span class="dl"&gt;'&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;// si comentas esta propiedad deshabilitas el historial (undo / redo) &lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;clickCreatingTool.archetypeNodeData&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="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;new node&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lightblue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GraphLinksModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;linkKeyProperty&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;  &lt;span class="c1"&gt;// IMPORTANTE -&amp;gt; Esta propiedad nos permite vincular los datos con GraphLinksModel&lt;/span&gt;
          &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="c1"&gt;// Aqui definimos el Template para los nodos &lt;/span&gt;
  &lt;span class="nx"&gt;diagram&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeTemplate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Auto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// Declaramos un nodo &lt;/span&gt;
      &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Binding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;location&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="s1"&gt;loc&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Point&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;makeTwoWay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Point&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
      &lt;span class="c1"&gt;// creamos un vinculo llamado "loc" para asignar "location" desde nuestro modelo&lt;/span&gt;
      &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Shape&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RoundedRectangle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// dentro del nodo creamos una figura "RoundedRectangle" &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="s1"&gt;SHAPE&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;white&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;strokeWidth&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="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Binding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fill&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="s1"&gt;color&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="c1"&gt;// vinculamos el parametro fill a la propiedad color dentro del modelo &lt;/span&gt;
      &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;TextBlock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
      &lt;span class="c1"&gt;// Creamos un texto dentro de la figura que declaramos antes&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;editable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  &lt;span class="c1"&gt;// le asignamos un margin de 8 y lo hacemos editable&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Binding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;makeTwoWay&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Vinculamos la variable text para asignar el texto desde el modelo&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="nx"&gt;diagram&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;Vamos a crear un array de objetos para ser mostrados en nuestro diagrama&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DataArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&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="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Alpha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lightblue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0 0&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="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Beta&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orange&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;150 0&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="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Gamma&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lightgreen&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0 150&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="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Delta&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pink&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;150 150&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Esto podria ser suficiente par visualizar los datos e interactuar con ellos... pero nosotros queremos hacer de diagrama, entonces debemos de crear un array de datos para unir los datos del DataArray&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;LinkDataArray&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&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="na"&gt;from&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="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;from&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="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;to&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="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Por ultimo vamos a crear una funcion que meneje eventos&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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleModelChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;changes&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="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GoJS model changed!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;changes&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;vamos a integrar lo anterior a nuestro diagrama&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;ReactDiagram&lt;/span&gt;
        &lt;span class="nx"&gt;initDiagram&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;initDiagram&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;divClassName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;diagram-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="nx"&gt;nodeDataArray&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;DataArray&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;linkDataArray&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LinkDataArray&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;onModelChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;handleModelChange&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="sr"&gt;/&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;Este este ejemplo lo puedes encontrar en &lt;a href="https://gojs.net/latest/intro/react.html#stateful"&gt;react-gojs basic&lt;/a&gt; &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Typescript for noobs</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Sat, 21 Jan 2023 04:22:19 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/typescript-for-noobs-16md</link>
      <guid>https://dev.to/julio_santacruz/typescript-for-noobs-16md</guid>
      <description>&lt;p&gt;If you are reading this post maybe it's because you want to try Typescript or like in my case you must learn it for a Job.&lt;/p&gt;

&lt;p&gt;I'm writing this post because it helps to retain knowledge and works like notes for the future me.&lt;/p&gt;

&lt;p&gt;Let 's start....&lt;/p&gt;




&lt;h2&gt;
  
  
  Why should you learn Typescript..?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It is one of the programming languages most loved by the community.&lt;/li&gt;
&lt;li&gt;It has a very High adoption rate. &amp;lt;---- Look at the next image&lt;/li&gt;
&lt;li&gt;We can prevent many JS errors &amp;lt;---- This one it's relevant.&lt;/li&gt;
&lt;li&gt;Better development experience &amp;lt;---- I'm not sure.&lt;/li&gt;
&lt;li&gt;Less amount of bugs &amp;lt;---- This one it's true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ybvjsh6ows9ic33j1tu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ybvjsh6ows9ic33j1tu.jpg" alt="TypeScript chart" width="800" height="611"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  TypeScript vs JavaScript
&lt;/h2&gt;

&lt;p&gt;Well in some way typescript it's the poke-evolution of javascript.&lt;br&gt;
Typescript it's like javascript with extra steps, security steps, those steps help us to find errors in the development process.. but how do they work?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyf5inlbyqfx6xtlngn0p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyf5inlbyqfx6xtlngn0p.png" alt="javascript with extra steps" width="618" height="770"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  TypeScript... How does it help?
&lt;/h2&gt;

&lt;p&gt;---&amp;gt; Static analysis (This is where TS plays its role)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run in the editor.&lt;/li&gt;
&lt;li&gt;You can find typos, wrong calls to functions.&lt;/li&gt;
&lt;li&gt;Forces you to write well-done code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;---&amp;gt; Unit Tests&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In a few seconds they allow us to verify if our code does what we think it does.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;---&amp;gt; Integration tests&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It takes a few minutes to validate if our system works.&lt;/li&gt;
&lt;li&gt;We can find different borderline cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;---&amp;gt; Code review&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It takes a few hours to validate that we are following the practices and standards of our team.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  TypeScript... How does it work?
&lt;/h2&gt;

&lt;p&gt;Well, the Browsers and Node.js do not natively recognize TypeScript files, what you need to do is transpile your code from .ts to .js.&lt;/p&gt;

&lt;p&gt;In our .ts files we are going to have the classes, interfaces, modules and types. The transpiler will convert the code into .js that will be able to run anywhere. In addition, the transpiler allows us to choose which version of ECMAScript we are going to translate our code to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4myi7uz7qyernsqu5r51.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4myi7uz7qyernsqu5r51.jpg" alt="Typescript workflow" width="800" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, you can install typescript with npm and the recommendation it is install with the flag --dev-save&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install typescript --dev-save&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once it is install you should run the next &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx tsc --init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will create our tsconfig.json, with this file you can customize your ts enviroment&lt;/p&gt;


&lt;h2&gt;
  
  
  One of the extra steps [type annotation]
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffcavx8nqmqw9ai11itv7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffcavx8nqmqw9ai11itv7.jpg" alt="Type Annotation" width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For typescript defining the data type is very important, to the point of assuming the data type automatically and this is called 'inferred types'.&lt;/p&gt;

&lt;p&gt;but it is better that we set the type, and we can do it as follows&lt;/p&gt;
&lt;h3&gt;
  
  
  Number
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  //type inferred 
  let dato = 100
  dato = 30
  console.log("dato:",dato)


  //type asigned
  let dato2:number = 20
  dato2 = 30
  console.log("dato2 :",dato2)


  //type asigned but not defined
  let dato3:number;
  //typescript want to prevent an undefined on dato3 
  console.log("dato3:",dato3)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;remember &lt;br&gt;
&lt;code&gt;number !== Number&lt;/code&gt;&lt;br&gt;
number it's a type, Number it's a object&lt;/p&gt;


&lt;h3&gt;
  
  
  Boolean
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  // Type inferred
let isReady = true

// Type asigned
let isEnable: boolean=true

// Cannot be null or undefind
let isNew:boolean   // = undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Strings
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
  // Type inferred
  let myString = 'hello';

  // Type asigned
  let myString2:string = 'hello';  // '' &amp;lt;--- string
  let anotherString:string = "hello :D"; // "" &amp;lt;--- string
  let lolesString:string = `this is a string to ${myString}`; // ``&amp;lt;---- string

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Arrays
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Type inferred
// typescript is inferring that we only have numeric values in the array
let arrNumbers = [1,2,43,3,5,34,3,23,2,2]
// we can only use array methods with numbers
arrNumbers.push(2)

// typescript is inferring that we have numeric, string and boolean values in the array
let arrAnother = [4,3,23,2,2,'sdf',true]
// we can only use array methods with numbers, strings and booleans
arrAnother.push('lol')

let mixed: (number|string|boolean|undefined|Object)[]= ['lol',3,'yes',false, undefined]
mixed.push(23)
mixed.push('lolxD')
mixed.push(true)
mixed.push([])
mixed.push({})

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

&lt;/div&gt;

&lt;h2&gt;
  
  
  What is any?
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  //With any we can change the type for ANY one :D
  let myDynamicVar:any
  myDynamicVar=100
  myDynamicVar='lol'
  myDynamicVar=[]
  myDynamicVar={}

// any is not recommended to use
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This data type disables TS typing and allows us to reassign the data type of a variable.&lt;/li&gt;
&lt;li&gt;It is not recommended to use &lt;code&gt;any&lt;/code&gt;, because we lose the possibility of catching any error and basically we are using javascript. However, if we are migrating code from JS to TS it can be useful, but once we have a consolidated project with TypeScript, we should never use &lt;code&gt;any&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8g5jyrva9eql3odfa0hl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8g5jyrva9eql3odfa0hl.jpg" alt="typescript any meme" width="477" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can convert the 'any' type to any other data type by casting it with the 'as' operator or by using '' generics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myDynamicVar = 'Hola';
const rta = (myDynamicVar as string);
console.log(rta);

myDynamicVar2 = 1212;
const rta2 = (&amp;lt;number&amp;gt;myDynamicVar2);
console.log(rta2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>api</category>
      <category>programming</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Gatsby for beginners pt1</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Mon, 21 Nov 2022 19:40:26 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/gatsby-for-beginners-pt1-5e11</link>
      <guid>https://dev.to/julio_santacruz/gatsby-for-beginners-pt1-5e11</guid>
      <description>&lt;p&gt;Hello there..!&lt;/p&gt;

&lt;p&gt;Now I want to tell you about Gatsby... Yes it's a JavaScript Framework, yes it uses React to. Well let me start and if you have questions put it on the comment section and I'll look for it... Maybe some day...&lt;/p&gt;

&lt;h1&gt;
  
  
  Gatsby...?
&lt;/h1&gt;

&lt;p&gt;Gatsby is a React-based Framework, designed to preformat static websites from your React-app (It's a statis site generator that used React, GraphQL and webpack)&lt;/p&gt;

&lt;p&gt;Yes, there are other frameworks that works the same, like NEXT.js but it's not the same...  &lt;/p&gt;

&lt;p&gt;The main benefits of the usages of static site like Gatsby are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Loading Speed&lt;/li&gt;
&lt;li&gt;Search Engine Optimization (SEO)&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Gatsby Ecosystem
&lt;/h2&gt;

&lt;p&gt;Well parentally it's big, but its hard to say how big it is... according to stack overflow survey only 3.77% choose Gatsby as web technology they used professionally, more then Drupal but lees then NUXT... &lt;br&gt;
I must say that until now I have not found a negative review.&lt;/p&gt;
&lt;h1&gt;
  
  
  Let's Start a Project
&lt;/h1&gt;

&lt;p&gt;there are many way to start a project with Gatsby, lets check three of them...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only Gatsby&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this method we only require to install react and gatsby&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react react-dom gatsby
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Gatsby with the CLI (like 'create-react-app')&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This option make a full project sample with config files and a 'src' directory and it's ready for us to modify.&lt;/p&gt;

&lt;p&gt;First we need to install Gatsby CLI&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g gatsby-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with this were are available to create a new project using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gatsby new &amp;lt;name-of-your-project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Using a Starter
A starter it's like a theme template based project, that you can personalize for your convenience. There are free to used and you can find them &lt;a href="https://www.gatsbyjs.com/starters/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.
To install one you need to have the name of the starter and the name of the user that made it
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gatsby new &amp;lt;name-of-your-project&amp;gt; &amp;lt;name-of-user&amp;gt;/&amp;lt;name-of-starter&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Gatsby Router
&lt;/h1&gt;

&lt;p&gt;Gatsby Router is simple to use, in this case simple is better...&lt;br&gt;
Each file in the pages folder is a page&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphpdz3o9c0p9csmm8y81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphpdz3o9c0p9csmm8y81.png" alt="Image description" width="294" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To navigate between the pages we must use the Link component of gatsby and assign it the parameter 'to=//'&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe9elh4ckpoc6elevo6kd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe9elh4ckpoc6elevo6kd.png" alt="Image description" width="535" height="416"&gt;&lt;/a&gt;&lt;br&gt;
The importance of this last images it is the component 'Link', the component Button it is only a styled button&lt;/p&gt;

</description>
      <category>español</category>
    </item>
    <item>
      <title>Dude, do the initial Git configuration</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Thu, 29 Sep 2022 07:41:06 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/dude-do-the-initial-git-configuration-1oao</link>
      <guid>https://dev.to/julio_santacruz/dude-do-the-initial-git-configuration-1oao</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Hello, Let me tell you that I just restarted my work computer, why is this relevant? because I lost all my settings and it's time to configure them again. I imagine you got an idea with the title, we will see the initial git configurations, the ones I need to start working.&lt;/p&gt;

&lt;p&gt;I hope this publication is useful to you, I am sure it will be useful for my future self.&lt;/p&gt;

&lt;h2&gt;
  
  
  what is Git?
&lt;/h2&gt;

&lt;p&gt;Git is a free and &lt;em&gt;open source distributed&lt;/em&gt; &lt;strong&gt;version control system&lt;/strong&gt; designed to handle everything from small to very large projects with speed and efficiency. there is more software for version control, but git is the one I like to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial Configuration
&lt;/h2&gt;

&lt;p&gt;First of all, to start a new repository we can use the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's set the user information (us).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.email "your@email.com"
git config --global user.name "your_name"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To find where the settings are stored we can use the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --list --show-origin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git works with branches, I'm sure you already know that, as I write this, the default name of the main branch is 'master'. By convention we could call it 'main', let's see how to change the name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -m old_name new_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to ensure that all projects start with the main branch name 'main'&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global init.defaultBranch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  BONUS
&lt;/h2&gt;

&lt;p&gt;For bonus we are going to connect our project to a repository in GITHUB. As a first step we are going to set the 'origin'&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin repository_URL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify that the URL was saved correctly&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fetch the latest version from the remote repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if there is an error for different versions we can add the flag '---allow-unrelated-histories'&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull origin main --allow-unrelated-histories
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, to send our information to the remote repository we can do git push and save the changes from our local repository to GitHub&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Things all JavaScript beginners should know (Updated)</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Tue, 06 Sep 2022 05:07:23 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/things-all-javascript-beginners-should-know-1o7o</link>
      <guid>https://dev.to/julio_santacruz/things-all-javascript-beginners-should-know-1o7o</guid>
      <description>&lt;h1&gt;
  
  
  Hello
&lt;/h1&gt;

&lt;p&gt;I'm currently looking for my first job as a frontend developer, I've been doing some technical interviews and they actually ask these questions (I took these questions from an instagram post). So I'll be looking for the answers and really understanding this topic.&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Note. I already know some answers, but I will be updating this post from time to time. If you feel like collaborating with any answers, feel free to share in the comments.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  1. What is the use of windows object?
&lt;/h2&gt;

&lt;p&gt;The window object is a representation of the 'window' browser, the space were you navigate, it is created automatically by the browser, &lt;strong&gt;It is not a JavaScript Object&lt;/strong&gt;... &lt;br&gt;
The window object have a lot of his own properties and methods, y bet you know some of them... &lt;br&gt;
|  Properties | Methods     |&lt;br&gt;
| ----------- | ----------- |&lt;br&gt;
|  console    | alert()     |&lt;br&gt;
|  innerWidth | prompt()    |&lt;br&gt;
| InnerHeight | setTimeout()|&lt;br&gt;
|  scrollY    | confirm()   |&lt;/p&gt;




&lt;h2&gt;
  
  
  2. What are the different data types present in JavaScript?
&lt;/h2&gt;

&lt;p&gt;Data types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Boolean Type // true | false&lt;/li&gt;
&lt;li&gt;Null Type // null&lt;/li&gt;
&lt;li&gt;Undefined Type // undefined&lt;/li&gt;
&lt;li&gt;Number Type // 123&lt;/li&gt;
&lt;li&gt;BigIng Type // 123456789023456767766n&lt;/li&gt;
&lt;li&gt;String Type // 'hello world'&lt;/li&gt;
&lt;li&gt;Symbol Type &lt;/li&gt;
&lt;li&gt;Object Type // {}&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. What is the difference between undefined value and null value?
&lt;/h2&gt;

&lt;p&gt;Undefined is a vaiable that refers to &lt;strong&gt;something that doesn't exist&lt;/strong&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  4. What is this [[[]]]?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What are classes in ES^?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. What are the difference between cookie, local storage and session storage?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What is the difference between setIntervals and setTimeout?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What are arrow functions? How are they different from normal functions?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. What is this keyword?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. What are promises? How do you call a promise?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  11. What is the difference between observables &amp;amp; promises?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  12. What is callback hell?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Explain closures
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  14. What are pure functions?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  15. Difference between == and ===
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  16. How to access DOM elements using js?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  17. What are higher order fuctions?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  18. Explain desctructing in Javascript
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  19. What are spread and rest operators?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  20. What is even propagation event capturin, even bubbling?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  21. What is function currying?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  22. Difference between let and var
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  23. Difference between call, apply and bind
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  24. What is event loop ?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  25. What is weakMap and weakSet?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  26. What is the difference betwwin a function parameter and an argunment?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  27. What is function execution context &amp;amp; global execution context
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  28. What is scope in JavaScript?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  29. How to create an array? List some of array methods
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  30. What is hoisting?
&lt;/h2&gt;

&lt;p&gt;&amp;lt;-&amp;gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>frontend</category>
    </item>
    <item>
      <title>ECMAScript o JavaScript?</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Sat, 03 Sep 2022 03:39:55 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/ecmascript-o-javascript-272g</link>
      <guid>https://dev.to/julio_santacruz/ecmascript-o-javascript-272g</guid>
      <description>&lt;p&gt;Este no es un post ordinario, aquí voy a colocar notas de estudio de este tema tan basto que es JavaScript, o si tu vienes para saber que es ECMAScript puedes bajar unos cuantos párrafos, que hoy vamos empezar desde el inicio de los tiempos...&lt;/p&gt;

&lt;h2&gt;
  
  
  Historia de JavaScript
&lt;/h2&gt;

&lt;p&gt;Antes de que se escribiera la primer linea de código de JS, en 1950 empezaba a nacer la computación moderna, la primeras computadoras eran enormes cajas de metal que solo podían ser adquiridas por grandes empresas, estas cajas que ahora son obsoletas se utilizaban para realizar enormes cantidades de cálculos, principalmente útiles para el sector militar. &lt;/p&gt;

&lt;p&gt;[ *Dato curioso = Un teléfono inteligente actual tiene mas poder de calculo y procesamiento que la computadora utilizada en el alunizaje ]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g-qzvjw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://upload.wikimedia.org/wikipedia/commons/e/e2/Dsky.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g-qzvjw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://upload.wikimedia.org/wikipedia/commons/e/e2/Dsky.jpg" alt="El Apollo Guidance Computer fue un componente fundamental del programa Apolo. Proporcionaba la capacidad de cálculo necesaria para controlar la orientación y la navegación del módulo de mando y del módulo lunar." width="880" height="826"&gt;&lt;/a&gt;&lt;br&gt;
El Apollo Guidance Computer fue un componente fundamental del programa Apolo. Proporcionaba la capacidad de cálculo necesaria para controlar la orientación y la navegación del módulo de mando y del módulo lunar. Módulo de memoria volátil de 1024 bits del AGC del Apolo&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b3AfBIXB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://conceptodefinicion.de/wp-content/uploads/2014/08/smartphone.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b3AfBIXB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://conceptodefinicion.de/wp-content/uploads/2014/08/smartphone.jpg" alt="Image description" width="628" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahora en 1969 se creo la red ARPANET, este fue el primer protocolo para conectar dos computadoras. Este y otros protocolos se siguieron desarrollando entre 1970 - 1990, en 1990 Tim Berners-lee creo la world wide web, fue un forma nueva acceder a documentos, archivos o enlaces para navegar a otros lugares. &lt;/p&gt;

&lt;p&gt;En 1993 se creo Mosaic, fue el primer navegador de internet de fácil acceso. &lt;/p&gt;

&lt;p&gt;En 1995 Microsoft lanzo internet explorer, dando inicio a los browser wars, esta guerra inicia con internet explorer vs Netscape, en los siguientes anios luego se fueron agregando chrome, Firefox y safari. &lt;/p&gt;

&lt;p&gt;Dentro de Netscape nace JavaScript en 1995, por su lado Microsoft lanzo JScript, debido a esto en 1997 nace ECMA---&amp;gt;(European Computer manufacturer Association). ECMAScript es el estándar que se encarga de establecer como debe ser interpretado y debe funcionar JavaScript....&lt;/p&gt;

&lt;p&gt;ECMAScript es el estándar ----&amp;gt; JavaScript es el lenguaje&lt;/p&gt;

&lt;h2&gt;
  
  
  ECMAScript o JavaScript?
&lt;/h2&gt;

&lt;p&gt;Si quieres aportar al lenguaje con ideas, implementaciones o nuevos métodos te puedes dirigir a la TC39 ----&amp;gt; Technical Committee No 39. Este comité se encarga de aceptar e implementar cambios al lenguaje.&lt;/p&gt;

&lt;p&gt;Cuando hay cambios al lenguaje se creo un lanzamiento denominado ESxx, En 1997 se lanzo ES1 (primer ajuste), en el 2005 se lanzo ES5, en el 2018 se lanzo el ES9 ( ECMAScript 9)&lt;/p&gt;

&lt;p&gt;La ultima version es ES2022 &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>spanish</category>
    </item>
    <item>
      <title>Como puedo centrar un &lt; div &gt; ...?</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Sun, 14 Aug 2022 06:30:00 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/como-puedo-centrar-un--4ke2</link>
      <guid>https://dev.to/julio_santacruz/como-puedo-centrar-un--4ke2</guid>
      <description>&lt;h1&gt;
  
  
  Vamos a centrar un div
&lt;/h1&gt;

&lt;p&gt;En esta entrada te muestro tres métodos diferentes para centrar el contenido de un div like a pro &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s34vZOFq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlaa3ubs6p807ujdb7a6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s34vZOFq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlaa3ubs6p807ujdb7a6.jpg" alt="Image description" width="837" height="836"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Los métodos para centrar &amp;lt; div &amp;gt; son:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;position: absolute;&lt;/li&gt;
&lt;li&gt;display: flex;&lt;/li&gt;
&lt;li&gt;display: grid;&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Position: absolute..?
&lt;/h1&gt;

&lt;p&gt;La propiedad 'position' de CSS especifica la manera en que un elemento es posicionado en el DOM. Las propiedades que tenemos disponibles son: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;top, right, bottom, left&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Estas propiedades establecen la position final de los elementos. Existen varios tipos de position, los mas comunes son.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;static, relative, absolute, sticky&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Centrar &amp;lt; div &amp;gt; con position: absolute;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    div{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50, -50);
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Display: flex...?
&lt;/h1&gt;

&lt;p&gt;Desde el inicio, display flex es parte de FlexBox, es un set de propiedad 'nuevas' de HTML5, nos permite maquetar nuestros proyectos web de una manera mas sencilla e intuitiva (es mi propiedad favorita). FlexBox funciona como un elemento contenedor (flex container) que ordena y posiciona todos los elementos contenidos segun se le indique. &lt;/p&gt;

&lt;h2&gt;
  
  
  Centrar un &amp;lt; div &amp;gt; con display: flex;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    div{
        display: flex;
        align-items: center;
        justify-content: center;
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Display: grid...?
&lt;/h1&gt;

&lt;p&gt;A mi manera de entender como funcionan las cosas puedo decir que grid y flex son iguales y tienen el mismo objetivo, pero funcionan de manera diferente. Las propiedades Grid también se crearon para HTML5 y funciona como una cuadricula. &lt;/p&gt;

&lt;h2&gt;
  
  
  Centrar un  con display: grid;


&lt;/h2&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    div{
        display: grid;
        display: grid;  
        justify-content: center;  
        align-content: center;
        }
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;o&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div{
    display: grid;
    place-items: center;
    {
&lt;/code&gt;&lt;/pre&gt;



</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>spanish</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Accesibilidad WEB..? Tienes que saber esto..!</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Wed, 27 Jul 2022 21:09:00 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/accesibilidad-web-tienes-que-saber-esto-2d70</link>
      <guid>https://dev.to/julio_santacruz/accesibilidad-web-tienes-que-saber-esto-2d70</guid>
      <description>&lt;h2&gt;
  
  
  Que es accesibilidad web ?
&lt;/h2&gt;

&lt;p&gt;La accesibilidad web es la practica continua de asegurarnos que todo lo que creamos para la web se puede usar, interpretar y operar por una variedad de personas en una variedad de situaciones.&lt;/p&gt;

&lt;p&gt;Cuando hablamos de accesibilidad o un diseño accesible nos enfocamos principalmente en el Frontend, el diseño web/interfaz de proyecto es el encargado de cumplir con estándares para ser legible por cualquier persona, incluyendo a personas con discapacidad visual, auditiva, física, cognitiva, neurológica y del habla.&lt;/p&gt;

&lt;p&gt;Lectura de interés ---&amp;gt; &lt;a href="http://www.conapred.org.mx/depositobv/CARPETA-WEB_ACCESIBLE.pdf"&gt;Acciones para un sitio accesible en MEXICO&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;a11y&lt;/strong&gt; --&amp;gt; es el numeronimo de accessibility&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Por que es importante la accesibilidad web ?
&lt;/h2&gt;

&lt;p&gt;Implementar un diseño accesible para todos los usuarios es importante para incluir a personas en situaciones de discapacidad, incluso en algunos lugares es requerido por ley.&lt;/p&gt;

&lt;p&gt;Ejemplo en EEUU existe una ley que menciona que, si tus usuarios están en el país, ellos tienen el derecho de que todos los productos o servicios que ellos desean utilizar sean accesibles.&lt;/p&gt;

&lt;p&gt;Existen casos como el de Domino’s Pizza, que fue denunciado por qué el sitio no era accesible y un ciudadano los demando por eso, terminaron siendo multados millones de dólares.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Americans with Disabilities Act (ADA) became law in 1990.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Quien regular la accesibilidad ?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;WCAG&lt;/strong&gt; ---&amp;gt; Web Content Accessibility Guidelines (Guía de Accesibilidad para el Contenido Web). Esta Guía fue creada por la W3C (World Wide Web Consortium) a través de la WAI (Web Accessibility Initiative)&lt;/p&gt;

&lt;p&gt;---&amp;gt; Actualmente esta iniciativa va en la &lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/es"&gt;version 2.0&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Como se mide la accesibilidad ?
&lt;/h2&gt;

&lt;p&gt;La accesibilidad se mide en tres niveles&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] &lt;strong&gt;A&lt;/strong&gt; - Es el nivel mas bajo, es una accesibilidad basica para nuestros proyectos.&lt;/li&gt;
&lt;li&gt;[ ] &lt;strong&gt;AA&lt;/strong&gt; - Es el nivel intermedio&lt;/li&gt;
&lt;li&gt;[x] &lt;strong&gt;AAA&lt;/strong&gt; - Es el nivel mas alto, este nivel es la meta para paginas de universidades y gobiernos. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cuales son las Pautas WCAG 2.0?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Perceptible
&lt;/h3&gt;

&lt;p&gt;Los criterios de conformidad bajo este principio se enfocan en asegurar que todo el contenido que es importante se pueda interpretar de varias maneras.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operable
&lt;/h3&gt;

&lt;p&gt;Cuando hablamos de ser operable, queremos asegurarnos que nuestro sitio es fácil de usar y navegar, que se puede navegar de diferentes maneras y con mouse y/o teclado&lt;/p&gt;

&lt;h3&gt;
  
  
  Comprensible
&lt;/h3&gt;

&lt;p&gt;Hacer que nuestro sitio web sea comprensible nos asegura que un rango de personas lo pueden usar, desde la persona que vive con una discapacidad mental que necesita patrones comunes para saber cómo usar la web hasta la persona que va de carrera y necesita consultar algo rápido&lt;/p&gt;

&lt;h3&gt;
  
  
  Robusto
&lt;/h3&gt;

&lt;p&gt;Cuando hacemos productos que funcionan en muchos lados, abrimos las posibilidades que cualquier persona los use sin importar su ubicación, máquina, navegador o condición&lt;/p&gt;

&lt;h2&gt;
  
  
  Como puedo implementarlo ?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  HTML Semántico
&lt;/h3&gt;

&lt;p&gt;Tal vez a ti como a mi nos mencionaron mucho de la importancia de una estructura de HTML semántico, aquí todo toma sentido.&lt;/p&gt;

&lt;p&gt;Para que la web sea accesible se han desarrollado varios tipos de programas especiales para que personas con alguna discapacidad física puedan navegar la web, por ejemplo, un lector de pantalla. Este tipo de programas lo que hacen es leer las etiquetas de HTML y darles jerarquía para la lectura en voz alta. Por ejemplo, en la etiqueta &amp;lt; head &amp;gt; colocamos meta información que no se lee en voz alta, en &amp;lt; body &amp;gt; tenemos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&amp;lt; h1, ..., h6 &amp;gt;,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;lt; img &amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;lt; a &amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;lt; buttons &amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;lt; sections &amp;gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;y más etiquetas que nos organizan la información, algunos si se leerán en voz alta, incluso el atributo "alt" de una imagen debe ser una breve descripción de la imagen para quien no puede ver la imagen&lt;/p&gt;

&lt;p&gt;&amp;lt; img src=" .../nombre.jpg " alt="breve descripción de imagen" &amp;gt;&lt;/p&gt;

&lt;p&gt;a continuación te dejo un ejemplo de una estructura de HTML semántico&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt; .... &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;header&amp;gt; ... &amp;lt;/header&amp;gt; 
&amp;lt;main&amp;gt; 
    &amp;lt;section&amp;gt; ... &amp;lt;/section&amp;gt;
    &amp;lt;section&amp;gt; 
        &amp;lt;article&amp;gt; ... &amp;lt;/article&amp;gt;
     &amp;lt;/section&amp;gt;
 &amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Html no semántico&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt; .... &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div&amp;gt; ... &amp;lt;/div&amp;gt; 
&amp;lt;div&amp;gt; 
    &amp;lt;div&amp;gt; ... &amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt; 
        &amp;lt;div&amp;gt; ... &amp;lt;/div&amp;gt;
     &amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Por último debes saber que existe unos atributos 'aria' para todo tu HTML, aria es un acrónimo&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Accessible Rich Internet Applications&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pronto hare una publicación hablando solo de los atributos 'aria'&lt;/p&gt;

&lt;h3&gt;
  
  
  CSS Legible
&lt;/h3&gt;

&lt;p&gt;Con CSS Legible no me refiero a la facilidad de leer el código CSS, me refiero a que este de los estilos correctos para nuestro proyecto, haciendo contraste correcto de los colores, textos guía para elementos como iconos que puedan no ser de uso común, aplicación de un skip links, definición de estilos 'focus y hoves' para elementos importantes, entre otros.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS Estilizado &lt;/li&gt;
&lt;li&gt;JavaScript Funcional&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>spanish</category>
      <category>html</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Como subir tu proyecto de React a GitHub Pages</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Fri, 27 May 2022 06:31:05 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/como-subir-tu-proyecto-de-react-a-github-pages-31fg</link>
      <guid>https://dev.to/julio_santacruz/como-subir-tu-proyecto-de-react-a-github-pages-31fg</guid>
      <description>&lt;h2&gt;
  
  
  Introducción
&lt;/h2&gt;

&lt;p&gt;En esta ocasión de mostrare como hacer deploy de tu proyecto de react al servidor de paginas estáticas de github pages. Si sabes que es react seguramente sabrás que GitHub y tendrás tu cuenta, si es así  &lt;a href="https://github.com/aramxD/"&gt;sígueme en github&lt;/a&gt;. Por otro lado Github Pages es un servicio adicional de hosting de paginas estáticas (solo HTML, JavaScript y CSS) que &lt;strong&gt;NO FUNCIONA COMO SERVIDOR BACKEND&lt;/strong&gt;, es un servicio gratuito y sencillo de usar.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparación
&lt;/h2&gt;

&lt;p&gt;Antes de iniciar el proceso de deploy en GitHub Pages debes tener lo siguiente:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Cuenta de GitHub&lt;/li&gt;
&lt;li&gt;[x] Git instalado en tu computadora&lt;/li&gt;
&lt;li&gt;[x] Proyecto web en su repositorio en GitHub&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Instalación de gh-pages
&lt;/h2&gt;

&lt;p&gt;El primer paso será instalar el paquete gh-pages que nos ayudara a convertir el código de react a archivos estáticos que nos acepte el hosting &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev gh-pages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;recuerda que las banderas "--save-dev" asignan la instalación como dependencias de desarrollo. Una vez que se haya instalado verifica en el archivo package.json que se haya agregado el paquete&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;},
...
"devDependencies": {
    "gh-pages": "^4.0.0"
    }
...
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Configuración package.json
&lt;/h2&gt;

&lt;p&gt;Para configurar nuestro archivo package.json debemos agregar las siguientes reglas, la primera será &lt;strong&gt;homepage&lt;/strong&gt; la vamos agregar después de "&lt;strong&gt;devDependencies&lt;/strong&gt;"&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; },
...
"devDependencies": {
    "gh-pages": "^4.0.0"
    },
 "homepage": "https://USUARIO_GITHUB.github.io/NOMBRE_DE_REPOSITORIO"
...
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Para esta regla de "homepage" es importante que coloques TU usuario de github y el nombre del repositorio que estas utilizando, por ejemplo&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"homepage": "https://aramxD.github.io/react-fetch-exercise"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Ahora vamos a agregar un par de scripts,  llamados "predeploy" y "deploy" que nos ayudara a preparar nuestra aplicación para subirla a los servidores de GitHub&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;},
"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    ...
    "predeploy":"npm run build",
    "deploy": "gh-pages -d build
    ...
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;No olvides guardar los cambios&lt;/p&gt;

&lt;h2&gt;
  
  
  Ejecutamos Deploy
&lt;/h2&gt;

&lt;p&gt;Con los scripts preparados ejecutamos en nuestra terminar el script "deploy"&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;No olvides que la terminal debe esta en la carpeta de nuestro proyecto.&lt;br&gt;
Una vez que termine la ejecución de nuestro comando, podrás ver que se creo una carpeta llamada "build"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ADV0zoMK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/45tglu65gkxtbgyndoxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ADV0zoMK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/45tglu65gkxtbgyndoxg.png" alt="carputa build" width="196" height="567"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;En esta carpeta encontraras lo archivos estáticos de nuestro proyecto&lt;/p&gt;

&lt;h2&gt;
  
  
  Commit y push
&lt;/h2&gt;

&lt;p&gt;Para finalizar debemos guardar los cambios y agregarlos a nuestro repositorio, primero agregamos los cambios con:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;lo siguiente será crear el commit con los cambios&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m"deploy ready"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;para finalizar enviamos los cambios al repositorio con "push"&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin master&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Resultados&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Para comprobar que todo haya salido bien, entra a tu repositorio y dirígete a settings, en el lado izquierdo encontraras el apartado de &lt;strong&gt;Pages&lt;/strong&gt; ahí encontraras el link publico de tu proyecto.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6rMHREAg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jp8t19ha3roqc53f17j6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6rMHREAg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jp8t19ha3roqc53f17j6.png" alt="github settings" width="880" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nota: En ocasiones es necesario esperar unos minutos para que se actualicen los servidores de GitHub Pages y se muestre nuestro proyecto&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>github</category>
      <category>spanish</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Debes nombrar tus Áreas CSS Grid</title>
      <dc:creator>Julio Santacruz</dc:creator>
      <pubDate>Mon, 23 May 2022 19:51:27 +0000</pubDate>
      <link>https://dev.to/julio_santacruz/debes-nombrar-tus-areas-css-grid-52co</link>
      <guid>https://dev.to/julio_santacruz/debes-nombrar-tus-areas-css-grid-52co</guid>
      <description>&lt;p&gt;Hay muchas maneras de maquetar en HTML y CSS, personalmente me gusta mucho utilizar FLEX BOX, pero en esta publicación te enseñare como definir las áreas para tu interfaz con CSS y 'Grid template areas'. Esta es una manera sencilla para definir áreas y nombrarlas. &lt;/p&gt;

&lt;p&gt;CSS Grid nos sirve para cuadricular el contenido de nuestro HTML de manera que mas nos convenga para ordenar la información que mostramos al usuario. Piensa en un blog, tenemos los siguientes elementos&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cabecera (Header), en este espacio podemos tener el menú de navegación, el logo de nuestro proyecto, una imagen hero de proyecto u otros elementos. Esta area se ubica en la parte superior del contenido.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contenido (Main), esta es el área principal en donde tenemos la información que vamos a mostrar. Esta area la encontramos entre el Header y el Footer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pie de pagina (Footer), en esta puede tener un menu espacial con enlaces a otros sitios. Esta área se encuentra al final del contenido.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lateral (Aside), esta area es la conflictiva, va entre el Header y el Footer y puede ir a la izquierda o a la derecha de Contenido (Main). Este espacio es mas angosto que el contenido main, pensemos que es un menu lateral. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Considerando lo anterior podemos pensar en la siguiente estructura&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CeQzEK3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vzqly82w6iq2d39n38p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CeQzEK3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vzqly82w6iq2d39n38p.png" alt="Estructura general de areas para interfaz" width="593" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Después de algunas ajustes de dimisiones con CSS&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BJV3MvAi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mu13aal2ye08iqwo27sv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BJV3MvAi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mu13aal2ye08iqwo27sv.png" alt="Estructura general con dimensiones aproximadas" width="555" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Primero vamos a definir un contenedor para nuestro contenido, para este ejemplo lo creare con un &amp;lt; div &amp;gt;, tu puedes elegir otra etiqueta. No olvides asignarle una clase, en este caso la clase es 'grid-areas' &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;html&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;Grid Template Areas&amp;lt;/h1&amp;gt;
&amp;lt;div  class="grid-areas"&amp;gt;
    &amp;lt;div  class="header"&amp;gt; Soy el Header&amp;lt;/div&amp;gt;
    &amp;lt;div  class="main"&amp;gt;Soy el Main&amp;lt;/div&amp;gt;
    &amp;lt;div  class="footer"&amp;gt;Soy el Footer &amp;lt;/div&amp;gt;
    &amp;lt;div  class="aside"&amp;gt;Me llamo Aside&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;CSS&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.grid-areas { 
        display: grid;  &amp;lt;---- Definimos el uso de CSS GRID
        grid-template-columns: repeat(4, 1fr); &amp;lt;---- Definimos 4 columnas
        grid-template-areas: &amp;lt;---- Asignamos el nombre de las areas
                "header header header header "  
                "main main main aside"  
                "footer footer footer footer";    
                }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;El resultado de esta estructura es la siguiente:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L3pv3ur0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzyg6406mfiebfh3alkr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L3pv3ur0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzyg6406mfiebfh3alkr.png" alt="Estructura para el contenido" width="880" height="733"&gt;&lt;/a&gt; &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>css</category>
      <category>tutorial</category>
      <category>spanish</category>
    </item>
  </channel>
</rss>
