DEV Community

mnmartinelli
mnmartinelli

Posted on

3 2

Open-WC Beginner Guide

Welcome to the world of Web Components!

Open-WC is a powerful tool to develop web-components fast. With some simple JavaScript here, and few installs there, you'll be an experienced developer in no time.

  • I highly recommend using Linux or WSL for web development, however this step is optional and all install links will be provided below. If you would look to install WSL with a customized terminal look and feel, follow my guide here.

Dependencies Required:

  • NodeJS NodeJS includes NPM and both can be installed with one command:
$ sudo apt-get install -y nodejs
Enter fullscreen mode Exit fullscreen mode

Optional Installs:

  • VS-Code
  • Recommended VSCode extensions: VSCode extensions

Open-WC Installation/Setup:

  1. Create a folder and enter into the directory:

    $ mkdir open-wc-demo
    $ cd open-wc-demo
    
  2. NPM install Open-WC

    $ npm init @open-wc
    
  3. Select "Scaffold a new project" using the enter key.

  4. Select "Web Component" using the enter key.

  5. Select All (Linting, Testing, & Demoing) by pressing "a" and then enter key.

  6. Please select "No" to not use typescript. We will be using Javascript.

  7. Then give your web-component a name, I will be calling mine "open-wc-test".
    Step 7 results

  8. Select Yes to write the file structure to the disk.

  9. Then, select "Yes, with npm" to install all dependencies.

  10. Lastly, to test if everything works run npm start

Your local web-sever should look like this

Developing with Open-WC

Hello World example provided by Lit Playground

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
mrhili profile image
Mrhili Mohamed Amine

what is it exactly ?

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay