DEV Community

loading...

Discussion on: How to Build a PWA without a Build Step

Collapse
niorad profile image
Antonio Radovcic

I think this is a very good way to go for lots of projects. Not having a build is liberating and my preferred way especially for personal projects, where I don't need to remember all the build-commands after being away for a while. Also your last bit about developing buildless, but having the build-step only for prod is an important point. Especially for things like vendor-prefixing css and the like.

I'd be interested in your thoughts on using WC to structure web-apps in a similar fashion to react-apps. Meaning using WC for "all the things" like React-Components. Of course it works, but lots of times I read that WC was intended to be a low-level-API for creating custom elements for new features, rather than a way of composing parts of an app.

Collapse
wes566 profile image
Wes Author

Since writing this the pika web tool has been renamed to snowpack and has production optimization, which is great and my preferred way to build projects at the moment.

In regards to using components for "all the things"... I don't really like to do that. I default to old-school HTML/CSS files for the more "static" pages (landing page, about page - stuff that doesn't have a lot of server calls or need much JS), and then I still use WCs for parts of the page that I want to re-use pieces. And then dynamic pages (with more server calls and JS) I tend to use lit-element to make a component out of the entire page. Which is another advantage of buildless (and server-side routing) is the flexibility to mix and match for different pages.

Collapse
niorad profile image
Antonio Radovcic

Aah yes I saw Snowpack, it will probably be part of my next frontend-setup.

With "all the things" I meant doing an entire page as WC. Did you experience any bigger drawbacks compared to React/Vue?
Do you usually keep LitElements Shadow-DOM as it comes, or do you prefer without? I read about problems folks have with Shadow-DOM when it comes to form-handling/labels and css/style-sharing.
Are you using anything special for handling state?

(Sorry for asking so much, just answer if it's really ok. I'm thinking so much about the whole topic currently and it's not a lot of folks writing about that)