[API hook] loadSettings#903
Conversation
There was a problem hiding this comment.
I wouldn't use Object.freeze(Object.create(settings));. It makes debugging unnecessarily hard since console.log(context.settings) will always print out {} plus it does not protect the settings from being changed (since settings.__proto__ is still mutable)
There was a problem hiding this comment.
Oh, I didn't know about __proto__.
What would you do? Make a for loop copying all properties (recursively), or should we just pass the original settings object?
There was a problem hiding this comment.
I would just pass the original settings object.
|
OK, this should do. Now, a question: Is there a way to obtain the settings on the client-side, yet? (This could be useful for things like #893. Maybe we can add a client-side loadSettings hook -- but obviously we don't want to send the whole settings object to the client as it contains delicate information.) |
Implement a
loadSettingshook.Fixes #856