docs icon indicating copy to clipboard operation
docs copied to clipboard

Extenders are not using the same wording

Open luceos opened this issue 6 years ago • 6 comments

When I look at the Routes extender the construct uses the variable $appName, the Frontend uses $frontend. I'm confused about the difference in naming. I know about Site vs App, but is this what was actually meant by them?

luceos avatar Nov 12 '18 13:11 luceos

They are similar but subtly different.

An installed Flarum App has three "apps": forum, admin, and API. These each have their own set of routes which you can add to.

Most of the forum and admin routes serve up a "frontend" which can be extended using the Frontend extender.

tobyzerner avatar Nov 12 '18 20:11 tobyzerner

Indeed. I am open for better wording here, but these are definitely very distinct concepts:

  • an "app" is a set of HTTP request handlers, with middleware and routes
  • a "frontend" is a HTML document / single-page app

franzliedke avatar Nov 12 '18 22:11 franzliedke

I was already afraid they might be different, knowing Site vs App. However for a new extension developer this might be terminology which is hard to grasp, hence the question; can we improve this or has this been sufficiently documented?

@flarum/docs

luceos avatar Nov 12 '18 22:11 luceos

I'm not sure how we could improve the wording. In one case, app clearly refers to the whole app and frontend just to the frontend. Maybe making frontend be view or render, something similar to that? If not that, how does Laravel do it? Are we doing it like them or is their wording a bit clearer (ignoring all those Facades, Service Containers, etc... :P)

dsevillamartin avatar Nov 12 '18 22:11 dsevillamartin

I think the words are fine, we just need to make it clear in the documentation (and docblocks).

tobyzerner avatar Nov 12 '18 23:11 tobyzerner

@datitisev It's not really a concept from Laravel. They have no abstraction for what we call "frontend", and "apps" are somewhat similar to Laravel's route groups, though not a perfect match.

We have to explain the concepts well, no way around that. :wink:

franzliedke avatar Nov 13 '18 08:11 franzliedke