<?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: Paula Marín S</title>
    <description>The latest articles on Forem by Paula Marín S (@celest67).</description>
    <link>https://forem.com/celest67</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%2F1014759%2F5ff7b746-457e-46b0-856e-53629229ad3c.jpg</url>
      <title>Forem: Paula Marín S</title>
      <link>https://forem.com/celest67</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/celest67"/>
    <language>en</language>
    <item>
      <title>How I make my apps more accessible: axe Accessibility Linter</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Tue, 21 Feb 2023 20:18:17 +0000</pubDate>
      <link>https://forem.com/celest67/how-i-make-my-apps-more-accessible-axe-accessibility-linter-37id</link>
      <guid>https://forem.com/celest67/how-i-make-my-apps-more-accessible-axe-accessibility-linter-37id</guid>
      <description>&lt;p&gt;Last time I talked to you about &lt;a href="https://dev.to/celest67/how-i-make-my-apps-more-accessible-axe-devtools-cmh"&gt;axe DevTools&lt;/a&gt; and how to use it to improve the accessibility of your site.&lt;/p&gt;

&lt;p&gt;Now I want to talk to you about the "brother": &lt;a href="https://www.deque.com/axe/linters/"&gt;axe Accessibility Linter&lt;/a&gt;. This is an extension for VSCode and &lt;a href="https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter"&gt;here&lt;/a&gt; you can get it.&lt;/p&gt;

&lt;p&gt;This one is so easy to use that I'm kinda shocked that more people don't use it. You just have to install it and it starts working right away. You could put more thought into it and add a &lt;code&gt;axe-linter.yml&lt;/code&gt; configuration file, but for me it works great right out of the box.&lt;/p&gt;

&lt;p&gt;Works with most languages that we use in the front nowadays.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Checks React (.js .jsx .ts .tsx), Vue (.vue), Angular (.component.html), HTML (.html .htm), and Markdown (.md .markdown) files so you can avoid common accessibility defects. Inline Angular templates are not currently supported.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I can't say enough how much I like this one, I like it because this way you can avoid many accessibility issues before you even deploy your site.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Axe-linter is now available on a multitude of other platforms! We currently provide integrations for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;Git Pre-Commit Hooks&lt;/li&gt;
&lt;li&gt;SonarQube&lt;/li&gt;
&lt;li&gt;Jenkins, Azure DevOps, CircleCI, and more!&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The idea is that while you are coding you get errors right there in your VSCode. So let me show you some examples, for this I just have a simple html form but remember that this extension also works with javascript and typescript.&lt;/p&gt;

&lt;p&gt;The first error that I get is because I didn't set up the language of my page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I1nDTRHM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ptqqmj5iiubdhfffctq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I1nDTRHM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ptqqmj5iiubdhfffctq.png" alt="lang error" width="880" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this matters because if you have a screen reader you need to tell it how the words have to sound.&lt;/p&gt;

&lt;p&gt;Next we have an error in our title: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Screen readers alert users to the presence of a heading tag. If the heading is empty or the text cannot be accessed, this could either confuse users or even prevent them from accessing information on the page's structure.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Uh9_v8_D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yejqabe3i9mc8jgwv7gb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Uh9_v8_D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yejqabe3i9mc8jgwv7gb.png" alt="title error" width="880" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some other errors that you can detect may be related to interactive controls, like this one where you have a link inside a button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0oFMIWkg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgqpgmo3wfoy2wla3vzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0oFMIWkg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgqpgmo3wfoy2wla3vzv.png" alt="nested error" width="880" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then this one I have seen a million times, images without an alt, a screen reader will say that is an image but the user has no way of knowing what  it is about.&lt;/p&gt;

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

&lt;p&gt;Then you can have errors where you try to use a role that is not meant to be for the element that you have, like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nd8U13ir--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mia322c6a8r4g7wwj4r0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nd8U13ir--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mia322c6a8r4g7wwj4r0.png" alt="role error" width="880" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a text node is split by markup, VoiceOver will treat it as two separate phrases instead of just one. Adding role="text" around the elements solves the problem. However, it also overrides the role of the element and all descendants and treats them all as text nodes. If one of the descendant elements is also focusable it would create an empty tab stop. That is, you could tab to the element but VoiceOver would not announce its name, role, or value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are just some examples of what you can detect, I hope it helps you!&lt;/p&gt;

&lt;p&gt;Well I think that is it for now.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>a11y</category>
      <category>javascript</category>
      <category>html</category>
    </item>
    <item>
      <title>How I make my apps more accessible: axe DevTools</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Mon, 20 Feb 2023 19:43:51 +0000</pubDate>
      <link>https://forem.com/celest67/how-i-make-my-apps-more-accessible-axe-devtools-cmh</link>
      <guid>https://forem.com/celest67/how-i-make-my-apps-more-accessible-axe-devtools-cmh</guid>
      <description>&lt;p&gt;There are different tools that can help to make your app accessible. Today I want to talk to you about axe DevTools.&lt;/p&gt;

&lt;p&gt;I use the &lt;a href="https://chrome.google.com/webstore/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd" rel="noopener noreferrer"&gt;plugin for Chrome&lt;/a&gt;&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%2Frx1szjzn6ce8m1voc7rz.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%2Frx1szjzn6ce8m1voc7rz.png" alt="axe devTools" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Axe DevTools delivers unparalleled accuracy in testing page and component accessibility while you code. Our rules engine is based on Web Content Accessibility Guidelines (WCAG). Our browser extension finds 57% of the issues by itself. Use our Intelligent Guided Testing (IGT) to achieve 80% or more of the issues with no additional training required. Axe DevTools brings accessible coding to the next level.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a &lt;a href="https://www.deque.com/company/our-team/" rel="noopener noreferrer"&gt;deque&lt;/a&gt; tool that I discovered when I assisted to a webinar about accessibility.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find and fix more accessibility issues during website development with axe DevTools. &lt;br&gt;
The free axe DevTools browser extension is a fast, lightweight, yet powerful testing tool driven by the world’s most trusted accessibility testing engine, axe-core, developed by Deque. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is how it looks &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%2Fxcrdwoqlgindbkgkdgrx.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%2Fxcrdwoqlgindbkgkdgrx.png" alt="chrome plugin" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of the functionalities are totally free and some you have to go Pro, these are the paid ones.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;★ Intelligent Guided Testing™ (IGT)&lt;br&gt;
Perform more advanced testing without having to become an accessibility expert. Using a simple question and answer format, IGT leverages machine learning to help you quickly find and fix issues that are not detectable by automated testing alone. Adding IGT can get you 8o% coverage or more—while you code.&lt;/p&gt;

&lt;p&gt;★ Component-level testing&lt;br&gt;
Make your testing more agile by focusing only on the specific parts of a page relevant to your immediate work. Reduce patching and retesting by finding accessibility bugs that could break existing use cases.&lt;/p&gt;

