Closed (fixed)
Project:
Drupal core ideas
Component:
Proposed Plan
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
28 Apr 2017 at 15:59 UTC
Updated:
16 May 2018 at 15:19 UTC
Jump to comment: Most recent
Ease the overhead of getting into decoupled Drupal.
Simply: Provide a distribution. The distribution would use jsonapi and admin configuration. The desire here is to have something similar to the magazine distribution where a user can spin up the api_starter and would have a working headless install with little to no config, just content entry (if that)
- Create working profile: https://github.com/timodwhit/api_starter
- Create distribution for d.o
- Consensus on needed modules/ideal modules
- Create content types
- Migrate content into content types (ideally optional)
- rejoice
- (tangent) Create a resources/info site for decoupled Drupal?
N/A
N/A
N/A
Comments
Comment #2
timodwhit commentedComment #3
timodwhit commentedComment #4
dawehnerNote: I've beeing also working on one: https://github.com/dawehner/api_first
We should totally colaborate
Comment #5
e0ipsoThanks for taking the time to create this issue!
Things we need to agree on
1. Use default content or not?
If we add default content we can get front-end devs started in "one click" with quality content and a beautiful design. They can start writing React, Angular, Ember client examples right away. This way we can provide best practises in each of the consumer side examples. Additionally, someone can spin up the distro with content and show a CTO: Look! This is Drupal out of the box. and show an iPad app, Android, React, …
However people that want this for their project need to remove all the default content stuff. We should be able to revert to a clean slate with a single click (restore to factory default settings).
2. What modules are we going to use?
I believe that we should follow an opinionated setup. Promoting the use of REST, JSON API and GraphQL will make maintainability harder. Then we'll end up with people saying: Oh! Too bad! I want to use JSON API and Angular, but I can only see React examples for the JSON API setup.
The only Angular example for this distro is for GraphQL….
Obviously this leads this distro to be a JSON API distro, or a GraphQL distro, etc.
I believe that the best goal that we'll achieve is that we show people: Hey! This works, it's doable. Decouples sites with Drupal are easy!.
I'm a big advocate on being opinionated on this. I vote for JSON API, because it's the only think that I can really help with.
3. What default configuration will we provide?
Not sure if I can think of anything at this moment beyond: enable modules, provide the config for the (hypothetical) default content, and JSON API overwrites.
4. Create a read-only public API server
We host an instance of this distribution somewhere public so client side developers can develop against it, without even knowing Drupal!
We need some hosting company's free/FOSS tier to be offered. Wink, wink.
Thoughts?
Comment #6
e0ipsoWe have still not decided that this will be JSON API specific.
Comment #7
e0ipsoAlso, I vote that we call this distribution "Contenta!", because it's all about content distribution.
https://translate.google.com/?hl=en&um=1&ie=UTF-8&hl=en&client=tw-ob#ca/...
Comment #8
hampercm commentedI can seen an advantage to enabling REST and GraphQL, in addition to JSON API, so that others can write clients that utilize the same install. At the very least, I think the distro should provide these modules in a disabled state so that they can be easily used, if desired, instead of JSON API. This also makes it a little bit more obvious to people new to Headless Drupal what solid Contrib options are available.
Comment #9
hampercm commentedComment #10
dawehnerI think the idea of @hampercm is totally nice, as long we document why we use one particular subset. Using this distribution as a tool for documentation purposes is IMHO a good idea in general.
Comment #11
e0ipso@hampercm, @dawehner what would be a reasonable list of modules to ship with the distro? These are some of the contenders:
My take is that for us to include these in the distro, it would be ideal to have involvement from the maintainers of those modules in this project.
Comment #12
e0ipsoMore clarification after talking to Chris @ DrupalCon.
I feel that all the API solutions we include should meet the requirements:
If the requirements are not met, we can include them anyways and work with me maintainers to achieve feature parity.
Comment #13
timodwhit commented@dawehner Let's collaborate for sure. The one mentioned in the issue isn't as robust as yours, can we adapt that for this, or would you like to keep two separate distros?
@e0ipso: I dig the name "Contenta".
#1 Agree that we should provide a mechanism for reverting/cleaning out generated content. If we use the migrate API, we can bring in the content and revert the migration with a fairly low amount of work on our end. We should provide an option when installing the profile to disable the install of content, so that people who work with this distro a lot don't have to have the second step of reverting content.
#2) I agree with being opinionated on out approach here, but I agree with @hampercm that we should provide an easy mechanism to enable/disable the modules we pick. I think providing disabled modules and potentially providing the documentation to switch providers we could have success. However, there could be an argument to provide a parent/sub profile relationship similar to lightning it would be multiple inheritance. This would allow us to have: contenta_jsonapi, contena_graphql, all extending the parent_contenta. Granted this would require the core patch for such inheritance.
#3) We should move default config outside of theme blocks and default theme into a sub module of the profile so the modules can be enabled/disabled and not be required in any sense for people. I could see a contenta_demo module being very helpful.
#4) Agreed.
Comment #14
e0ipsoComment #15
andypost1 default content - distribution will require few users to setup, guess could be done in install hook
2 modules - probably you will need https://www.drupal.org/project/better_normalizers
Comment #16
dawehnerI think I agree with @andypost of using
default_contentas mechanism to ship with default content. It seems to become the de facto standard for these kind of things, and unlike migrate, you really just need to ship with the exported JSON files.That sounds like a really nice goal! Let's ensure to always do small steps while not loosing focus.
Let's ensure to not try to do too many things at the same time :)
Yeah more modules instead of complex installation profiles! I really like this idea.
Comment #17
yoroy commentedHow is this an idea for core if the objective is to build a distribution? That's essentially contrib, no?
Comment #18
hampercm commented+1 to all of @e0ipso's comments in #16!
I definitely thing RelaxedWS would be a solid fit for this distro. "Services" seems a bit less of a fit, since it is more about developers writing custom code to create a custom API, rather than delivering content from the Drupal entity system using a "canonical" API, which is what I had been envisioning as the purpose of this distro. That being said, I do still see possibilities where that would be useful to have in addition to a "canonical" API.
I also think that addressing the Information Architecture and Content Administration experience is important, since that would be a big factor for people choosing to use this Drupal distro over a proprietary or custom solution. It would be an opportunity to drive adoption of Drupal among people who haven't used it before. I know that @Wim Leers has explored some possibilities in this area. These types of improvements could be taken on after an MVP release.
Comment #19
e0ipsoI think that @timodwhit used the "Add child issue link" from #2757967: API-first initiative and that created the issue here. How / where should we move it @yoroy?
Comment #20
timodwhit commentedThat is is correct @e0ipso, happy to move it though.
Practical next steps:
@dawehener, what is the best way to merge our efforts for the install profile? It looks like your profile is a clone of Thunder which comes with testing but potentially more config than we desire. Mine is based off of standard and still potentially more config than we desire. I have a small working contenta profile locally but definitely needs some eyes.
For content types: Article and Page? Two vocabularies: tags and article type?
How realistic do we want the content to be?
Also, while building out this initially and thinking from a first timers perspective (I know this is baby steps) but there are things in drupal that are needed from the perspective of displaying a backend CMS (block layout, display modes), but might never be adjusted in an API-first model, would a lightweight admin theme be a good place for these changes? You can always roll back to seven or your favorite flavor but maybe we expose a limited feature set for those just getting started?
Comment #21
timodwhit commented@hampercm
I think I mentioned this above, I agree that it isn't MVP but it might be quickly apparent that the Swiss Army knife of drupal needs some paring down.
Comment #22
e0ipsoI feel strongly towards coordinating efforts with #79582: Add example content to the experimental out-of-the-box demo install profile. They have the content model defined there already. Current status (at the time of writing) is that we're waiting on gathering content that is license compatible. See https://docs.google.com/document/d/1WdVkScJGs-wHKujvNvwKba_sSuHiHmL69EOa....
Comment #23
yoroy commentedDiscussed with @e0ipso in IRC, it makes sense to have this plan stay in the ideas queue here.
Looks like this is beyond the idea phase and more about planning things. Carry on :-)
Comment #24
e0ipsoThe Out of the Box Experience team has defined the following user stories: https://docs.google.com/spreadsheets/d/1gtiQOm6D3r9w23kYzEcoLP9FloTLU9TA...
Maybe we can collaborate there since we're moving towards a common goal: have a rich content model populated with high quality content.
Comment #25
e0ipsoComment #26
e0ipsoIt is very difficult to coordinate efforts across many different projects. For that reason, and for technical simplicity, I'd like to propose something.
We could build different distributions, no inheritance (that is very painful), but they all build the same thing:
That way we can start with
contenta_jsonapiand figure much of this stuff, so when thecontenta_restteam rallies around of this distro they don't have to go through all the same pains when building this with REST core. What other distros will gain is that by copying the Contenta way of doing things they don't have to figure out what to build, but focus on the how to build it. A huge benefit of that would be that it would help to compare the different approaches: REST, JSON API, GraphQL, …Votes? Amends? Thoughts?
Comment #27
dawehnerI like the idea to not overabstract with introducing the concept of install profile inheritance. This idea is partially about exploration, so some weird strictness caused by inheritance just causes headaches.
I agree that they should be similar to be able to compare the approaches.
Well yeah I started from thunder in order to have some of the goodness they provide, but honestly I don't care about those :)
On the longrun I would like us to use the magazine idea as proposed on #2759849: Create a new user-facing core theme as part of a Drupal demo. This not only let's us stop bikeshedding about what the data model should look like, but it also helps people to compare different approaches to build sites (Decoupled vs. build in Drupal).
Comment #28
yoroy commentedOoh, reusing the default content model would be super nice indeed. I would not have guessed that Out of the Box and API-first initiatives would have such interesting overlapping needs :-)
Comment #29
e0ipso@yoroy yeah. Hopefully devs using React, Angular, … will also build the decoupled front-end inspired by the designs in the Out of the Box Experience. IMO that would be very helpful for everyone.
Comment #30
rodrigoaguileraWe developed a similar module to default_content but leveraging the migrate API
https://www.drupal.org/project/migrate_default_content
It leverages the same concept of just dropping some YAML files but it doesn't support exporting existing content yet.
Since is based on migrate API it fully supports reverting the content.
Comment #31
timodwhit commented@e0ipso, I think that makes good sense in some respects.... I would propose a similar approach to experimental modules where we have base contenta and then inside that experimental modules to install different variations of it. Those would be experimental until maintainers of those projects bring in their desired changes etc. Contenta_jsonapi would be a module inside contenta that configures the jsonapi according to specs and those defined by jsonapi maintainers, etc for best out of the box experience.
This could reduce the overhead of maintenance across 1-5 distros. It would also potentially limit the confusion of "If I go contenta_jsonapi, am i limited to jsonapi". Those entrenched in drupal know it isn't the case, but others might not.
WRT: Out of the Box issue, this isn't necessarily a topic for here, but a base set of contrib modules that different distros can bring in and extend for different use cases seems better than us bike shedding here, as @dwahener mentioned.
Comment #32
e0ipso@timodwhit I feel that you didn't touch on my biggest point:
I won't be able to maintain the
contenta_servicesflavor, I wouldn't know how. Should we have many maintainers for a single project? It feels like too many fingers in a pie. In addition to that is the fact that there is no shared code to maintain, so I don't really see your This could reduce the overhead of maintenance across 1-5 distros. The only tie would be that we build the same product in different techs, each project a single (or a couple) of maintainers.On a separate note, I'd say that all the flavors would share the common goal of: giving an easy way to demo decoupled Drupal. We could go even further by: trying to give an easy way for front-end devs to choose a particular back-end decoupled flavor.
Comment #33
dawehnerSome module to share the configuration indeed works as well.
I started using the document on https://docs.google.com/document/d/1WdVkScJGs-wHKujvNvwKba_sSuHiHmL69EOa...
to build such a module: https://github.com/dawehner/recipes_magazin
Comment #34
mrjmd commented+1 to this idea.
I am currently working on a proof of concept for best practices decoupling Drupal & Angular with JSON API. I would love to support this distro by building on top of it and helping test / relay back gaps etc.
Currently I am building this POC using a simple custom D8 site, but I could quickly switch over to using this distro once there is a set repo where its development is taking place (it seems like timodwhit and dawehner's repos still need to be consolidated at this point).
Comment #35
timodwhit commented@e0ipso, I was thinking the shared code would be like @dawehner was mentioning, the node/taxonomy/use config and setup, as well as default content. This could all be encapsulated in the contenta_demo module where the content is set up and built, as well as any admin improvements that we could make for a lower barrier to entry.If that work would be duplicated across projects and potentially fragment and lead to different end user interpretations of the contenta profile, that would lead to concern/fragmentation. As @dawehner mentioned a module would work for this, should we make this a contrib module and dependency of contenta?
General question: Would it be bad form to have a module that alters the install form for the profile to make the default content optional? If we agree on breaking out that config separate from the jsonapi config, should we create a second issue/sandbox module for that?
Comment #36
e0ipsoI think we are on the same page with regards to sharing code via a custom module, rather than inheritance of profiles. :+1:
I'm not sure I follow the general question. Can you elaborate a little bit further?
Comment #37
hampercm commentedPrecisely!
+1 to that.
That would be ideal in my opinion, but I can see this as a significant development effort. Also, there would be a sense of duplication of effort with the other initiatives, but that may simply be unavoidable. I can see this being a big plus for Drupal in the long run.
Also a +1 for the single-distro approach. It seems like multiple distros would result in fragmentation and duplication of effort.
Other thoughts:
Related to the distro name "Contenta" I've noticed via a quick Google search that several companies use that as their name, or a part of it. Is that a point of concern?
Comment #38
yoroy commentedOut of the Box team would like to finalize the content model (content types + vocabularies) for the sample content. Have look if you want: #2818741: Content model for sample content in Out of the Box Initiative
Comment #39
e0ipsoEven though there was no movement in this issue many things have been happening:
All these discussions have been happening ad-hoc between the active contributors in this front:
If you want to be pinged in #drupal-contribute (IRC) please express that intention here. We'll be giving weekly updates about the distro on the API-First meetings that happen on Monday.
In the mean time there are some interesting resources:
Comment #40
e0ipsoPlease join the discussion at https://drupal.slack.com/messages/C5A70F7D1!
Comment #41
justafishComment #42
cosmicdreams commentedI would love to learn how to use this to demonstrate how to make a api-only site that is consumed by web components.
Comment #43
dawehner@cosmicdreams
Do you want to join the slack channel and propose some ideas how this could look like?
Comment #44
fubhy commentedQuick heads-up: I have been working on a basic demo app for Drupal + GraphQL + React here: https://github.com/fubhy/drupal-decoupled-app
In case anyone wants to work on a React + GraphQL demo within the Contenta space I'd be happy to give a hand.
Comment #45
miro_dietikerWith Paragraphs becoming a more and more popular module, caring about Content, i would like to know if Contenta is open to add Paragraphs to its reference case?
Comment #46
e0ipso@miro_dietiker would the use case for paragraphs be to construct layouts, or just as revisionable entity references? Bear in mind that 2 different consumers will use the same API, but will have different layouts.
Also, Contenta is a Drupal distribution that helps you get started with decoupled Drupal. However it's still Drupal, and you can install any module you need.
Comment #47
miro_dietikerIt seems to me that if such a project doesn't pick up a case like Paragraphs and provide explicit answers, people that build on top of paragraphs, seeking for answers how to deal with it, will be lost.
Sure, using ERR as a plain example and demonstrating how to output child components is a valuable first step.
Some of the more advanced use cases would be to use nested paragraphs to establish content layout. It would be very interesting to see that case covered by example.
Comment #48
sylus commentedWhen it comes to layout and layout related functionality I'd love if contenta tried to focus on the core layout system + Panels / Panelizer and provide a workflow against that. One thing that greatly interested me was: https://www.drupal.org/project/panels_rest_expose providing ability to expose complete layout control with all components.
Comment #49
dawehner@miro_dietiker
There is an interesting discussion going on regarding a content model for something like a text of the recipe, see https://github.com/contentacms/contenta_jsonapi/issues/66
Comment #50
dawehner#2849726: Add an API-First installation profile to core is a similiar discussion going on.
Comment #51
ckrina👋
Comment #52
justafishI think we're well into the rejoice step now!
Comment #53
justafish