Skip to content

Commit

Permalink
Deploying to gh-pages from @ fc73ea0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Mar 13, 2024
1 parent 1bfaac3 commit 3aabed9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.1.1">
<title data-rh="true">Page Not Found | </title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" name="twitter:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" property="og:url" content="https://mkosir.github.io/typescript-style-guide/404.html"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | "><link data-rh="true" rel="icon" href="/typescript-style-guide/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://mkosir.github.io/typescript-style-guide/404.html"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/404.html" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://3CBFIG0U2G-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.683e204f.css">
<script src="/typescript-style-guide/assets/js/runtime~main.ead85f72.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/runtime~main.20801dbf.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/main.2be757c1.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
Expand Down
1 change: 1 addition & 0 deletions assets/js/e7ce6630.5333a7c2.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/js/e7ce6630.ff998bb8.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.1.1">
<title data-rh="true">TypeScript Style Guide | </title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" name="twitter:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" property="og:url" content="https://mkosir.github.io/typescript-style-guide/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="TypeScript Style Guide | "><meta data-rh="true" name="description" content="TypeScript Style Guide provides a concise set of conventions and best practices used to create consistent, maintainable code."><meta data-rh="true" property="og:description" content="TypeScript Style Guide provides a concise set of conventions and best practices used to create consistent, maintainable code."><link data-rh="true" rel="icon" href="/typescript-style-guide/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://mkosir.github.io/typescript-style-guide/"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/" hreflang="en"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://3CBFIG0U2G-dsn.algolia.net" crossorigin="anonymous"><script data-rh="true">function insertBanner(){var n=document.createElement("div");n.id="__docusaurus-base-url-issue-banner-container";n.innerHTML='\n<div id="__docusaurus-base-url-issue-banner" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">/typescript-style-guide/</span> </p>\n <p>We suggest trying baseUrl = <span id="__docusaurus-base-url-issue-banner-suggestion-container" style="font-weight: bold; color: green;"></span></p>\n</div>\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),s=window.location.pathname,o="/"===s.substr(-1)?s:s+"/";e.innerHTML=o}document.addEventListener("DOMContentLoaded",(function(){void 0===window.docusaurus&&insertBanner()}))</script><link rel="search" type="application/opensearchdescription+xml" href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.683e204f.css">
<script src="/typescript-style-guide/assets/js/runtime~main.ead85f72.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/runtime~main.20801dbf.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/main.2be757c1.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
Expand Down Expand Up @@ -57,6 +57,14 @@ <h2 class="anchor anchorWithStickyNavbar_LWe7" id="data-immutability">Data Immut
<p>Majority of the data should be immutable (use <code>Readonly</code>, <code>ReadonlyArray</code>, always return new array, object etc). To keep cognitive load for future developers low, try to keep data objects small.<br>
<!-- -->As an exception mutations should be used sparingly in cases where truly necessary: complex objects, performance reasoning etc.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="types">Types<a href="#types" class="hash-link" aria-label="Direct link to Types" title="Direct link to Types"></a></h2>
<p>When creating types try to think of how they would best <strong>describe your code</strong>.<br>
<!-- -->Try to be expressive by keeping them as <strong>narrow as possible</strong> which brings benefits to the codebase:</p>
<ul>
<li>Increased Type Safety - Catch errors at compile-time, since narrowed types provide more specific information about the shape and behavior of your data.</li>
<li>Improved Code Clarity - Reduced cognitive load by providing clearer boundaries and constraints on your data which makes your code easier to understand by other developers.</li>
<li>Easier Refactoring - Refactor with confidence, since types are narrow, making changes to your code becomes less risky.</li>
<li>Optimized Performance - In some cases, narrow types can help the TypeScript compiler generate more optimized JavaScript code.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="type-inference">Type Inference<a href="#type-inference" class="hash-link" aria-label="Direct link to Type Inference" title="Direct link to Type Inference"></a></h3>
<p>As rule of thumb, explicitly declare a type when it help narrows it.</p>
<div class="mb-2"><div class="mb-1 inline-flex cursor-pointer items-center rounded-lg px-1.5 text-[11px] font-normal bg-gray-200 text-neutral-600"><div class="mr-1">Note</div><svg fill="currentColor" viewBox="0 0 16 16" height="12px" width="12px"><path d="M8 15A7 7 0 118 1a7 7 0 010 14zm0 1A8 8 0 108 0a8 8 0 000 16z"></path><path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 11-2 0 1 1 0 012 0z"></path></svg></div><div aria-hidden="true" class="rah-static rah-static--height-zero" style="height:0;overflow:hidden"><div><div class="rounded-md border-0 border-l-[5px] border-solid p-2 text-xs italic [&amp;_p]:mb-0 border-gray-200 bg-neutral-600 text-gray-200"><p>Just because you don&#x27;t need to add types, doesn&#x27;t mean you shouldn&#x27;t. In some cases explicit type declaration can
Expand Down Expand Up @@ -319,6 +327,9 @@ <h4 class="anchor anchorWithStickyNavbar_LWe7" id="ui---design-system">UI - Desi
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="store--pass-data">Store &amp; Pass Data<a href="#store--pass-data" class="hash-link" aria-label="Direct link to Store &amp; Pass Data" title="Direct link to Store &amp; Pass Data"></a></h3>
<ul>
<li>
<p>Pass only the necessary props to child components rather than passing the entire object.</p>
</li>
<li>
<p>Utilize storing state in the URL, especially for filtering, sorting etc.</p>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion search.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.1.1">
<title data-rh="true">Search the documentation | </title><meta data-rh="true" property="og:title" content=" "><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" name="twitter:image" content="https://mkosir.github.io/typescript-style-guide/img/typescript-card.png"><meta data-rh="true" property="og:url" content="https://mkosir.github.io/typescript-style-guide/search"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="robots" content="noindex, follow"><link data-rh="true" rel="icon" href="/typescript-style-guide/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://mkosir.github.io/typescript-style-guide/search"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/search" hreflang="en"><link data-rh="true" rel="alternate" href="https://mkosir.github.io/typescript-style-guide/search" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://3CBFIG0U2G-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" href="/typescript-style-guide/opensearch.xml"><link rel="stylesheet" href="/typescript-style-guide/assets/css/styles.683e204f.css">
<script src="/typescript-style-guide/assets/js/runtime~main.ead85f72.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/runtime~main.20801dbf.js" defer="defer"></script>
<script src="/typescript-style-guide/assets/js/main.2be757c1.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
Expand Down

0 comments on commit 3aabed9

Please sign in to comment.