&lt;p&gt;★ Export, Save and Share&lt;br&gt;
Collaborate across your dev team! With one click, create a customized URL with all issue description information to share with colleagues or your issue tracking software of choice. Save the rest of your team time and effort and help them build inclusive experiences. &lt;/p&gt;

&lt;p&gt;★ What’s left to test?&lt;br&gt;
After you’ve finished automated and Intelligent Guided Tests, now you can generate and share a “What’s left to test” report, listing what’s left for manual testers. Accessibility experts can pick up exactly where you left off to catch the remaining complex issues. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What I usually do is to scan all the page, for this example I'm going to go to a random page from GAP: &lt;a href="https://www.gap.com/browse/product.do?pid=549216022&amp;amp;cid=15207&amp;amp;pcid=8792&amp;amp;vid=1#pdp-page-content" rel="noopener noreferrer"&gt;https://www.gap.com/browse/product.do?pid=549216022&amp;amp;cid=15207&amp;amp;pcid=8792&amp;amp;vid=1#pdp-page-content&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what I got&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%2Fvw1oq8jr54c3ekf7l8ol.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%2Fvw1oq8jr54c3ekf7l8ol.png" alt="gap scan" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this I can see that there are 28 issues, from those I see 9 criticall, 14 serious, 2 moderates and 2 minor.&lt;/p&gt;

&lt;p&gt;If you click the humber 9 in critical you can filter the lists of issues and only see the critical ones&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%2Fauxarg0w1rwtwlhuwejs.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%2Fauxarg0w1rwtwlhuwejs.png" alt="critical issues" width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you click the title of the issue you can see more details about it&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%2Fr7jxaerzilk062os1yd1.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%2Fr7jxaerzilk062os1yd1.png" alt="aria issue" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the icon next to the title of the issue (the target?) you can select the element that has the issue&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%2Fxby9cnn045d774c2yqpo.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%2Fxby9cnn045d774c2yqpo.png" alt="pause icon" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And looking more into detail it also tells you how to fix the issue, in this case we have to fix &lt;code&gt;ARIA attribute is not allowed: aria-checked="false"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's see some other examples.&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%2Fmk50mx9grk8onuwqj1xf.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%2Fmk50mx9grk8onuwqj1xf.png" alt="another aria problem" width="800" height="819"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case the issue is &lt;code&gt;Invalid ARIA attribute value: aria-controls="popover-1"&lt;/code&gt; and also notice that this issue is happening in 7 parts of the code.&lt;/p&gt;

&lt;p&gt;And the last critical issue is a bad one if you ask me.&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%2F47r6yfcnl5ippcyb5din.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%2F47r6yfcnl5ippcyb5din.png" alt="button issue" width="800" height="614"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case there is some kind of button but is hidden if the user is using a screen reader app then the user is going to have a really bad time trying to figure out what that button is for since the screen reader won't have any reference or information to give to the user. All of this and more you can see in the section about how to solve the problem.&lt;/p&gt;

&lt;p&gt;Let's see some examples about serious issues.&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%2Fncvtu890npl2706wyfud.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%2Fncvtu890npl2706wyfud.png" alt="serious issues" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this next issue you can see that the problem is all about the colors that they chose to use in the design. It should have more contrast so users with visual difficulties can use the site anyway.&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%2Fkvpkwpp7goy7kyo7xp58.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%2Fkvpkwpp7goy7kyo7xp58.png" alt="color issue" width="800" height="795"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next issue is about how they chose to implement the clickable photos and again it is not taking into account assistive technologies.&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%2Fmetnzjdxssk13inq86o8.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%2Fmetnzjdxssk13inq86o8.png" alt="issue photos" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 2 moderate issues are related to how a user can interact with a scrollable section.&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%2Fovxil9ujxl80v907yv76.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%2Fovxil9ujxl80v907yv76.png" alt="scroll issue" width="800" height="682"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the 3 minor issues are related to the id of elements in the 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%2Fz17qtevzq6t0lelw6hil.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%2Fz17qtevzq6t0lelw6hil.png" alt="id issue" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another option that sometimes is really useful is the more info button.&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%2F1e7edjt29uo8wh26o2w8.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%2F1e7edjt29uo8wh26o2w8.png" alt="more info" width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is great because it takes you to the documentations about the issue and this documentation is really complete, I love it.&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%2Fgnvv1dkjfd07fvea86zj.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%2Fgnvv1dkjfd07fvea86zj.png" alt=" " width="800" height="753"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally something that is really useful for me as a developer is the inspect issue button.&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%2F7stql8ym9smcwaaay8a6.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%2F7stql8ym9smcwaaay8a6.png" alt="inspect issue" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This button takes me to the code, which gives me more context on what part of my code has the issue specially in big sites that might be part of different microfontends.&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%2Fk7x765nt1yuiuj4zs77s.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%2Fk7x765nt1yuiuj4zs77s.png" alt="pause button" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyways, this is just an example of what you can do with the free choices that you have and like I said before there is lots more that you can do with the paid version.&lt;/p&gt;

&lt;p&gt;That is it for now.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>llm</category>
    </item>
    <item>
      <title>Rome</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Tue, 14 Feb 2023 20:12:56 +0000</pubDate>
      <link>https://forem.com/celest67/rome-4no5</link>
      <guid>https://forem.com/celest67/rome-4no5</guid>
      <description>&lt;p&gt;Today we are going to talk about Rome. According to their &lt;a href="https://github.com/rome/tools" rel="noopener noreferrer"&gt;github page&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Rome is a formatter, linter, bundler, and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS.&lt;/li&gt;
&lt;li&gt;Rome is designed to replace Babel, ESLint, webpack, Prettier, Jest, and others.&lt;/li&gt;
&lt;li&gt;Rome unifies functionality that has previously been separate tools. Building upon a shared base allows us to provide a cohesive experience for processing code, displaying errors, parallelizing work, caching, and configuration.&lt;/li&gt;
&lt;li&gt;Rome has strong conventions and aims to have minimal configuration. Read more about our project philosophy.&lt;/li&gt;
&lt;li&gt;Rome is written in Rust.&lt;/li&gt;
&lt;li&gt;Rome has first-class IDE support, with a sophisticated parser that represents the source text in full fidelity and top-notch error recovery.&lt;/li&gt;
&lt;li&gt;Rome is MIT licensed and moderated under the Contributor Covenant Code of Conduct.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is what it wants to be, but for now it is a formatter and linter, but it still intrigues me.&lt;br&gt;
It was founded by the creator of Babel and Yarn and in the future it promises to be a:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Compiler - March 2023&lt;/li&gt;
&lt;li&gt;Bundler - March 2023&lt;/li&gt;
&lt;li&gt;Testing - June 2023&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Rome unifies your development stack by combining the functionality of separate tools.&lt;br&gt;
Single configuration file, amazing performance, and works with any stack.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For now it works with Javascript and Typescript, it will work with:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Json - Dec 2022&lt;/li&gt;
&lt;li&gt;HTML - June 2023&lt;/li&gt;
&lt;li&gt;Markdown - Nov 2023&lt;/li&gt;
&lt;li&gt;CSS - Nov 2023&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So for now I want to see how easy it is to start working with it and compare it in a month when they will launch the compiler and bundler functionalities.&lt;/p&gt;

