gregrickaby / nextjs-wordpress

💀 It's headless WordPress!
https://nextjswp.com
MIT License
254 stars 54 forks source link

decouple ui framework styling/components from structural layout and data rendering #69

Closed montchr closed 1 year ago

montchr commented 1 year ago

Personally, I would prefer not to use Mantine (won't go into reasoning as it's a matter of opinion). At the time of writing, Mantine seems pretty tightly coupled to the project, so that means I need to remove and translate all of its usages in order to use my preferred approach. That's time consuming on my end, but I'd imagine that pursuing a more UI-agnostic and composable approach here would be even more challenging and difficult to support (and I know you just changed it!). But it's a "nice to have".

[Edit: expanded bikeshedding]: Perhaps an approach to accomplishing this would be building out a separate example in //apps/ with minimal styling, thus providing a testbed for a "structure-only" template implementing a set of minimal components and moving the Mantine layers to a new monorepo ui package like in some of the Turbo examples. The current nextjs app would leverage Mantine components via ui in addition to a new set of structural components. A new "minimal" example would only use the new structural components with no dependency on the components from ui.

montchr commented 1 year ago

Yeah in the name of keeping things simple its probably best to avoid over-abstraction. Mantine seems like a decently-flexible choice that doesn’t make everything unreadable like Tailwind. I’ll close this out because it’s probably not worth the extra maintenance effort.

gregrickaby commented 1 year ago

@montchr The decision to use Mantine was one I considered for several weeks. Ultimately, I wanted to leverage a UI library because I was no longer interested in creating and maintaining complex UI components (e.g., forms, notifications, theming, etc...).

The reason for choosing Mantine itself, was how much I love the collection of hooks and packages available. Like you, I prefer the Mantine's readable components vs. Tailwind (although I do also love Tailwind!) and I wanted to totally avoid using the big players like Google's Material UI and the like. Finally, Mantine is "independently run" and largely supported by a very active community.

I realize this decision causes tension, such as having to learn a new UI framework, but if you can get through the learning curve, I think you'll find that working with Mantine is an absolute delight.