Skip to content

Adding server.inspect to list decorated framework interfaces#3409

Merged
hueniverse merged 3 commits intohapijs:masterfrom
gordysc:master
May 30, 2017
Merged

Adding server.inspect to list decorated framework interfaces#3409
hueniverse merged 3 commits intohapijs:masterfrom
gordysc:master

Conversation

@gordysc
Copy link
Copy Markdown
Contributor

@gordysc gordysc commented Dec 17, 2016

Addresses enhancement request: #3408

@hueniverse
Copy link
Copy Markdown
Contributor

I prefer this was much simpler. server.decorations as a property. Since you cannot un-decorate, keeping such a public property up to date should be trivial.

@gordysc
Copy link
Copy Markdown
Contributor Author

gordysc commented Dec 17, 2016

Agreed, will revisit this approach.

@gordysc
Copy link
Copy Markdown
Contributor Author

gordysc commented Dec 17, 2016

@hueniverse just for clarification, are you suggesting:

server.decorations
request.decorations
reply.decorations

Or

server.decorations = {
  server: <decorations>,
  request: <decorations>,
  reply: <decorations>
}

@devinivy
Copy link
Copy Markdown
Member

The latter makes more sense to me.

@AdriVanHoudt
Copy link
Copy Markdown
Contributor

@devinivy any particular reason why?

@devinivy
Copy link
Copy Markdown
Member

devinivy commented Dec 17, 2016

Yes– it's hard to get a hold of a request object or reply interface simply to check if they're decorated with a specific method. Decorations are (probably!) added at plugin registration time, so I think they should be able to be introspected at plugin registration time as well.

@AdriVanHoudt
Copy link
Copy Markdown
Contributor

Ok I agree. Why not both? if you want to check on request you'd have to go request.server.decorations.request[] :P

@hueniverse
Copy link
Copy Markdown
Contributor

Just server.decorations.

@devinivy
Copy link
Copy Markdown
Member

@AdriVanHoudt I would omit that for the express purpose of keeping the features of the API independent of each other. Plus, if you already have a request object you can just check for the decorated method directly on it!

@gordysc
Copy link
Copy Markdown
Contributor Author

gordysc commented Dec 19, 2016

@hueniverse is this approach more inline?

@hueniverse
Copy link
Copy Markdown
Contributor

I'll review it in a week or two.

@hueniverse hueniverse self-assigned this May 30, 2017
@hueniverse hueniverse added the feature New functionality or improvement label May 30, 2017
@hueniverse hueniverse added this to the 16.2.1 milestone May 30, 2017
@hueniverse hueniverse merged commit 241d7b0 into hapijs:master May 30, 2017
hueniverse added a commit that referenced this pull request May 30, 2017
@lock
Copy link
Copy Markdown

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants