phoenixframework / phoenix

Peace of mind from prototype to production
https://www.phoenixframework.org
MIT License
21.45k stars 2.88k forks source link

Simplified live generator #5900

Closed mcrumm closed 3 months ago

mcrumm commented 3 months ago

Simplifies the phx.gen.live generator with the following changes:

mcrumm commented 3 months ago

@josevalim ready for another look!

TheArrowsmith commented 2 months ago

Why remove modal from corecomponents? Just because it's not used in the generators doesn't mean it's not useful elsewhere, e.g. to include it in one of my own liveviews/components.

josevalim commented 2 months ago

The rule has always been to ship with the components used by the generators, otherwise we could easily argue that core components should be a 1000LOC file with accordions, stats bars, breadcrumbs, etc. People can always add the features they need.

josevalim commented 2 months ago

I would also add that the complexity/size of CoreComponents and the complexity of the generated LiveView pages with LiveComponents and more, have often been cited by newcomers as a challenge for getting started, because it felt too daunting.

At the beginning, we used those generators to showcase LiveView features. The goal with these changes is to align this with the phx.gen.html generators and make them more about providing the simplest foundation for people to build on.

TheArrowsmith commented 2 months ago

Ah okay, that's totally fair. Thanks for the reply!

clarkware commented 1 month ago

Great work, Michael! This will definitely help folks new to Phoenix. Can't wait to have it in an official release! 😀