Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra info to home-page json response #20

Merged

Conversation

pine3ree
Copy link
Contributor

@pine3ree pine3ree commented Apr 21, 2020

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA no

Description

Just add container and router info to home-page-example json response for renderer/template-less installs, to partially match the info provided by the html-response.

ref: #3 (added test case as suggested by ocramius)

Specifically the json-response payload is changed from:

[
    'welcome' => 'Congratulations! You have installed the mezzio skeleton application.',
    'docsUrl' => 'https://docs.mezzio.dev/mezzio/',
 ]

to the following more complete version:

[
    'welcome' => 'Congratulations! You have installed the mezzio skeleton application.',
    'docsUrl' => 'https://docs.mezzio.dev/mezzio/',
    'containerName' => 'The installed container name', // e.g. 'Laminas Servicemanager'
    'containerDocs' => 'The installed container documentation url/', // e.g. 'https://docs.laminas.dev/laminas-servicemanager/'
    'routerName' => 'The installed router name', // e.g. 'Laminas Route'
    'routerDocs' => 'The installed router documentation url', // e.g. https://docs.laminas.dev/laminas-router/'
 ]

@pine3ree
Copy link
Contributor Author

pine3ree commented Apr 21, 2020

Hello @michalbundyra ,

In the new test case I had to skip the auryn test. I believe I found a bug in the psr auryn wrapper for zend configurations, but I haven't still looked deeply into it.

https://github.com/northwoods/container/blob/master/src/Zend/Config.php#L73

$delegate = $this->makeLazyInvokable($invokable, $invokable); which in turn will call
$this->makeInvokable($invokable, $invokable) is expecting $invokable (2nd argument) to be an invokable factory (i thought of the class InvokableFactory), while it is usually aFQCN ctor-less class. So, for instance, it fails creating a service for:

    'invokables' => [
        AuraRouter::class => AuraRouter::class,
    ],

kind regards,
maks

@michalbundyra michalbundyra changed the base branch from master to develop April 22, 2020 05:41
@michalbundyra michalbundyra added the Enhancement New feature or request label Apr 22, 2020
@michalbundyra michalbundyra added this to the 3.4.0 milestone Apr 22, 2020
@michalbundyra michalbundyra linked an issue Apr 22, 2020 that may be closed by this pull request
@samsonasik
Copy link
Member

@pine3ree it needs rebase against latest develop.

Signed-off-by: pine3ree <pine3ree@gmail.com>
Signed-off-by: pine3ree <pine3ree@gmail.com>
Signed-off-by: pine3ree <pine3ree@gmail.com>
Signed-off-by: pine3ree <pine3ree@gmail.com>
Signed-off-by: pine3ree <pine3ree@gmail.com>
@pine3ree pine3ree force-pushed the add-extra-info-to-hp-json-response branch from e08155c to 176e9db Compare April 22, 2020 15:57
@pine3ree
Copy link
Contributor Author

@samsonasik , right! thanks!

private $expectedRouterAttributes = [
AuraRouter::class => [
'routerName' => 'Aura.Router',
'routerDocs' => 'http://auraphp.com/packages/2.x/Router.html',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @samsonasik, I have to wait for HomePageHandler-updating PRs to be pulled-in (for aura-di v4 as well), otherwise the response-inspecting tests would fail.
Pinging @michalbundyra as well: maybe in a future version we could add a support class (or a HomePageHandler public constant) defining name and docs based on the container/router/renderer FQCN, so that we have one "place" to make those changed. This would simplify updating the test cases a lot. kind regards.

@weierophinney
Copy link
Contributor

@pine3ree Could you please update the PR description to detail what the returned payload looks like (so people coming to the issue from the changelog can see at a glance what was changed, without having to look through the patches)? Thanks!

@pine3ree
Copy link
Contributor Author

@weierophinney done! kind regards.

weierophinney added a commit that referenced this pull request May 27, 2020
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney weierophinney merged commit bfa257c into mezzio:develop May 27, 2020
@pine3ree pine3ree deleted the add-extra-info-to-hp-json-response branch May 27, 2020 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add extra HP info for renderer-less installs
4 participants