&lt;p&gt;First we have to have a folder with a &lt;code&gt;package.json&lt;/code&gt;, so I will start a react project like always.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-react-app my-rome-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So I have this in my folder&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%2F185esznrnd47oym4c3su.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%2F185esznrnd47oym4c3su.png" alt="npx create" width="388" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are going to get Rome &lt;code&gt;npm install --save-dev rome&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And I already have 6 high vulnerabilities, I don't like that very much.&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%2F1x8h7wzxy0d61ud76m3b.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%2F1x8h7wzxy0d61ud76m3b.png" alt="install rome" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But, now we should be able to run Rome &lt;code&gt;npx rome&lt;/code&gt;&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%2Fzruzgiw6ugv02255e2n1.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%2Fzruzgiw6ugv02255e2n1.png" alt="npx rome" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They do recommend to create a &lt;code&gt;rome.json&lt;/code&gt; configuration file for each project &lt;code&gt;npx rome init&lt;/code&gt;&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%2F6jamjp3241o8mbvokvln.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%2F6jamjp3241o8mbvokvln.png" alt="rome init" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is my new file&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%2F2e6v14izvnmlnhejy4rv.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%2F2e6v14izvnmlnhejy4rv.png" alt="rome json" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's check a file &lt;code&gt;npx rome check ./src/App.js&lt;/code&gt;&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%2Fl6enzrpoebsoqtx6ies9.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%2Fl6enzrpoebsoqtx6ies9.png" alt="check app" width="800" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, I was expecting more...&lt;/p&gt;

&lt;p&gt;Let's try something else, they do recommend installing our editor integration to get the most out of Rome. So I'm going to install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=rome.rome" rel="noopener noreferrer"&gt;extension for VSCode&lt;/a&gt; &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%2F8utdgm7w1mm9v3xh7svz.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%2F8utdgm7w1mm9v3xh7svz.png" alt="Rome extension" width="800" height="804"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now I have the option to format with Rome&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%2Fzm65frsb4ssst2kag99d.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%2Fzm65frsb4ssst2kag99d.png" alt="format with rome" width="800" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well that did changed the quotes in my file&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%2Fgcrofp61ocb7idhf96ks.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%2Fgcrofp61ocb7idhf96ks.png" alt="changed App js" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rome’s an opinionated formatter that has the goal to stop all ongoing debates over styles. It follows a similar philosophy to Prettier, only supporting few options to avoid that debates over styles turn into debates over Rome options. It deliberately resists the urge to add new options to prevent bike-shed discussions in teams so they can focus on what really matters instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And here you can learn more about the &lt;a href="https://docs.rome.tools/formatter/" rel="noopener noreferrer"&gt;formatter&lt;/a&gt;. I used the command &lt;code&gt;npx rome format --help&lt;/code&gt; and this is what I got.&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%2Fsz8gccxy3u2l900n1cog.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%2Fsz8gccxy3u2l900n1cog.png" alt="format options" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And for the lint options &lt;code&gt;npx rome check --help&lt;/code&gt;&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%2Fqi7z16lnzt23zsnkjg6f.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%2Fqi7z16lnzt23zsnkjg6f.png" alt="check options" width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Recommended rules are enabled by default and emit diagnostics with the error severity. Rules that are not recommended are disabled by default, but they can be enabled via configuration. The diagnostics emitted by these rules are displayed with the warning severity in the documentation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well, for now in my opinion Rome is cute, but I'm going to be waiting when they do add more functionalities.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>privacy</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Green Software SDK</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Mon, 13 Feb 2023 21:45:39 +0000</pubDate>
      <link>https://forem.com/celest67/green-software-sdk-alm</link>
      <guid>https://forem.com/celest67/green-software-sdk-alm</guid>
      <description>&lt;p&gt;Today I want to see something different of what I have been doing.&lt;/p&gt;

&lt;p&gt;Some of you may know that Thoughtworks regularly releases their &lt;a href="https://www.thoughtworks.com/radar" rel="noopener noreferrer"&gt;Technology Radar&lt;/a&gt;. According to Thoughtworks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Radar is a document that sets out the changes that we think are currently interesting in software development — things in motion that we think you should pay attention to and consider using in your projects. It reflects the idiosyncratic opinion of a bunch of senior technologists and is based on our day-to-day work and experiences. While we think this is interesting, it shouldn’t be taken as a deep market analysis.&lt;/p&gt;
&lt;/blockquote&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%2Fpipx2rv0smr4lg2fiqlk.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%2Fpipx2rv0smr4lg2fiqlk.png" alt="tech radar" width="800" height="861"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The radar basically suggest what techniques, tools, platforms, languages and frameworks one might want to adopt, try, assess or hold implementing in our projects.&lt;/p&gt;

&lt;p&gt;I usually take a look at the radar every time it comes out, bookmark whatever calls my attention and then when I have time I can go more into detail.&lt;/p&gt;

&lt;p&gt;That is where I found the &lt;a href="https://github.com/Green-Software-Foundation/carbon-aware-sdk" rel="noopener noreferrer"&gt;Carbon Aware SDK&lt;br&gt;
&lt;/a&gt; and also recently I got a certification from the Linux foundation on &lt;a href="https://www.credly.com/org/the-linux-foundation/badge/lfc131-green-software-for-practitioners" rel="noopener noreferrer"&gt;Green Software&lt;/a&gt;, so it was like it called to me.&lt;/p&gt;

