RFC: Should the new extensions template create a Rails Engine? #4551
Replies: 20 comments
-
Please expand on the pattern you are referring to (it sounds like you are suggesting to use something other than |
Beta Was this translation helpful? Give feedback.
-
I'm talking about how we distribute extensions through How this would ultimately work... Unclear, but I've been looking at:
|
Beta Was this translation helpful? Give feedback.
-
This doesn't help much and doesn't really make your case about extensions being "an idea whose time has past" or how it would help with maintainability. Extensions are distributed as gems which bundler pulls from whatever location you specify (local path, github, rubygems, etc.). So, if you don't go through I'm pretty sure you're mixing up some concepts here. There is nothing preventing you to not use All in all, this doesn't make a lot of sense. Is pulling some extensions into the main project (like Rails did with ActiveStorage for example) would be something that fits with what you're trying to say/expose? If not, then please give some details about the problem(s) you're trying to solve, because you're proposing a change with an unknown solution to an unknown/non-existant problem otherwise. |
Beta Was this translation helpful? Give feedback.
-
All true, but the tool for generating new extensions makes them engines by default, and I agree with @dustineichler that this is not a good pattern to encourage. I've tried to follow what I think are a better set of practices for building extensions on recent stuff: normal gems (not engines), no I personally think encouraging building them like that, and potentially moving some extensions over to something more like that would be great. |
Beta Was this translation helpful? Give feedback.
-
@jarednorman, thanks for your input and clarifying what was the intention of the issue (if this is really what it was about), because I thought it was way more intrusive/impactful than that. I can live with a different generator for extensions which isn't integrated with Rails and ignore all the conventions, I use a different one anyway. Right now, the only thing I think is wrong (not ideal) with the extensions is the pattern already discussed here. Otherwise, I don't see how |
Beta Was this translation helpful? Give feedback.
-
I'm very surprised that you don't see an issue with It essentially locks even private class APIs in place because extensions may be relying on them. In talking with our previous full time maintainer, he considered it one of the more painful pieces of maintaining the project, because every store has either I see our adoption of |
Beta Was this translation helpful? Give feedback.
-
I see your point. Although, the problems you brought up aren't specific to So, for this instance, this means that you should use Basically, I don't see an issue with this because the cause of headache isn't Regardless of all I've just said, if you really want to make your extension maintenance bulletproof and independant of how extensions are implemented by others, not not using |
Beta Was this translation helpful? Give feedback.
-
@patleb We should take a step back a here, as we've gone way off into the weeds. There's a huge disconnect happening between us in this conversation: @dustineichler was trying to continue a specific discussion from Southeast Solidus, but unfortunately didn't provide any real context for those who missed out on that conversation. I totally appreciate that you're largely happy with how the extensions currently work and as such might be worried about unnecessary changes. Let's try to keep the discussion constructive and focus on ideas that have been explicitly suggested and avoid speculating too much. No one is suggesting replacing bundler, or banning the use of For a little more context: at the conference there was a discussion where some people expressed pain with how we currently handle extensions, and we discussed where we thought the trouble was coming from, and how we might alleviate it. I think the goal here should be to continue the extension conversation from Southeast Solidus and hear from more people on where they are having issues and brainstorm on how we can address those issues. |
Beta Was this translation helpful? Give feedback.
-
@jarednorman, you said that you were surprised that I don't see an issue with You have to understand that I have an obligation (which means I would rather not) to check from time to time for issues that would impact our clients in the long run. So, if there is an issue with the title "RFC: Replace Solidus Extensions with new library package and distribution pattern", I will most certainly associate risk and money to this kind of change and I have to inform myself about what the issue actually is. So, it's a little unfortunate that issues are now used as a forum. Also, please, if the discussion is about how extensions are architectured/configured, then use these terms in the description of the issue instead of "library package" which would mean "gems" and "distribution pattern" which would mean "bundler".
Could you please expand on the non-constructive part(s) of what I wrote? I don't get it.
Sorry, but there was nothing explicit about what was written in this issue, that's why I jumped in.
My questions weren't answered about the distribution part... so, I guess you're answering my question about bundler with this.
You specifically said "I see our adoption of Alright, I'm out. Have a good one! |
Beta Was this translation helpful? Give feedback.
-
Yep, all totally understandable, and I didn't mean to imply any bad faith when I suggested we keep it constructive, only that we'd got way off track from the original/intended discussion (which is fair due to the lack of explanation/context.) Have a good rest of your weekend! 😄 |
Beta Was this translation helpful? Give feedback.
-
What does a solidus extension built with |
Beta Was this translation helpful? Give feedback.
-
I agree we should change the title of this issue and add some more context to its description. I wasn't at the conference as well and it was quite hard to understand what we were talking about, and I still have some doubts, so I'm sorry if I'm not getting it yet. What I'd like to point out is that the current pattern used for extensions is good if we need to inject routes or other Rails layers resources (models, views, controllers, migrations, assets) into our stores. The extension @jarednorman built is a great example of adding some business logic to a store and it is made possible because of the presence of an extension point for that particular feature into core and because the extension does not need any assets, routes, controllers or migrations to be used. The point, I think, is not to find an alternative when we need those things into an extension, because using what Rails gives us and maintains for us is the best and more responsible way of solving that problem (or I can't see any valid alternative yet). The point is trying to only build extensions that provide only business logic, leaving to each developer the possibility/responsibility of building the rest of the things into their store on their own. For me, this opens some questions:
|
Beta Was this translation helpful? Give feedback.
-
@kennyadsl good points. should update. suggestion on title change? might be worth closing and moving to |
Beta Was this translation helpful? Give feedback.
-
Integrating my extension involved adding some views/routes/controllers/models for one of the stores that I integrated it with. I very intentionally didn't provide certain things out of the box: for example, I didn't include the state machine transitions and jobs to do transaction reporting because not all the stores I'm using it with need that functionality, and doing it properly would require assuming the use of Instead I've provided the API required to do the reporting, and am going to document how to integrate that with your store, including making clear some of the things that may be different from store to store. On top of this, I'm considering providing the extra admin functionality as its own extension, as well as This is all to say that the core functionality for some extensions might belong in its own package, and the state machine transitions, routes, controllers, views, models, etc. might belong in another package for those stores that don't need anything too custom and want a "works out of the box" experience can have that as well. Using this approach doesn't change how anything works for those currently using existing extensions, but might provide some extra flexibility for the stores that want it. |
Beta Was this translation helpful? Give feedback.
-
[RFC] Should the new extensions template create a Rails Engine? What about something like this?
I think we can discuss here since it has more visibility and then eventually create PRs on the Sure, I was not criticizing this approach, and it's clear to me that this was intentional. I was thinking that it could be a good idea to provide 2 commands (or an option) to create a new extension with |
Beta Was this translation helpful? Give feedback.
-
@kennyadsl i like it. building up solidus cli has many benefits. not just here imo. i also think it's a good idea to expand-provide employable patterns beyond what's initially generated. lastly, providing a boiler plate is a good idea. 1. helps set extension expectation 2. ensure minimum quality. 3. reduce setup time. |
Beta Was this translation helpful? Give feedback.
-
One idea that I presented at the conference was remembering the idea of
Apple migrating from MacOS to OsX.
They had the concept of Yellow Box which was the new OSX interface and
BlueBox the old interface.
I spoke about this in Memphis, and how we could use this paradigm for a
migration in model.
We could have the current extensions and label them "Blue" and the new
model based on a
much smarter plugin model and then give extension authors 12-18 months to
come into compliance
with the new extension model.
A few challenges:
1.) Designing or adapting a good plugin model
2.) Evangelizing to the community this is a good idea
3.) Providing support,documentation to plugin authors
But I think its worth it! And I think we can serve the community better by
making the plugin migration a curated experience vs
a bit of a guessing game. Naming our intentions and providing clear
guidelines will go along way!
…-dh
On Fri, Mar 1, 2019 at 4:14 AM Alberto Vena ***@***.***> wrote:
@dustineichler <https://github.com/dustineichler>
suggestion on title change?
*[RFC] Should the new extensions template create a Rails Engine?*
What about something like this?
might be worth closing and moving to solidus_cmd too.
I think we can discuss here since it has more visibility and then
eventually create PRs on the solidus_cmd repository referring to this PR.
@jarednorman <https://github.com/jarednorman>
Sure, I was not criticizing this approach, and it's clear to me that this
was intentional.
Providing good documentation is a great way to delegate to each store for
the rest of the implementation.
------------------------------
I was thinking that it could be a good idea to provide 2 commands (or an
option) to create a new extension with solidus_cmd but maybe it's not
worth it since the extension without the Rails Engine skeleton would be
very similar to a new gem created with Bundler with bundle gem new_gem,
WDYT?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3120 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOZrxmK6IkXygyxIM-q8y2nvHgRh5Otks5vSO-DgaJpZM4bJ5-j>
.
|
Beta Was this translation helpful? Give feedback.
-
About building extensions that provide only business logic, not sure how to avoid monkey patching without a configurable class or preference. Maybe we can start evangelizing the community about avoid Aside, not sure that we need |
Beta Was this translation helpful? Give feedback.
-
Alternatively, it's not unreasonable to have Just a thought. |
Beta Was this translation helpful? Give feedback.
-
Sure, any improvement is welcome. As far as I can see right now:
If there are other concerns or missing things, let's discuss and fix them! |
Beta Was this translation helpful? Give feedback.
-
Solidus extensions is an idea whose time has past. Replacing extensions with a new pattern was discussed at length during south east solidus this year. I'd like to explore packaging and distribution without
Rails::Engine
as a requirement. In terms of maintainability, I believe this would simplify things immensely.Questions, comments and concerns below.
Beta Was this translation helpful? Give feedback.
All reactions