{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "John&#39;s 11ty-starter template Blog",
  "language": "en",
  "home_page_url": "https://example.com",
  "feed_url": "https://example.com/feed/en.feed.json",
  "description": "TODO",
  "author": {
    "name": "John Forcina",
    "url": "https://example.com"
  },
  "items": [{
      "id": "https://example.com/11ty-starter/posts/en/second/",
      "url": "https://example.com/11ty-starter/posts/en/second/",
      "title": "Using the Wikipedia API via the wikipedia-query tag",
      "content_html": "<p>While familiar with them, prior to this week in class I had never used an API. APIs are useful tools that enable developers to connect to another service, Wikipedia in the case of this blog post, and communicate data.</p>\n<h2 id=\"fetch\" tabindex=\"-1\">Fetch <a class=\"direct-link\" href=\"#fetch\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p><code>fetch</code> is a JavaScript interface for making HTTP requests and receiving responses. It is a common way to retrieve data over the internet via APIs. In this lab, using <code>fetch</code> enables me to make an HTTP GET request for information from the Wikipedia API and send the response to be rendered by a web component. Take a look at how <code>fetch</code> is used in the wikipedia-query.js file:</p>\n<pre class=\"language-js\"><code class=\"language-js\"><span class=\"token function\">updateArticle</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">search<span class=\"token punctuation\">,</span> headers<span class=\"token punctuation\">,</span> language</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span><br>    <span class=\"token function\">fetch</span><span class=\"token punctuation\">(</span><br>      <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token string\">https://</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span>language<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">.wikipedia.org/w/api.php?origin=*&amp;action=query&amp;titles=</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span>search<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">&amp;prop=extracts&amp;format=json</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span><br>      headers<br>    <span class=\"token punctuation\">)</span><br>      <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">response</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span><br>        <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>response<span class=\"token punctuation\">.</span>ok<span class=\"token punctuation\">)</span> <span class=\"token keyword\">return</span> response<span class=\"token punctuation\">.</span><span class=\"token function\">json</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span><br>      <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><br>      <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">json</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span><br>        <span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span><span class=\"token function\">handleResponse</span><span class=\"token punctuation\">(</span>json<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span><br>      <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span><br>  <span class=\"token punctuation\">}</span></code></pre>\n<p>After sending the request to the Wikipedia API (which I’ll go over next) the resulting JSON response is sent to a LitElement to be rendered in HTML.</p>\n<p>The DOM is updated when variables are updated and may require the page to be re-rendered with new data. <code>fetch</code> can be used to assign variables data from an API. When the API is called and the variables are updated, the DOM is updated and the page is re-rendered.</p>\n<h2 id=\"wikipedia-api\" tabindex=\"-1\">Wikipedia API <a class=\"direct-link\" href=\"#wikipedia-api\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>The Wikipedia API allows developers to connect to Wikipedia and search or manage wiki entries. While the API has several actions, in this lab specifically I am using the query function. According to the <a href=\"https://www.mediawiki.org/wiki/API:Query\">API documentation</a>: “The <code>action=query</code> module allows you to fetch information about a wiki and the data stored in it, such as the wikitext of a particular page, the links and categories of a set of pages, or the token you need to change wiki content.” This lab is specifically querying for extracts of the specified pages.</p>\n<p>To use the API in this lab, I placed the <code>wikipedia-query</code> tag in the LocationFromIP.js file that is responsible for retrieving the location of the user who opens the page and rendering it on an embedded Google Map. I took the city and state data from the location API and stored it in two objects.</p>\n<p>I placed three tags at the bottom of the render function for the map iframe and link.</p>\n<pre class=\"language-js\"><code class=\"language-js\"><span class=\"token function\">render</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span><br>    <span class=\"token keyword\">const</span> url <span class=\"token operator\">=</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token string\">https://maps.google.com/maps?q=</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>lat<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">,</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>long<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">&amp;t=&amp;z=15&amp;ie=UTF8&amp;iwloc=&amp;output=embed</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">;</span><br>    <span class=\"token keyword\">return</span> html<span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token string\"><br>      &lt;iframe title=\"Where you are\" src=\"</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span>url<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">\">&lt;/iframe><br>      &lt;p><br>        &lt;a href=\"https://www.google.com/maps/@</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>lat<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">,</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>long<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">,14z\"<br>          >https://www.google.com/maps/@</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>lat<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">,</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>long<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">,14z&lt;/a<br>        ><br>      &lt;/p><br>      &lt;wikipedia-query search=\"</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>city<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">, </span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>state<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">\">&lt;/wikipedia-query><br>      &lt;wikipedia-query search=\"</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>city<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">\">&lt;/wikipedia-query><br>      &lt;wikipedia-query search=\"</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>state<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">\">&lt;/wikipedia-query><br>    </span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">;</span><br>  <span class=\"token punctuation\">}</span><br><span class=\"token punctuation\">}</span></code></pre>\n<p>The way the Wikipedia API works in this lab starts with the <code>wikipedia-query</code> tag. The location value is sent to the API as the search value for the <code>fetch</code>. After receiving the request, the API searches for a wiki page that matches the title sent. If a match is found, a JSON response is sent containing HTML extracts for that wiki page. An example JSON response for State College, Pennsylvania is shown below:</p>\n<pre class=\"language-json\"><code class=\"language-json\">batchcomplete<span class=\"token string\">\": \"</span>\"<span class=\"token punctuation\">,</span><br><span class=\"token property\">\"warnings\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><br><span class=\"token property\">\"extracts\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><br><span class=\"token property\">\"*\"</span><span class=\"token operator\">:</span> \"HTML may be malformed and/or unbalanced and may omit <br>inline images. Use at your own risk. Known problems are <br>listed at <br>https<span class=\"token operator\">:</span><span class=\"token comment\">//www.mediawiki.org/wiki/Special:MyLanguage/Extension:TextExtracts#Caveats.\"</span><br><span class=\"token punctuation\">}</span><br><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span><br><span class=\"token property\">\"query\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><br><span class=\"token property\">\"pages\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><br><span class=\"token property\">\"131800\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><br><span class=\"token property\">\"pageid\"</span><span class=\"token operator\">:</span> <span class=\"token number\">131800</span><span class=\"token punctuation\">,</span><br><span class=\"token property\">\"ns\"</span><span class=\"token operator\">:</span> <span class=\"token number\">0</span><span class=\"token punctuation\">,</span><br><span class=\"token property\">\"title\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"State College, Pennsylvania\"</span><span class=\"token punctuation\">,</span><br><span class=\"token property\">\"extract\"</span><span class=\"token operator\">:</span> \"&lt;link rel=\\\"mw-deduplicated-inline-style\\\" href=\\\"mw-data<span class=\"token operator\">:</span>TemplateStyles<span class=\"token operator\">:</span>r1033289096\\\">\\n&lt;p class=\\\"mw-empty-elt\\\">\\n&lt;/p>\\n&lt;p>&lt;b>State College&lt;/b> is a home rule municipality in Centre County in the Commonwealth of Pennsylvania.  It is a college town<span class=\"token punctuation\">,</span> dominated economically and demographically by the presence of the University Park campus of the Pennsylvania State University (Penn State).\\n&lt;/p>&lt;p>State College is the largest designated borough in Pennsylvania. It is the principal borough of the six municipalities that make up the State College area<span class=\"token punctuation\">,</span> the largest settlement in Centre County and one of the principal cities of the greater State College-DuBois Combined Statistical Area with a combined population of <span class=\"token number\">236</span><span class=\"token punctuation\">,</span><span class=\"token number\">577</span> as of the <span class=\"token number\">2010</span> United States Census. In the <span class=\"token number\">2010</span> census<span class=\"token punctuation\">,</span> the borough population was <span class=\"token number\">42</span><span class=\"token punctuation\">,</span><span class=\"token number\">034</span> with approximately <span class=\"token number\">105</span><span class=\"token punctuation\">,</span><span class=\"token number\">000</span> living in the borough plus the surrounding townships often referred to locally as the \\\"Centre Region.\\\" Many of these Centre Region communities also carry a \\\"State College<span class=\"token punctuation\">,</span> PA\\\" address although they are not part of the borough of State College.  \\\"Happy Valley\\\" and \\\"Lion Country\\\" are other terms used to identify the State College area including the borough as well as the townships of College<span class=\"token punctuation\">,</span> Harris<span class=\"token punctuation\">,</span> Patton<span class=\"token punctuation\">,</span> and Ferguson.\\n&lt;/p>\\n\\n\\n&lt;h2>&lt;span id=\\\"History\\\">History&lt;/span>&lt;/h2>\\n&lt;p>State College evolved from a village to a town to serve the needs of the Pennsylvania State College<span class=\"token punctuation\">,</span> founded as the Farmers' High School of Pennsylvania in <span class=\"token number\">1855</span>. State College was incorporated as a borough on August <span class=\"token number\">29</span><span class=\"token punctuation\">,</span> <span class=\"token number\">1896</span><span class=\"token punctuation\">,</span> and has grown with the college<span class=\"token punctuation\">,</span> which was renamed The Pennsylvania State University in <span class=\"token number\">1953</span>.\\n&lt;/p>&lt;p>In <span class=\"token number\">1973</span> State College adopted a home rule charter which took effect in <span class=\"token number\">1976</span>; since then<span class=\"token punctuation\">,</span> it has not been governed by the state's Borough Code<span class=\"token punctuation\">,</span> although it retains \\\"Borough of State College\\\" as its official name.\\n&lt;/p>&lt;p>The university has a post office address of University Park<span class=\"token punctuation\">,</span> Pennsylvania. When Penn State changed its name from College to University in <span class=\"token number\">1953</span><span class=\"token punctuation\">,</span> its president<span class=\"token punctuation\">,</span> Milton S. Eisenhower<span class=\"token punctuation\">,</span> sought to persuade the town to change its name as well. A referendum failed to yield a majority for any of the choices for a new name<span class=\"token punctuation\">,</span> and so the town remains State College. After this<span class=\"token punctuation\">,</span> Penn State requested a new name for its on-campus post office in the HUB-Robeson Center from the U.S. Post Office Department. The post office<span class=\"token punctuation\">,</span> which has since moved across an alley to the McAllister Building<span class=\"token punctuation\">,</span> is the official home of ZIP code <span class=\"token number\">16802</span> (University Park)...</code></pre>\n<p>The response is rendered in HTML to be displayed on the page.</p>\n<p>This API is a useful tool for people trying to access information about anything Wikipedia has a wiki on. You can check out the API documentation <a href=\"https://en.wikipedia.org/w/api.php\">here</a>. Take a look at the source code for this lab in my <a href=\"https://github.com/jforcina20/ip-project/blob/master/src/LocationFromIP.js\">github repository</a> to learn more about how I completed it.</p>\n",
      "date_published": "2022-01-30T00:00:00Z"
    },{
      "id": "https://example.com/11ty-starter/posts/en/first/",
      "url": "https://example.com/11ty-starter/posts/en/first/",
      "title": "Getting started with web components",
      "content_html": "<p>Prior to this week, when I thought of web development I thought of HTML and CSS. I only had a vague understanding of JavaScript and had heard of Node.js but didn’t know what it was. Now join me in getting all the necessary tooling installed to launch a simple hello-world web component.</p>\n<h2 id=\"what-are-web-components%3F\" tabindex=\"-1\">What are web components? <a class=\"direct-link\" href=\"#what-are-web-components%3F\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>Web components are a collection of web platform APIs that can be used to create custom and reusable HTML tags to be used in web pages and web apps. Learn more about them <a href=\"https://www.webcomponents.org/introduction\">here.</a></p>\n<p>We’ll be using open-wc in this post. It simplifies the process of developing web components by providing guides, tools, and libraries. Check out the <a href=\"https://open-wc.org/\">open-wc website</a> to learn more.</p>\n<h2 id=\"node.js\" tabindex=\"-1\">Node.js <a class=\"direct-link\" href=\"#node.js\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>This is the easiest step. To download Node.js, head over to <a href=\"https://nodejs.org/\">https://nodejs.org/</a> and click to download the LTS version for more stability. Download the installer and run it.</p>\n<p>Why do you need Node.js? Node is a lightweight JavaScript runtime that allows you to run server-side programming to quickly build network applications.</p>\n<h2 id=\"npm\" tabindex=\"-1\">npm <a class=\"direct-link\" href=\"#npm\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>npm is a package manager for JavaScript and is the default package manager for Node.js. Basically, npm lets you use code written by others in your own project without having to write it yourself.</p>\n<p>When you installed Node, npm was installed at the same time. You can check if it was installed and see which version you have by opening terminal and running <code>npm --version</code></p>\n<p><img src=\"https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugxk9mnpcq1mr24x3t9l.png\" alt=\"Image description\"></p>\n<h2 id=\"yarn\" tabindex=\"-1\">Yarn <a class=\"direct-link\" href=\"#yarn\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>Yarn is another JavaScript package manager, similar to npm. This is an optional step, you can choose to install it after installing Node and npm. To install, open terminal and run <code>npm install --global yarn</code></p>\n<p>You can check to make sure it installed by running <code>yarn --version</code></p>\n<p><img src=\"https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9vi2rp1o4dlf45qn4yh.png\" alt=\"Image description\"></p>\n<h2 id=\"create-a-directory-for-your-web-component\" tabindex=\"-1\">Create a directory for your web component <a class=\"direct-link\" href=\"#create-a-directory-for-your-web-component\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>Now that all the tooling is installed, you’re just about ready to get started. First, create a directory for your project. I created one by running <code>mkdir -p ~/Documents/git/ist402</code> but you can name it or place it wherever you want.</p>\n<h2 id=\"starting-your-open-wc-component\" tabindex=\"-1\">Starting your open-wc component <a class=\"direct-link\" href=\"#starting-your-open-wc-component\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>After navigating to your desired directory, run <code>npm init @open-wc</code> If there are no problems, you should be greeted with this screen:</p>\n<p><img src=\"https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0n1giwtztfnj8aapgzkn.png\" alt=\"Image description\"></p>\n<p>Congratulations! You’re ready to start working on your web component. Push enter to start your new project and choose the settings you want. Here’s a list of everything I chose:</p>\n<ul>\n<li>Web Component</li>\n<li>Enable Linting, Testing, and Demoing</li>\n<li>No TypeScript</li>\n<li>Install dependencies with yarn</li>\n</ul>\n<p>To start your component, run either <code>npm start</code> or <code>yarn start</code> depending on which package manager you installed. Your default web browser will launch and you’ll see your web component!</p>\n<p><img src=\"https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdvvc7fvkf66w412yx3o.png\" alt=\"Image description\"></p>\n<h2 id=\"what-do-these-files-do%3F\" tabindex=\"-1\">What do these files do? <a class=\"direct-link\" href=\"#what-do-these-files-do%3F\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-link\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n  <path d=\"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5\" />\n  <path d=\"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5\" />\n</svg>\n\n\n</a></h2>\n<p>Even a simple Hello World web component relies on many files for their functionality. You can check them out yourself (especially the /src folder) and see what’s going on behind the scenes.</p>\n<p>Checking out <a href=\"https://lit.dev/playground/#sample=examples/full-component\">Lit playground</a> was very helpful in understanding the JavaScript used in a boilerplate web component like the one I just made.</p>\n<p>I went through and commented what I thought several code blocks do. Take a look at my <a href=\"https://github.com/jforcina20/edtechjoker-lab1\">git repository</a> for this lab and see that I still have a lot to learn about web components myself!</p>\n",
      "date_published": "2022-01-16T00:00:00Z"
    }
  ]
}
