What's your preferred frontend installation option? #4075
Replies: 4 comments 11 replies
-
What about as a Rails generator?
Rails' generator system is moderately robust and offers tooling for creating all the files necessary to set up a starter frontend. It might be more reliable than building our own command line tool to do this. Additionally, it's a "normal Rails thing", so I'm always inclined to consider options like that. |
Beta Was this translation helpful? Give feedback.
-
What about option three: Shipping as engine with all the code and a bunch of generators helping to override a certain file/folder/feature. Ie.
etc. That way we would have best of both worlds. Regarding updates: Rails generators have conflict management with visual diffs build in. You can simply run the same generator again and Rails will ask you what to do with customizations. |
Beta Was this translation helpful? Give feedback.
-
I'm liking what @jarednorman and @tvdeyen are saying. In the last year I came from other platforms and learned Rails to use Solidus. I think something that:
Is a big advantage for the newcomer, because you get to observe the evolution from and empty Rails app, to something with Solidus The Gem installed, to a fully loaded app with a working frontend. Perhaps it might be an additional convenience to include one blank model decorator with a link to the docs inside it? It might also be nice if the installer is clever enough to see |
Beta Was this translation helpful? Give feedback.
-
I'm very much against the idea of allowing people to install In fact, we moved away from providing any storefront-related code in extensions, because there's no way we can provide a sensible default given the variety of styles, technologies and architectures across different Solidus stores. There's even a section in the new guides that discourages extension authors from injecting storefront code of any kind. All this considered, I think the only option we should provide is the ability to generate a starter storefront via a Rails generator that's provided by There's a couple of technical challenges here, but I don't think they're unsolvable:
Note: I think this should also apply this philosophy to solidus_auth_devise, which right now injects a bunch of routes and views into the host app. This should just be a generator that copies everything into your app. |
Beta Was this translation helpful? Give feedback.
-
Hello!
We are working on a new starter frontend for Solidus, that you can find here in an alpha version:
https://github.com/nebulab/solidus_starter_frontend/
We are in the process of deciding how to this new frontend should be installed in new stores.
We have a couple of options in mind and we would like to know your opinion:
1. as a gem
Exactly as we are doing with the current
solidus_frontend
gem, this can be added in the Gemfile of the application and, since it's a Rails Engine, make all its routes, controllers, views, helpers and assets available in the host application. The gemfile would look something like:To customize things it's a matter of overriding views (or using Deface, even if we wouldn't do that for the frontend), using
prepend
orclass_eval
for controllers as always.With this approach, we can still provide a task to copy views (probably adding controllers as well) as we are currently doing with
solidus_frontend
.2. as an installer
The new gem will not be part of the bundle. You should install it in your system and run a command to install it. Something like:
The installer will copy everything (views, controllers, routes, helpers, assets, and probably also specs) into your own application.
From that moment you have total control of everything and need no override to add your customization.
This will provide much more flexibility but it will be hard to get the last changes released in future versions (unless you implement them in your store on your own). On the other hand, we are not upgrading
solidus_frontend
anymore to avoid breaking existing applications, so there are generally not a lot of changes to pick in your application when you upgrade with it as a gem.If you have to start a new store with Solidus tomorrow, what option would you choose and why?
Beta Was this translation helpful? Give feedback.
All reactions