&lt;p&gt;If you want to reduce your software carbon footprint there are only a few ways to do it.  And the obvious way is to use cleaner energy. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can reduce the carbon footprint of your application by just running things at different times and in different locations. That is because not all electricity is produced in the same way. Most is produced through burning fossil fuels, some is produced using cleaner sources like wind and solar.&lt;br&gt;
The Carbon Aware SDK helps you build the carbon aware software solutions with the intelligence to use the greenest energy sources. Run them at the greenest time, or in the greenest locations, or both! Capture consistent telemetry and report on your emissions reduction and make informed decisions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Carbon Aware SDK has a WebApi and a Command Line Interfave (CLI)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The WebApi is the preferred deployment within large organisations to centralise management and increase control and auditability, especially in regulated environments. It can be deployed as a container for easy management, and can be deployed alongside an application within a cluster or separately.&lt;/p&gt;
&lt;/blockquote&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%2Fnetn1i8ensctyn8glf28.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%2Fnetn1i8ensctyn8glf28.png" alt="WebApi" width="783" height="647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The CLI tends to be handy for legacy integration and non-cloud deployments, where a command-line can be used. This tends to be common with legacy DevOps pipelines to drive deployment for integration testing where you can test your deployment in the greenest location.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Carbon Aware SDK is a project part of the Green Software Foundation (GSF) and the GSF Open Source Working Group. And here you can see the &lt;a href="https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/CONTRIBUTING.md" rel="noopener noreferrer"&gt;contribution guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will try to run the Web API. So first we have to have the prerequisites.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker Desktop/CLI ( instructions for &lt;a href="https://docs.docker.com/desktop/install/windows-install/" rel="noopener noreferrer"&gt;windows&lt;/a&gt; or &lt;a href="https://docs.docker.com/desktop/install/mac-install/" rel="noopener noreferrer"&gt;mac&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;VSCode (it is recommended to work in a Dev Container and more explanations &lt;a href="https://code.visualstudio.com/docs/devcontainers/containers" rel="noopener noreferrer"&gt;here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Remote Containers extension for VSCode: &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we have to follow this steps to get the Web API running&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set up the repository &lt;code&gt;git clone https://github.com/Green-Software-Foundation/carbon-aware-sdk.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change directory &lt;code&gt;cd carbon-aware-sdk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open VSCode &lt;code&gt;code .&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open VSCode Command Palette &lt;code&gt;cmd + shift + P&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run the command &lt;code&gt;Dev Containers: Open Folder in Container&lt;/code&gt; and select the current folder. You should see that the Dev Container is starting &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%2Fda0du6bqb7xhzpnmtwjf.png" alt="starting dev container" width="800" height="448"&gt;
&lt;/li&gt;
&lt;li&gt;Change directory to &lt;code&gt;cd src/CarbonAware.WebApi/src&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run the application &lt;code&gt;dotnet run&lt;/code&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%2F6lsd7207ap6t1efsws2e.png" alt="dotnet run" width="800" height="411"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is going to depend on your configuration&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The SDK supports multiple data sources for getting carbon data. At this time, only a JSON file, WattTime and ElectricityMaps are supported.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I'm going to use the JSON file to get data and I'm going to get it from an example file &lt;code&gt;/workspaces/carbon-aware-sdk/src/data/data-sources/mycustomfile.json&lt;/code&gt;&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%2Fya7ujjqv526tcwn6pshz.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%2Fya7ujjqv526tcwn6pshz.png" alt="custom json" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that I have my data source I can do a GET request and for this I like Postman and I'm going to use this to make the request &lt;code&gt;http://localhost:5073/emissions/bylocations/best?location=westus&amp;amp;location=eastus&amp;amp;location=westus3&amp;amp;time=2022-08-23T00%3A00&amp;amp;toTime=2022-08-23T23%3A59&lt;/code&gt;&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%2Faqhwt4pcjq4m4uveystu.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%2Faqhwt4pcjq4m4uveystu.png" alt="get request" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it, obviously you can play with it more now that it is working, but I'm telling you this is going to be asked by more and more industries/companies, they will want to know and show their CO2 consumption so that customers can prefer greener options, so having an open source options is really awesome.&lt;/p&gt;

&lt;p&gt;That is it for now :-)&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>softwaredevelopment</category>
      <category>software</category>
      <category>programming</category>
    </item>
    <item>
      <title>Next.js ready to go</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Thu, 09 Feb 2023 20:34:42 +0000</pubDate>
      <link>https://forem.com/celest67/nextjs-ready-to-go-3nd0</link>
      <guid>https://forem.com/celest67/nextjs-ready-to-go-3nd0</guid>
      <description>&lt;p&gt;So far I have been trying Next.js with different configurations and tools but in the day to day of things I want my project to be able to do all of that at the same time.&lt;/p&gt;

&lt;p&gt;That's why now I want to create a project with everything ready to go, but looking at the documentation of Next.js only a few options can be set with the Create Next App command.&lt;/p&gt;

&lt;p&gt;There are two ways of doing this just using the command &lt;code&gt;npx create-next-app@latest&lt;/code&gt; and answering some questions or you can add arguments to the command line (&lt;a href="https://nextjs.org/docs/api-reference/create-next-app" rel="noopener noreferrer"&gt;see here more detail&lt;/a&gt;). I'm going to go with the first option.&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%2Fpgmi3xx6m1xgh37smgyh.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%2Fpgmi3xx6m1xgh37smgyh.png" alt="create next app" width="800" height="761"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This are the basics that I want to have&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://dev.to/celest67/nextjs-with-eslint-3gl5"&gt;Integration with ESLint&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/nextjs-and-typescript-55ha"&gt;TypeScript integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/nextjs-with-cypress-3a5b"&gt;Testing with Cypress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/nextjs-with-jest-react-testing-library-3cc6"&gt;Testing with React Testing Library&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ESLint and Typescript I should have because it asked me and I said yes. And indeed I have config files for both.&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%2Feighrcg5a5sxqic5kogy.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%2Feighrcg5a5sxqic5kogy.png" alt="config eslint" width="800" height="335"&gt;&lt;/a&gt;&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%2Fg89z5u1bl4t5znsud1rv.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%2Fg89z5u1bl4t5znsud1rv.png" alt="config ts" width="800" height="778"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I do have everything that I need in the &lt;code&gt;package.json&lt;/code&gt;&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%2Fruaa45e3hbs9th8gzedf.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%2Fruaa45e3hbs9th8gzedf.png" alt="package json" width="760" height="1170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I still want to check that everything is running ok, before I do anything else.&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%2F79y3esvyym77sddqndxj.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%2F79y3esvyym77sddqndxj.png" alt="npm run lint dev" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything looks ok, so I'm going to follow the instructions in &lt;a href="https://dev.to/celest67/nextjs-with-jest-react-testing-library-3cc6"&gt;https://dev.to/celest67/nextjs-with-jest-react-testing-library-3cc6&lt;/a&gt; and do some testing.&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%2Faactwzbsal32mv1b4a2y.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%2Faactwzbsal32mv1b4a2y.png" alt="react testing library" width="800" height="717"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great, no issues, so I will add cypress following the instructions in &lt;a href="https://dev.to/celest67/nextjs-with-cypress-3a5b"&gt;Next.js with Cypress&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And again no trouble at all&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%2F7tqbecy7eoca3jzokkbx.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%2F7tqbecy7eoca3jzokkbx.png" alt="cypress running" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was really easy and now I can have a template for when I need to start a project for some project or something, you can see the repo here &lt;a href="https://github.com/celest67/full-nextjs" rel="noopener noreferrer"&gt;https://github.com/celest67/full-nextjs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is it for now, next I want to try to see how easy it would be to do a demo or a POC of some library.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>posts</category>
      <category>moderation</category>
    </item>
    <item>
      <title>Next.js with ESLint</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Wed, 08 Feb 2023 20:16:24 +0000</pubDate>
      <link>https://forem.com/celest67/nextjs-with-eslint-3gl5</link>
      <guid>https://forem.com/celest67/nextjs-with-eslint-3gl5</guid>
      <description>&lt;p&gt;One of the things that really helps when working in teams is having some kind of standard or agreement regarding the code formatting, this way is so much easier for everyone to read the code and onboard new team members. For this ESLint in my opinion is essential.&lt;/p&gt;

&lt;p&gt;That's why I want to see how does Next.js work with ESLint. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://eslint.org/" rel="noopener noreferrer"&gt;ESLint&lt;/a&gt; is an open source project that helps you find and fix problems with your JavaScript code. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Reading the documentation for Next.js you are going to find that&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js provides an integrated ESLint experience out of the box.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We just need to add &lt;code&gt;next lint&lt;/code&gt; as a script to the package.json. So that is what I'm going to do now.&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%2Fg61tro7uafnd13kex5vu.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%2Fg61tro7uafnd13kex5vu.png" alt="add package json" width="662" height="786"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And run the script&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%2F5q2enry9akqkfaty4equ.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%2F5q2enry9akqkfaty4equ.png" alt="run lint" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like it detected that I don't have ESLint and we have to configure it. I'm going to go with the recommended configuration.&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%2Ft5o2onej6cwkuq9xauhg.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%2Ft5o2onej6cwkuq9xauhg.png" alt="install ESLint" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This modifies our &lt;code&gt;package.json&lt;/code&gt;&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%2Fdg0n41d8zz0evvunaaph.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%2Fdg0n41d8zz0evvunaaph.png" alt="modified package.json" width="772" height="820"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installing looks like we can run our lint.&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%2Fcle6w5irzudl73kj9ind.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%2Fcle6w5irzudl73kj9ind.png" alt="npm run lint" width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like there is a Warning that we can improve in our code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By default, Next.js will run ESLint for all files in the pages/, components/, lib/, and src/ directories&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This was really easy, so I kept reading what else we could do and found this &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ESLint also contains code formatting rules, which can conflict with your existing Prettier setup. We recommend including eslint-config-prettier in your ESLint config to make ESLint and Prettier work together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I could install &lt;code&gt;eslint-config-prettier&lt;/code&gt;. But I don't usually format my code with prettier and that made me think of another thing. I have my VSCode configured to format my code on save and this was not happening. I just added some extra tabs, saved and nothing happened.&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%2F7788bnnqfwv222icz73v.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%2F7788bnnqfwv222icz73v.png" alt="ugly index" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So looks like I'm missing something. I don't see ESLint in my package.json but that's supposed to be OK. Still I want to check and make sure, so if I try to make an initial configuration it should warn me if it isn't installed.&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%2F9corp6zn4f9wp8ndod16.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%2F9corp6zn4f9wp8ndod16.png" alt="eslint init" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But no error appeared, I'll try to do the whole configuration and see what happens. First I will select to enforce de code style.&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%2Fqr7gbcqn0ec6smnecjq2.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%2Fqr7gbcqn0ec6smnecjq2.png" alt="Image description" width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use JS modules so...&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%2Fd12qm7i2ywd1e4028ezb.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%2Fd12qm7i2ywd1e4028ezb.png" alt="js modules" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use React&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%2F94ki3xwrt2zs12ox7re6.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%2F94ki3xwrt2zs12ox7re6.png" alt="react" width="774" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am not using Typescript, I run my code in browser and just to test I will try a popular style guide, I like semicolons so I think I'm going to go with the AirBnB one but for a comparison you can check this &lt;a href="https://betterprogramming.pub/comparing-the-top-three-style-guides-and-setting-them-up-with-eslint-98ea0d2fc5b7" rel="noopener noreferrer"&gt;link&lt;/a&gt; it has a image of a table comparison that is very good.&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%2Fnqxzm2ckfdc12elsbuct.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%2Fnqxzm2ckfdc12elsbuct.png" alt="airbnb" width="800" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I already have a json for configuration so I will go with that option&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%2Fxautbzwp2y1gxt2hkgxo.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%2Fxautbzwp2y1gxt2hkgxo.png" alt="json" width="800" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like I'm missing some things so I'll install them.&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%2Frncvhdkc5r5y0akkit9c.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%2Frncvhdkc5r5y0akkit9c.png" alt="last config" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that is it, now I'm getting all kind of errors.&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%2Fkcmm1ep235pzsyilo7go.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%2Fkcmm1ep235pzsyilo7go.png" alt="eslint errors" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I save the file, ESLint fixes what it can.&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%2F5hbjhwcfvxdftqjhdr90.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%2F5hbjhwcfvxdftqjhdr90.png" alt="fixed index" width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since the new config replaced the old one please remember to re-add &lt;a href="https://nextjs.org/docs/basic-features/eslint" rel="noopener noreferrer"&gt;Next.js validations&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The next configuration already handles setting default values for the parser, plugins and settings properties&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you run lint now you are going to see more errors&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%2Fq6bnddp2chdtdx7c993r.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%2Fq6bnddp2chdtdx7c993r.png" alt="eslint more errors" width="800" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I'm not really happy with ESLint basic configuration that comes with Next.js so you will have to tweak it a little bit the way that you or your team needs it.&lt;/p&gt;

&lt;p&gt;That's it for now, hope it helps someone and any feedback is welcome.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>claude</category>
      <category>tooling</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Next.js with Jest + React Testing Library</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Tue, 07 Feb 2023 19:52:10 +0000</pubDate>
      <link>https://forem.com/celest67/nextjs-with-jest-react-testing-library-3cc6</link>
      <guid>https://forem.com/celest67/nextjs-with-jest-react-testing-library-3cc6</guid>
      <description>&lt;p&gt;I have to admit that Jest with React Testing Library is my favorite way of doing unit testing. Enzyme was never my thing. I love the approach of React Testing Library that tries to make you test like an user, it even helps you detect accessibility issues.&lt;/p&gt;

&lt;p&gt;Well what I'm trying to say is that I'm really excited to try to do this integration. As always I'm going to follow the documented published in Next.js site and hope for the best, here we go.&lt;/p&gt;

&lt;p&gt;There are different ways to get your Next.js project with Jest and React Testing Library running, first you can just create a project from zero with this command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest --example with-jest with-jest-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But, I want to try to integrate it to the same project that I have been working on. So according to the documentation I can set up Jest with Rust or Babel.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rust is a memory-safe compiled programming language for building high-performance systems. It has the simplicity of high-level languages (Go, Python), but the control of low-level languages (C, Cpp)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want to know more about Rust, here is a small &lt;a href="https://www.youtube.com/watch?v=5C_HPTJg5ek" rel="noopener noreferrer"&gt;video by Fireship&lt;/a&gt; that explains it. Also the &lt;a href="https://github.com/fireship-io/rust-in-100" rel="noopener noreferrer"&gt;github&lt;/a&gt; associated to the video is really good.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments (&lt;a href="https://babeljs.io/" rel="noopener noreferrer"&gt;https://babeljs.io/&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think I'm going to go with Rust.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since the release of Next.js 12, Next.js now has built-in configuration for Jest&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I'm going to install jest, jest-environment-jsdom, @testing-library/react, @testing-library/jest-dom using the following command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save-dev jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then we have to create the following &lt;code&gt;jest.config.js&lt;/code&gt; file&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%2Ftnzme07phcc2nztiyo5e.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%2Ftnzme07phcc2nztiyo5e.png" alt="jest config" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Under the hood, next/jest is automatically configuring Jest for you, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up transform using SWC&lt;/li&gt;
&lt;li&gt;Auto mocking stylesheets (.css, .module.css, and their scss variants), image imports and @next/font&lt;/li&gt;
&lt;li&gt;Loading .env (and all variants) into process.env&lt;/li&gt;
&lt;li&gt;Ignoring node_modules from test resolving and transforms&lt;/li&gt;
&lt;li&gt;Ignoring .next from test resolving&lt;/li&gt;
&lt;li&gt;Loading next.config.js for flags that enable SWC transforms&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The I'll add a script for testing in the &lt;code&gt;package.json&lt;/code&gt;&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%2Fn93xj6co4g3usb1oyckd.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%2Fn93xj6co4g3usb1oyckd.png" alt="Package json" width="800" height="924"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following Jest's convention I'll create a &lt;code&gt;__tests__&lt;/code&gt; folder and add a test to check if the &lt;code&gt;&amp;lt;Home /&amp;gt;&lt;/code&gt; component successfully renders a heading:&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%2Fhqe45zq8zp1o29zepsb2.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%2Fhqe45zq8zp1o29zepsb2.png" alt="testing home" width="800" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I'm going to run the testing script to see if everything is ok.&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%2Fnkl79csl6a01itf48ppl.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%2Fnkl79csl6a01itf48ppl.png" alt="npm run test" width="800" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The documentation also says that I can add snapshots tests, I know that many people don't like them but for I have to admit that more than once snapshots allowed me to catch changes that I didn't made on purpose. So I want to see how to include them now. So I'll create a new file called &lt;code&gt;snapshot.js&lt;/code&gt;&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%2Fuq35d82xtuc7zwoj6mth.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%2Fuq35d82xtuc7zwoj6mth.png" alt="snapshot" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now I run my testing script again&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%2Fq0sl6cwuj1kfsl9ku7ww.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%2Fq0sl6cwuj1kfsl9ku7ww.png" alt="testing with snapshot" width="800" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are reading this as part of the serie of &lt;a href="https://dev.to/celest67/trying-nextjs-4ee4"&gt;Trying Next.js&lt;/a&gt; you can see that before this I tried &lt;a href="https://dev.to/celest67/nextjs-with-cypress-3a5b"&gt;Next.js with Cypress&lt;/a&gt; so I think I'll do something similar and test the same, I'll change my index with a message that reads "This is 0" and a button that everytime you click it the number in the message increments by one. And of course every test fails.&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%2F1cafxfhky0yflke4kbgc.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%2F1cafxfhky0yflke4kbgc.png" alt="new index" width="800" height="748"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let's update the test file for the index and update the snapshot&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%2F5lroxrqi85yyr9iih2gf.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%2F5lroxrqi85yyr9iih2gf.png" alt="new test" width="800" height="795"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it, tests running OK and I think that is it for now.&lt;/p&gt;

&lt;p&gt;Any comments or questions are welcome&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>writing</category>
      <category>forem</category>
    </item>
    <item>
      <title>Next.js with Cypress</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Tue, 07 Feb 2023 15:48:50 +0000</pubDate>
      <link>https://forem.com/celest67/nextjs-with-cypress-3a5b</link>
      <guid>https://forem.com/celest67/nextjs-with-cypress-3a5b</guid>
      <description>&lt;p&gt;Hello! As part of my learning experience trying Next.js I thought it would be a good idea to try some testing tools that I really like, so now we are going to talk about Cypress.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cypress is a test runner used for End-to-End (E2E) and Integration Testing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For this we are going to follow the instructions in Next.js site, there is a way to have a project in from scratch that also has Cypress running the following command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest --example with-cypress with-cypress-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But I already have a project that I created before I decided that I wanted Cypress, so we are going to try a manual setup. First check if you have Cypress installed.&lt;/p&gt;

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

&lt;p&gt;And after a minute or so everything is ready to start&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%2Fhbnn244srzswzy17k3ay.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%2Fhbnn244srzswzy17k3ay.png" alt="npm cypress" width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next we have to add Cypress to the &lt;code&gt;package.json&lt;/code&gt; scripts field by adding this &lt;code&gt;"cypress": "cypress open"&lt;/code&gt; like so&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%2F8ugtwf01rdlgnttdft0o.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%2F8ugtwf01rdlgnttdft0o.png" alt="package json" width="706" height="926"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Final step is to run cypress to &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run cypress&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A window will open&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%2F8h5xh33wottkihgw1lsk.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%2F8h5xh33wottkihgw1lsk.png" alt="cypress window" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will go with the E2E Testing option and it will add some files to my project&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%2Fig182pr0ds6019qb410q.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%2Fig182pr0ds6019qb410q.png" alt="cypress e2e config" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then it give 2 options to choose a browser&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%2Fl5xmxin6c6ef4yuzqh8b.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%2Fl5xmxin6c6ef4yuzqh8b.png" alt="choose browser" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll choose Chrome and click the button to start the testing. This will open the cypress window with options to generate examples of tests or you also have the option to create a new test.&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%2Fuhc2cxrcbneu201tkgav.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%2Fuhc2cxrcbneu201tkgav.png" alt="cypress app" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you choose to see the examples you are going to get a window like this&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%2Fael8iavq35pt237tr942.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%2Fael8iavq35pt237tr942.png" alt="examples to add" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you can see all this different examples of different things that you may want to test&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%2Fkxkaxt5mpxa2wb39uf3j.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%2Fkxkaxt5mpxa2wb39uf3j.png" alt="testing examples" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, I actually don't have nothing interesting to test in my project right now so I'm going to change my index with a message that reads "This is 0" and a button that everytime you click it the number in the message increments by one.&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%2Fxe5l5mvq2jg6bke3gv6j.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%2Fxe5l5mvq2jg6bke3gv6j.png" alt="index js" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now we need a small test of the functionality described above.&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%2Fu2zaqf1f4dfpinuvdxr9.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%2Fu2zaqf1f4dfpinuvdxr9.png" alt="test file" width="800" height="709"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally we can see that the test is passing&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%2Frw76w9u1i6wkcazq4n3n.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%2Frw76w9u1i6wkcazq4n3n.png" alt="running test" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think that is for now, this is the &lt;a href="https://github.com/celest67/nextjs-try1/tree/testing-cypress" rel="noopener noreferrer"&gt;branch&lt;/a&gt; with the code. Any questions or anything please let me know!&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

&lt;p&gt;Related Content:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/celest67/trying-nextjs-4ee4"&gt;Trying Next.js&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/celest67/deployment-with-nextjs-41j7"&gt;Deployment with Next.js&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/celest67/nextjs-and-typescript-55ha"&gt;Next.js and Typescript&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>blockchain</category>
      <category>airdrops</category>
      <category>crypto</category>
      <category>web3</category>
    </item>
    <item>
      <title>Next.js and Typescript</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Tue, 31 Jan 2023 20:29:59 +0000</pubDate>
      <link>https://forem.com/celest67/nextjs-and-typescript-55ha</link>
      <guid>https://forem.com/celest67/nextjs-and-typescript-55ha</guid>
      <description>&lt;p&gt;I have been &lt;a href="https://dev.to/celest67/trying-nextjs-4ee4"&gt;trying Next.js&lt;/a&gt; in different aspects, for example you can read more about deployment &lt;a href="https://dev.to/celest67/deployment-with-nextjs-41j7"&gt;here&lt;/a&gt; but now I want to check out how does Next.js behave with Typescript, maybe ts is not that necessary in small projects but in big projects with many developers for me is a must, that is why I just had to test it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js provides an integrated TypeScript experience, including zero-configuration set up and built-in types for Pages, APIs, and more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are just starting a project with Next.js you can just run this command below and it will create you a project from scratch.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest --ts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But I already created a project &lt;a href="https://dev.to/celest67/trying-nextjs-4ee4"&gt;here&lt;/a&gt; so I want to try and transform this project, following the instructions. First I have to create an empty file called &lt;code&gt;tsconfig.json&lt;/code&gt; and then run &lt;code&gt;npm run dev&lt;/code&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js will automatically detect TypeScript usage and install the required packages&lt;/p&gt;
&lt;/blockquote&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%2F678qx1g0zpuestz6kjwn.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%2F678qx1g0zpuestz6kjwn.png" alt="npm run dev" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if I look at my &lt;code&gt;tsconfig.json&lt;/code&gt; this is what I see&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%2Ft3dbi97tdourw2f6z4yx.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%2Ft3dbi97tdourw2f6z4yx.png" alt="tsconfig json" width="800" height="907"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This process also created a file &lt;code&gt;next-env.d.ts&lt;/code&gt; and added the necessary dependencies to my &lt;code&gt;package.json&lt;/code&gt;&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%2Fuj3fwilll4f2nz9cgj4y.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%2Fuj3fwilll4f2nz9cgj4y.png" alt="package json" width="760" height="900"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next we have to update my javascript files into Typescript, this means that now my index.js is going to be &lt;code&gt;index.tsx&lt;/code&gt; and the app should keep working the same as before, because I just have the basic project from the beginning.&lt;/p&gt;

&lt;p&gt;So, now I want to try to build something that actually checks types. Since my goal is not actually teaching you typescript I'm going to follow a project by &lt;a href="https://www.youtube.com/@WebDevSimplified" rel="noopener noreferrer"&gt;@WebDevSimplified&lt;/a&gt; here you can get more details in this &lt;a href="https://www.youtube.com/watch?v=bAJlYgeovlg" rel="noopener noreferrer"&gt;video&lt;/a&gt;. But to give you an idea the description of the video is&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Select components are one of the most important components you will use in React, but how exactly do you create a good select component. In this video I will breakdown how to create a select component in React using only TypeScript and no additional React libraries.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code for this is available in &lt;a href="https://github.com/WebDevSimplified/react-select" rel="noopener noreferrer"&gt;WebDevSimplified Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following Next.js guidelines I'm going to create a folder called &lt;code&gt;components&lt;/code&gt; where I will create my select component.&lt;/p&gt;

&lt;p&gt;Then I'm going to import it to my index.&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%2F85txzuu48yfragg14vzm.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%2F85txzuu48yfragg14vzm.png" alt="import select" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And just to make sure that everything is working properly and validating types as it should, I'm going to change one of my variables from an array to a number and as you can see my IDE let's me know of my error&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%2Fim1pj1i42zxs3nkdl3xx.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%2Fim1pj1i42zxs3nkdl3xx.png" alt="IDE type error" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But also I can see the error if I try to run &lt;code&gt;npm run dev&lt;/code&gt;&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%2F63d5rn06lmps52rlj8y1.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%2F63d5rn06lmps52rlj8y1.png" alt="browser type error" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we are really working with typescript and you have all the benefits that come from it.&lt;/p&gt;

&lt;p&gt;Everything that we have seen here is in my github in &lt;a href="https://github.com/celest67/nextjs-try1/tree/typescript-select" rel="noopener noreferrer"&gt;this branch&lt;/a&gt;, so if you want to play with it you can and also if you know how to fix the issue in &lt;code&gt;components/select.tsx&lt;/code&gt; ln 42 let me know!! Because if you try to build the app you are going to get an error!&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%2F7x0wpsvrvpm3nsnktfsb.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%2F7x0wpsvrvpm3nsnktfsb.png" alt="error on build" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is it for now ;-)&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>cryptocurrency</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>crypto</category>
    </item>
    <item>
      <title>Deployment with Next.js</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Mon, 30 Jan 2023 15:17:56 +0000</pubDate>
      <link>https://forem.com/celest67/deployment-with-nextjs-41j7</link>
      <guid>https://forem.com/celest67/deployment-with-nextjs-41j7</guid>
      <description>&lt;p&gt;As I said in the last post &lt;a href="https://dev.to/celest67/trying-nextjs-4ee4"&gt;Trying Next.js&lt;/a&gt;, one of the things that really intrigues me is the deployment of this apps that I can get running so fast. In the site it says&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The easiest way to deploy Next.js to production is to use the Vercel platform developed by the creators of Next.js.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For those who haven't heard of &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Vercel is a serverless platform for static and hybrid applications built to integrate with your headless content, commerce, or database. We make it easy for frontend teams to develop, preview, and ship delightful user experiences, where performance is the default. You can start using it for free — no credit card required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that sounds great in my head, build a small app with something that I want to show and I don't even have to show it running on my machine I can also show it in a public URL that I can just share and it is supposed to be easy.&lt;/p&gt;

&lt;p&gt;First I want to build my app and check that everything looks OK.&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%2Fnfne9og2mzja4ct6v94b.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%2Fnfne9og2mzja4ct6v94b.png" alt="next build" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to the documentation now I'm going to get a .next folder with this content&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.next/static/chunks/pages – Js files with corresponding pages&lt;/li&gt;
&lt;li&gt;.next/static/media – Statically imported images from next/image &lt;/li&gt;
&lt;li&gt;.next/static/css – Global CSS files for all pages &lt;/li&gt;
&lt;li&gt;.next/server/pages – The HTML and JavaScript entry points pre-rendered from the server. &lt;/li&gt;
&lt;li&gt;.next/server/chunks – Shared JavaScript chunks used in multiple places throughout the application&lt;/li&gt;
&lt;li&gt;.next/cache – Output for the build cache and cached images, responses, and pages from the Next.js server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Looks like we have to have a &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub account&lt;/a&gt; if we want to deploy to Vercel&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%2F94bea1hx6fml1ev1uzau.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%2F94bea1hx6fml1ev1uzau.png" alt="Github account" width="800" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, I'm going to go to my GitHub and create a repository called &lt;em&gt;nextjs-try1&lt;/em&gt; (same as my project) and I am not going to initialize it&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%2Fippgqln0qdcj5jmk0zn9.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%2Fippgqln0qdcj5jmk0zn9.png" alt="new repository" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, I'm going to initialize my repo &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%2F55kfqo9co8w2e975gi73.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%2F55kfqo9co8w2e975gi73.png" alt="git init" width="800" height="38"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it is time to push my project to my github&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add origin https://github.com/celest67/nextjs-try1.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I'm going to do an initial commit with everything in my project and push it&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%2F6619afk2lpg3k6s73ywh.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%2F6619afk2lpg3k6s73ywh.png" alt="first commit" width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we are deploying to Vercel, make sure to have an account here &lt;a href="https://vercel.com/signup" rel="noopener noreferrer"&gt;https://vercel.com/signup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once inside Vercel it looks like we just have to import the correct repository by pressing the button import. (I had to install Vercel for GitHub and give it access)&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%2Fzj6cngppy7o73anxrhy6.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%2Fzj6cngppy7o73anxrhy6.png" alt="vercel import" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When deploying to Vercel, the platform automatically detects Next.js, runs &lt;code&gt;next build&lt;/code&gt;, and optimizes the build output for you, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Persisting cached assets across deployments if unchanged&lt;/li&gt;
&lt;li&gt;Immutable deployments with a unique URL for every commit&lt;/li&gt;
&lt;li&gt;Pages are automatically statically optimized, if possible&lt;/li&gt;
&lt;li&gt;Assets (JavaScript, CSS, images, fonts) are compressed and served from a Global Edge Network&lt;/li&gt;
&lt;li&gt;API Routes are automatically optimized as isolated Serverless Functions that can scale infinitely&lt;/li&gt;
&lt;li&gt;Middleware are automatically optimized as Edge Functions that have zero cold starts and boot instantly&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then it gives me some configuration options which I'm not going to change and click Deploy&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%2F3a2oxizr23u2j8l2lolh.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%2F3a2oxizr23u2j8l2lolh.png" alt="config" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I can see a screen with some feedback of the process&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%2F3yexopazogb1r8snboe1.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%2F3yexopazogb1r8snboe1.png" alt="process" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And in less than a minute I get a success message&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%2Fy5w686jy7whw31vety2y.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%2Fy5w686jy7whw31vety2y.png" alt="Congratulations" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I go to the dashboard I can see where my app is &lt;a href="https://nextjs-try1.vercel.app/" rel="noopener noreferrer"&gt;https://nextjs-try1.vercel.app/&lt;/a&gt;&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%2Frq2ihu79hkm209i2wc1t.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%2Frq2ihu79hkm209i2wc1t.png" alt="dashboard" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well I think that is for today, seems to me like indeed it was easy, what do you think? what do you want to see next?&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>Trying Next.js</title>
      <dc:creator>Paula Marín S</dc:creator>
      <pubDate>Thu, 26 Jan 2023 20:58:54 +0000</pubDate>
      <link>https://forem.com/celest67/trying-nextjs-4ee4</link>
      <guid>https://forem.com/celest67/trying-nextjs-4ee4</guid>
      <description>&lt;p&gt;Have you ever have to do a POC or something like it, where you need to get an app running as easy and pretty as possible?&lt;br&gt;
Lately talking to different friends and colleagues I got many comments about Next.js, so I decided to give it a try and see how fast I could get something running.&lt;br&gt;
According to their web site &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js enables you to create full-stack web applications by extending the latest React features, and integrating powerful Rust-based JavaScript tooling for the fastest builds&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;More in detail &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js aims to have best-in-class developer experience and many built-in features, such as:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;An intuitive page-based routing system (with support for dynamic routes)&lt;/li&gt;
&lt;li&gt;Pre-rendering, both static generation (SSG) and server-side rendering (SSR) are supported on a per-page basis&lt;/li&gt;
&lt;li&gt;Automatic code splitting for faster page loads&lt;/li&gt;
&lt;li&gt;Client-side routing with optimized prefetching&lt;/li&gt;
&lt;li&gt;Built-in CSS and Sass support, and support for any CSS-in-JS library&lt;/li&gt;
&lt;li&gt;Development environment with Fast Refresh support&lt;/li&gt;
&lt;li&gt;API routes to build API endpoints with Serverless Functions&lt;/li&gt;
&lt;li&gt;Fully extendable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So let's go ahead and do the first step according to the instructions I found in their site, lets input in the terminal this command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest nextjs-try1 --use-npm --example "https://github.com/vercel/next-learn/tree/master/basics/learn-starter"&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command uses the &lt;a href="https://github.com/vercel/next-learn/tree/master/basics/learn-starter"&gt;template example&lt;/a&gt; and my project is going to be &lt;em&gt;nextjs-try1&lt;/em&gt; (I know not the best name, but I'm not sure yet what I want to build)&lt;/p&gt;

&lt;p&gt;First thing it told me that I need to install a package&lt;/p&gt;

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

&lt;p&gt;I said yes and then in seconds I got my project.&lt;/p&gt;

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

&lt;p&gt;If I see the folder that was created, this is what I get.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oJLp-vj3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7bevthn1pfqncjenoyts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oJLp-vj3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7bevthn1pfqncjenoyts.png" alt="Image description" width="880" height="77"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it looks like a I have where to put my pages, styles and public resources, so for now I'm just going to follow the instructions and try to run the project.&lt;/p&gt;

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

&lt;p&gt;Looks like I'm going to my localhost port 3000 and there it is my first page in Next.js.&lt;/p&gt;

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

&lt;p&gt;So far so good, I see why people have told me I could get something running fast with this.&lt;/p&gt;

&lt;p&gt;Even if I'm building something small usually at least I want to know that I can navigate between pages.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In Next.js, a page is a React Component exported from a file in the pages directory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I'm going to create a page called &lt;code&gt;hello-world.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hwlGOdWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pivnazogrz0htifd0p90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hwlGOdWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pivnazogrz0htifd0p90.png" alt="hello world" width="880" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I'm going to check if I can see my page with this url &lt;a href="http://localhost:3000/hello-world"&gt;http://localhost:3000/hello-world&lt;/a&gt; and this is what I get.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;In Next.js, you can use the Link Component next/link to link between pages in your application.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I'm going to go to my index.js file and change it like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vhiYvmhE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r1sehtb4fm34b83d875b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vhiYvmhE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r1sehtb4fm34b83d875b.png" alt="say hello world" width="880" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it, you can navigate between pages&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LD7WKv20--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yu9d4zvtttkx0b3u09um.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LD7WKv20--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yu9d4zvtttkx0b3u09um.png" alt="new index" width="880" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For now I'm going to leave it here, but I did look at the documentation and here are some things I want to try in some next posts, I'll update to links once I have the posts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/deployment-with-nextjs-41j7"&gt;Deployment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Integration with any library not related to Next (maybe victory? I have been wanting to try it)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/celest67/nextjs-with-eslint-3gl5"&gt;Integration with ESLint&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/nextjs-and-typescript-55ha"&gt;TypeScript integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/nextjs-with-cypress-3a5b"&gt;Testing with Cypress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/celest67/nextjs-with-jest-react-testing-library-3cc6"&gt;Testing with React Testing Library&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have any comments please leave them below.&lt;br&gt;
Cheers&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
