-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Enable HMR depending on debug mode #43601
Conversation
Signed-off-by: Jonas Heinrich <[email protected]>
@@ -74,6 +74,17 @@ public function afterController($controller, $methodName, Response $response): R | |||
$defaultPolicy->useJsNonce($this->csrfTokenManager->getToken()->getEncryptedValue()); | |||
} | |||
|
|||
// Loosen security presets in debug mode to enable development | |||
// tools functionality | |||
$debugging = \OC::$server->getConfig()->getSystemValue('debug', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use dependency injection in the construct :)
\OC::$server->getConfig()
is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am strongly against this. Most developers have their dev setups in debug mode and never test without. So we'll likely run into features breaking in production because nobody notices CSP errors locally.
would it be possible to introduce an extra system setting variable like "enable_hmr" which can be only enabled if debug mode is also enabled? |
HMR requires connection to only one server on a specific host. A proper solution would be to fix only required restrictions for a specific dev server and not to disable CSP completely. |
I'd personally prefer to have a solution in a separated app, not in the server. |
Summary
Currently Nextlouc needs to get patched to use Vue Devtools due to "hot module reloading" is restricted, see
This PR loosens security on debug mode and makes Vue Devtools usable
Checklist