<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oski Dev</title>
    <description>The latest articles on DEV Community by Oski Dev (@oskidev).</description>
    <link>https://dev.to/oskidev</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%2F956028%2F6ae9b736-fbfe-4ed5-bd13-dca4a3dbd6f7.png</url>
      <title>DEV Community: Oski Dev</title>
      <link>https://dev.to/oskidev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oskidev"/>
    <language>en</language>
    <item>
      <title>Data ethics in AI 🤖</title>
      <dc:creator>Oski Dev</dc:creator>
      <pubDate>Mon, 06 Nov 2023 18:44:31 +0000</pubDate>
      <link>https://dev.to/oskidev/data-ethics-in-ai-19g8</link>
      <guid>https://dev.to/oskidev/data-ethics-in-ai-19g8</guid>
      <description>&lt;p&gt;I'm currently reading about data ethics in AI and I'm coming to the conclusion that black men and black women are at a disadvantage. Data bias is significant and has been prevalent for various reasons, likely to persist for a long time.&lt;br&gt;
What are your thoughts on this? Should we use biased systems that essentially dictate our lives, knowing about this issue? Do you think we can control or mitigate this? &lt;br&gt;
I'm curious to hear your opinion. 🤔&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>community</category>
    </item>
    <item>
      <title>Linksooon - Save. Share. Browse. All the amazing links.</title>
      <dc:creator>Oski Dev</dc:creator>
      <pubDate>Tue, 17 Oct 2023 14:01:11 +0000</pubDate>
      <link>https://dev.to/oskidev/linksooon-save-share-browse-all-the-amazing-links-3b0c</link>
      <guid>https://dev.to/oskidev/linksooon-save-share-browse-all-the-amazing-links-3b0c</guid>
      <description>&lt;h2&gt;
  
  
  Hi, I would like to present the beta version of the application I created last time. I hope you will find it useful and I would appreciate any feedback and tips on what I should improve. 😋
&lt;/h2&gt;




&lt;p&gt;&lt;strong&gt;Linksooon&lt;/strong&gt; is designed to help you organize, share, and explore links in a way that keeps you updated and informed.&lt;/p&gt;

&lt;p&gt;The main goal of the Linksooon application is to empower users to share interesting and useful links that they discover and want to save. At the core of this experience is the concept of Linksooon Points, which plays a pivotal role in making link sharing more rewarding and engaging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Starting with 20 Linksooons (points):&lt;/strong&gt; When you join Linksooon, you kick off your journey with a gift of 20 Linksooons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost of Saving a Link:&lt;/strong&gt; Saving a link to your collection costs you &lt;em&gt;1 Linksooon&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Earning Points by Sharing:&lt;/strong&gt; Each time you share a link with the Linksooon community by changing its status to "published," you earn &lt;em&gt;2 Linksooons&lt;/em&gt;. This means the more you contribute and share valuable content, the more points you accumulate!&lt;/p&gt;

&lt;p&gt;These points not only reflect your engagement within the platform but are also part of a bigger plan. I'm collecting data on the total points earned by users to explore opportunities for enhancing the application with exciting new features in future updates.&lt;/p&gt;




&lt;p&gt;Note that Linksooon is currently in beta. This means that the platform is evolving and user feedback is invaluable. Feel free to write suggestions in the comments.&lt;/p&gt;

&lt;p&gt;And most importantly, here is the link: &lt;a href="https://linksooon.vercel.app/"&gt;https://linksooon.vercel.app/&lt;/a&gt; 🚀&lt;/p&gt;

</description>
      <category>website</category>
      <category>community</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Next.js 13 special files, data fetching and head tag — page, layout and template</title>
      <dc:creator>Oski Dev</dc:creator>
      <pubDate>Wed, 01 Mar 2023 16:34:45 +0000</pubDate>
      <link>https://dev.to/oskidev/nextjs-13-special-files-data-fetching-and-head-tag-page-layout-and-template-1hh</link>
      <guid>https://dev.to/oskidev/nextjs-13-special-files-data-fetching-and-head-tag-page-layout-and-template-1hh</guid>
      <description>&lt;p&gt;&lt;strong&gt;Before we start, note that&lt;/strong&gt; by default components in Next.js 13 are Server Components. This roughly means that you can't use client side effects and actions like &lt;em&gt;useEffect&lt;/em&gt;, &lt;em&gt;useState&lt;/em&gt;, &lt;em&gt;onClick&lt;/em&gt;, etc. You can make component client side by adding &lt;strong&gt;&lt;em&gt;"use client";&lt;/em&gt;&lt;/strong&gt; directive on top of the component over the imports.&lt;br&gt;
