DEV Community

Cover image for To rewrite or not rewrite that is the question.
Alex Patterson for CodingCatDev

Posted on

To rewrite or not rewrite that is the question.

To rewrite or not rewrite that is the question.

I will admit I am thinking "out loud" here, hence the tag for discussion. I want to know how others are handling this dilema of when to use Web Components. I really want to hear from all of the React community on this one! Are you spending time creating any Web Components? Do you just live happily within the React space?

Why Web Components?

Having a set of web components that handle the logic for my firebase authentication is awesome! It makes having a set of business logic simple. It reduces my time to start up an app from scratch.

Angular Web Components

The one downside of this is requiring the build process for Angular to be included in each of my projects that require the Web Components. Now in reality I could probably use a private NPM to push the fully built js into a project.

Web Components in React

If you follow anything that I do, you will have noticed I am rewriting my app from Hugo into Gatsby, which is React based. I have read a lot that Web Components don't play well with React. However the react docs show that this isn't really true.

Pros vs. Cons to rewrite logic in React

Pros

  • Allows me to stay in a single framework
  • Less build time as Angular prod build and copy to app not required

Cons

  • Spending around 8 hours to rewrite

Discussion

Don't feel comfortable chatting openly?

Drop me a line:

๐ŸŽฅ YouTube: https://link.ajonp.com/youtube
๐ŸŒŽ Site: https://link.ajonp.com/๐Ÿ˜บ
๐Ÿ“ฆ GitHub: https://link.ajonp.com/github
๐Ÿ’ฌ Slack: https://link.ajonp.com/slack
๐Ÿฆ Twitter: https://link.ajonp.com/twitter

Top comments (2)

Collapse
 
avalander profile image
Avalander • Edited

From the #discuss tag guidelines:

These posts should be queries for community responses.

If it is more of a blog post, than a question it should not have this tag.

I get the sense that you might be trying to ask something to the community, but it is very unclear what exactly is it that you want input about. I suggest that you either update your post and make it clearer what input do you want from the community or remove the tag.

Collapse
 
codercatdev profile image
Alex Patterson

What I really want to know is if the react community would rather just use react...or if web components are something that they would go for. It is definitely a question...I will try and rewrite the post.