Server Components also improve performance by reducing the amount of JavaScript sent to a client, make it easier to fetch data, are better for SEO because search engine bots can easily access the HTML content of the page, and don't need to wait for client-side code execution.&lt;/p&gt;

&lt;p&gt;If you want to know the basics of the routing and app directory, you can visit the &lt;a href="https://medium.com/@gkarol/next-js-13-app-directory-routing-994cf0f9b52c" rel="noopener noreferrer"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pages
&lt;/h2&gt;

&lt;p&gt;The most important file in the new app directory is the page. This is because the page file makes the route publicly accessible.&lt;/p&gt;

&lt;p&gt;You create page by exporting the function as default from the &lt;em&gt;page.tsx&lt;/em&gt; file like in the example below. You can call the function whatever you want.&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%2F71qre9xl3bl3dc3nel60.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%2F71qre9xl3bl3dc3nel60.png" alt="Code example of home page in nextjs 13" width="800" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Layouts
&lt;/h2&gt;

&lt;p&gt;In &lt;em&gt;layout.tsx&lt;/em&gt;, you create a UI that is shared between multiple child pages. So you can create a UI for &lt;em&gt;/company/about&lt;/em&gt; and this layout will be applied to all pages under route &lt;em&gt;/company/about/*&lt;/em&gt;, but not for siblings routes like &lt;em&gt;/company/career&lt;/em&gt;.&lt;br&gt;
You can create a layout at any level of the route.&lt;/p&gt;

&lt;p&gt;On navigation, layouts preserve state, remain interactive, and do not re-render.&lt;/p&gt;

&lt;p&gt;You can create a layout by exporting the function as default from the &lt;em&gt;layout.tsx&lt;/em&gt; file.&lt;br&gt;
&lt;strong&gt;Note that&lt;/strong&gt; the top-most layout function is called &lt;em&gt;RootLayout&lt;/em&gt;, any other layout you can call as you want. In the example below you can see RootLayout which is required.&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%2Fazcywj74hkm651qpxjcc.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%2Fazcywj74hkm651qpxjcc.png" alt="code example of root layout in nextjs 13" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In root layout you should include &lt;em&gt;html&lt;/em&gt; and &lt;em&gt;body&lt;/em&gt; tags.&lt;/p&gt;

&lt;p&gt;Any other layout can look like this (layout for /&lt;em&gt;about&lt;/em&gt; 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%2Fs0idx5xclimjcl6ctt67.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%2Fs0idx5xclimjcl6ctt67.png" alt="code example of common layout in nextjs13" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can wrap the children in whatever you want.&lt;br&gt;
Each layout accepts the children prop that will be populated with child layouts and pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Templates
&lt;/h2&gt;

&lt;p&gt;Templates are similar to layouts, they also wrap each child layout and page but templates create a new instance for each of their children as they navigate, as opposed to layouts that persist on routes and preserve state.&lt;br&gt;
This means that if you navigate between routes that share a template, DOM elements are recreated and new instance of the component are mounted.&lt;br&gt;
You can create a template just like a common layout.&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%2Fagxc4hdrzyeh4gntg79y.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%2Fagxc4hdrzyeh4gntg79y.png" alt="code example of template in nextjs13" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note that&lt;/strong&gt; if you don't have a specific reason to use template, you should use layout. Templates may be useful for cases like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter/exit animations using CSS or animation libraries.&lt;/li&gt;
&lt;li&gt;Features that rely on useEffect (e.g logging page views) and useState (e.g a per-page feedback form).&lt;/li&gt;
&lt;li&gt;To change the default framework behavior. For example, Suspense Boundaries inside layouts only show the fallback the first time the Layout is loaded and not when switching pages. For templates, the fallback is shown on each navigation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data fetching
&lt;/h2&gt;

&lt;p&gt;Pages and layouts like other components can fetch data. Because of the new Server Components, fetching data in Next.js 13 became really handy and have &lt;a href="https://beta.nextjs.org/docs/data-fetching/fundamentals#fetching-data-on-the-server" rel="noopener noreferrer"&gt;a lot of advantages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also fetch data in Client Components. Libraries such as &lt;a href="https://swr.vercel.app" rel="noopener noreferrer"&gt;SWR&lt;/a&gt; or &lt;a href="https://tanstack.com/query/v4/" rel="noopener noreferrer"&gt;React Query&lt;/a&gt; are recommended in Client Components. (In the future it'll be also possible using &lt;em&gt;use()&lt;/em&gt; hook).&lt;/p&gt;

&lt;p&gt;You can access the new data fetching system using native &lt;em&gt;fetch()&lt;/em&gt; Web API, and use &lt;em&gt;async&lt;/em&gt;/&lt;em&gt;await&lt;/em&gt; in Server Components.&lt;/p&gt;

&lt;p&gt;You can fetch data in multiple components, Next.js 13 will automatically cache requests (&lt;em&gt;GET&lt;/em&gt;) that have the same input in temporary cache. This way you avoid situations in which the same data can be fetched more than once. It is useful for fetching data in layouts because it's not possible to pass data between parent layout and its children. Just fetch data directly inside the layout that needs it, and Next.js 13 will take care of caching and deduping requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two data fetching patterns
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;parallel data fetching&lt;/strong&gt; - if you don't have one query dependent on the previous one, you can use parallel data fetching. This reduces client-server waterfalls and the total time it takes to load data, because requests in a route are eagerly initiated and starts fetching at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sequential data fetching&lt;/strong&gt; - if you have one query dependent on the previous one you can use sequential data fetching. This can lead to longer loading time but it is useful in cases where one fetch depends on the result of the previous one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to know more about data fetching patterns &lt;a href="https://beta.nextjs.org/docs/data-fetching/fetching#data-fetching-patterns" rel="noopener noreferrer"&gt;visit Next.js 13 documentation&lt;/a&gt;.&lt;br&gt;
If you want to expand your knowledge in general about data fetching in Next.js 13 &lt;a href="https://beta.nextjs.org/docs/data-fetching/fundamentals" rel="noopener noreferrer"&gt;here is the link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modifying &lt;em&gt;head&lt;/em&gt; tag
&lt;/h2&gt;

&lt;p&gt;One more thing you should know is a new way of modifying &lt;em&gt;head&lt;/em&gt; tag.&lt;/p&gt;

&lt;p&gt;If you use static values in head tag:&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%2Fyb6waf9x2tytbovhffya.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%2Fyb6waf9x2tytbovhffya.png" alt="Static way to modifying head tag in nextjs13" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you use dynamic data in head tag:&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%2Furo5ybahuclby3yhyc42.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%2Furo5ybahuclby3yhyc42.png" alt="Dynamin way to modifying head tag in nextjs13" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's all in this article. If you want to expand your knowledge, &lt;a href="https://beta.nextjs.org/docs/getting-started" rel="noopener noreferrer"&gt;check out the documentation&lt;/a&gt;.&lt;br&gt;
I hope you enjoyed! 🚀&lt;/p&gt;

</description>
      <category>vibecoding</category>
    </item>
    <item>
      <title>Next.js 13 - app directory &amp; routing</title>
      <dc:creator>Oski Dev</dc:creator>
      <pubDate>Wed, 22 Feb 2023 19:22:17 +0000</pubDate>
      <link>https://dev.to/oskidev/nextjs-13-app-directory-routing-3lfh</link>
      <guid>https://dev.to/oskidev/nextjs-13-app-directory-routing-3lfh</guid>
      <description>&lt;p&gt;In this article I will introduce you to new &lt;em&gt;app&lt;/em&gt; directory and new routing system in Next.js 13.&lt;/p&gt;

&lt;p&gt;New routing system works in new &lt;em&gt;app&lt;/em&gt; directory. At the same time you can work in the new &lt;em&gt;app&lt;/em&gt; and old &lt;em&gt;pages&lt;/em&gt; directory but important to know that &lt;strong&gt;routes across directories should not resolve to the same URL path. This may lead to errors.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can also collocate your own various files inside folders (components, tests, stylesheets and more)&lt;/p&gt;




&lt;h2&gt;
  
  
  Component hierarchy within folder
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyoybgrnnuhvnas18xzl.jpeg" 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%2Fuyoybgrnnuhvnas18xzl.jpeg" alt="Example of component hierarchy from next.js 13 documentation" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;
Image from next.js 13 docs. https://beta.nextjs.org/docs/routing/fundamentals#component-hierarchy






&lt;h2&gt;
  
  
  Defining routes
&lt;/h2&gt;

&lt;p&gt;To define the route (single path of nested folders) you use folders. Files in folders are used to create UI that is shown for the route segment. As I mentioned in a previous article, the &lt;em&gt;page.js&lt;/em&gt; file makes the path publicly available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good to know that you can also use &lt;em&gt;.jsx&lt;/em&gt; and &lt;em&gt;.tsx&lt;/em&gt; extensions for special files. Next.js 13 supports typescript out of the box!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the following examples, I will use typescript.&lt;/p&gt;

&lt;p&gt;To create home page, create &lt;em&gt;page.tsx&lt;/em&gt; file in the &lt;em&gt;app&lt;/em&gt; directory and export the function. You can call the function whatever you want.&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%2Fl6mlja6yx7ubg8ytx51y.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%2Fl6mlja6yx7ubg8ytx51y.png" alt="Sample code" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can visit &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create nested routes you create new folder called &lt;em&gt;about&lt;/em&gt; inside &lt;em&gt;app&lt;/em&gt; directory. In &lt;em&gt;about&lt;/em&gt; folder create &lt;em&gt;page.tsx&lt;/em&gt; file to make the path publicly accessible.&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%2Fkzgq63i2scg9ld48d3rc.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%2Fkzgq63i2scg9ld48d3rc.png" alt="Sample code" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can visit &lt;a href="http://localhost:3000/about" rel="noopener noreferrer"&gt;http://localhost:3000/about&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remember that you can create other files in folders but only &lt;em&gt;page.tsx&lt;/em&gt; makes path accessible.&lt;br&gt;
I will introduce you to other special files in future articles.&lt;/p&gt;




&lt;h2&gt;
  
  
  Route groups
&lt;/h2&gt;

&lt;p&gt;With route groups, you can create folders in the &lt;em&gt;app&lt;/em&gt; directory without affecting the URL.&lt;br&gt;
You can create route groups by wrapping a folder's name in parenthesis: &lt;em&gt;(folderName)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Route groups can be used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;organize routes without affecting the URL structure&lt;/li&gt;
&lt;li&gt;opting-in specific route segments into a layout&lt;/li&gt;
&lt;li&gt;create multiple root layouts by splitting your application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple example from next.js 13 documentation:&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%2Fm62josckwne6shlgma95.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%2Fm62josckwne6shlgma95.png" alt="Example of route groups from next.js 13 documentation" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;
Image from next.js 13 docs https://beta.nextjs.org/docs/routing/defining-routes#example-organize-routes-without-affecting-the-url-path



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: &lt;em&gt;you can create different layout for each route group.&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Note&lt;/strong&gt;: &lt;em&gt;any route segment can optionally define its own layout. Layouts are shared across all pages in that segment. You can create layout only for shop routes group by adding layout on top of the shop group.&lt;/em&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%2Fd41kgb4liiqnbzs7xstv.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%2Fd41kgb4liiqnbzs7xstv.png" alt="Example of layout for single group from next.js 13 documentation" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;
Image from next.js 13 docs. https://beta.nextjs.org/docs/routing/defining-routes#example-opting-specific-segments-into-a-layout



&lt;p&gt;Routes inside route group shouldn't resolve to the same URL, so you can't have about folder inside (marketing) route group and inside (shop) route group.&lt;/p&gt;




&lt;h2&gt;
  
  
  Dynamic segments
&lt;/h2&gt;

&lt;p&gt;If you want to create routes from dynamic data, and you don't know the names of the routes, you can use dynamic segments.&lt;br&gt;
Dynamic segments are filled during request or pre-rendered at build time.&lt;/p&gt;

&lt;p&gt;To create dynamic segment, wrap folder's name in square bracket: &lt;em&gt;[folderName]&lt;/em&gt;. Dynamic segments are passed as the &lt;em&gt;params&lt;/em&gt; prop to &lt;em&gt;layout&lt;/em&gt;, &lt;em&gt;page&lt;/em&gt;, &lt;em&gt;route&lt;/em&gt; and &lt;em&gt;generateMetadata&lt;/em&gt; functions.&lt;/p&gt;

&lt;p&gt;In the following example, I created dynamic segments for blog posts that I don't know the name of.&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%2Fqi9ptwa7c4go3dmv9hy5.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%2Fqi9ptwa7c4go3dmv9hy5.png" alt="Sample code" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you can visit &lt;a href="http://localhost:3000/blog/nextjs13" rel="noopener noreferrer"&gt;http://localhost:3000/blog/nextjs13&lt;/a&gt; and you should see:&lt;br&gt;
&lt;em&gt;Blog with id: nextjs13&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;That's all in this introduction to routing in Next.js 13. I hope that you can better understand basics of new routing and the &lt;em&gt;app&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;If you want to know more about, for example &lt;em&gt;Catch-all Segments&lt;/em&gt; or if you want to expand your knowledge, I recommend Next.js 13 documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One more important thing&lt;/strong&gt;: &lt;em&gt;By default, components inside the app directory are Server Components. I will write more about Server Components later.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>security</category>
      <category>cloudnative</category>
      <category>containers</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Next.js 13 — introduction</title>
      <dc:creator>Oski Dev</dc:creator>
      <pubDate>Thu, 16 Feb 2023 16:55:50 +0000</pubDate>
      <link>https://dev.to/oskidev/nextjs-13-introduction-dhl</link>
      <guid>https://dev.to/oskidev/nextjs-13-introduction-dhl</guid>
      <description>&lt;p&gt;Hi! In my second article I want to introduce you to Nextjs 13. This article aims to present the most important things introduced in Next.js 13. In the following articles I will expand every topic.&lt;/p&gt;

&lt;p&gt;So what’s new in Next.js 13?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;app&lt;/em&gt;&lt;/strong&gt; directory —instead of a pages directory, we can now use the app directory with new routing system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;page.js&lt;/em&gt;&lt;/strong&gt; — creates UI of a route and makes a path publicly accessible&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;layout.js&lt;/em&gt;&lt;/strong&gt; — UI that is shared between multiple pages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;template.js&lt;/em&gt;&lt;/strong&gt; — templates are similar to layouts in that they wrap each child layout or page but I will expand on this topic later&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;loading.js&lt;/em&gt;&lt;/strong&gt; — creates loading UI&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;error.js&lt;/em&gt;&lt;/strong&gt; — define an error UI boundary for a route segment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;not-found.js&lt;/em&gt;&lt;/strong&gt; — creates UI to show when UI for the path is not found&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;route.js&lt;/em&gt;&lt;/strong&gt; — creates server-side API endpoints for a route (available in next@canary).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Server components&lt;/em&gt;&lt;/strong&gt; — components by default are server components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Next/font&lt;/em&gt;&lt;/strong&gt; — self-hosted fonts with zero layout shift&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;New &lt;strong&gt;&lt;em&gt;next/image&lt;/em&gt;&lt;/strong&gt; — faster with native browser lazy loading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improved &lt;strong&gt;&lt;em&gt;next/link&lt;/em&gt;&lt;/strong&gt; — simplified API without “a” tag inside&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These were the most important things introduced in the new version of Next.js. In the next article I will explain the basics of app directory and routing system.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>What means true positives?</title>
      <dc:creator>Oski Dev</dc:creator>
      <pubDate>Mon, 13 Feb 2023 20:28:23 +0000</pubDate>
      <link>https://dev.to/oskidev/what-means-true-positives-23hf</link>
      <guid>https://dev.to/oskidev/what-means-true-positives-23hf</guid>
      <description>&lt;p&gt;Hello! This is my first post ever and I am not an English speaker so I apologize in advance for any mistakes.&lt;/p&gt;

&lt;p&gt;Let me start from a little introduce of myself. I’m Junior Frontend Developer at startup. In my spare time, I read about machine learning/data science and this is the topic of this post.&lt;/p&gt;

&lt;p&gt;I was looking for answer to what are true positives, true negatives, false positives and false negatives. I found something with a little help of Google and chatGPT. I decided to write about it because I can better understand it and help you at the same time.&lt;/p&gt;

&lt;p&gt;So I found that:&lt;br&gt;
&lt;strong&gt;True positive&lt;/strong&gt; - this means that the model has classified a given unit as positive and indeed it is positive&lt;br&gt;
&lt;strong&gt;True negative&lt;/strong&gt; - this means that the model has classified a given unit as negative, and indeed it is negative.&lt;br&gt;
&lt;strong&gt;False positive&lt;/strong&gt; - this means that the model has classified a given unit as positive, and indeed it is negative.&lt;br&gt;
&lt;strong&gt;False negative&lt;/strong&gt; - this means that the model has classified a given unit as negative, and indeed it is positive.&lt;/p&gt;

&lt;p&gt;These concepts are used to evaluate the effectiveness of classification models and are important when interpreting the results. Many measures of model quality, such as accuracy, sensitivity and specificity, are based on these concepts.&lt;/p&gt;

&lt;p&gt;But now you can ask: &lt;strong&gt;What does it mean that a given unit is positive or negative?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An entity can be described as negative or positive depending on whether it meets a given criterion&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Good example is a model that classifies emails as spam or non-spam.&lt;br&gt;
In this case, the unit (email) can be marked as positive if it is spam, or negative if it is not spam.&lt;/p&gt;

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

&lt;p&gt;And this is it! I hope I helped you understand it better.&lt;br&gt;
I would appreciate any feedback 🥳&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>programming</category>
      <category>beginners</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
