Skip to content

Commit

Permalink
perf: bundle with vite
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Oct 1, 2024
1 parent e3464ae commit c55089b
Show file tree
Hide file tree
Showing 35 changed files with 5,557 additions and 2,801 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tests/clover*.xml
node_modules/

/js
/css

# packaged app
build/artifacts
Expand Down
8 changes: 8 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

const babelConfig = require('@nextcloud/babel-config')

module.exports = babelConfig
19 changes: 0 additions & 19 deletions babel.config.js

This file was deleted.

4 changes: 3 additions & 1 deletion jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ module.exports = {
require.resolve('jest-transform-stub'),
'^.+\\.jsx?$': require.resolve('babel-jest'),
},
// support the same @ -> src alias mapping in source code
moduleNameMapper: {
// support the same @ -> src alias mapping in source code
'^@/(.*)$': '<rootDir>/src/$1',
// trim "?raw" suffixes from svg imports
'(.*\\.svg)\\?raw$': '$1',
},
// serializer for snapshots
snapshotSerializers: [
Expand Down
2 changes: 1 addition & 1 deletion krankerl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[package]
before_cmds = [
"composer install --no-dev -o",
"npm install --deps",
"npm install",
"npm run build",
"composer openapi"
]
4 changes: 2 additions & 2 deletions lib/Controller/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ public function getHtmlBody(int $id, bool $plain = false): Response {
$html,
$this->nonceManager->getNonce(),
$this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkTo('mail', 'js/htmlresponse.js')
)
$this->urlGenerator->linkTo('mail', 'js/mail-htmlresponse.mjs')
),
);

// Harden the default security policy
Expand Down
2 changes: 1 addition & 1 deletion lib/Http/HtmlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ public function render(): string {
return $this->content;
}

return '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script nonce="' . $this->nonce . '" src="' . $this->scriptUrl . '"></script></head><body>' . $this->content . '<div data-iframe-height></div></body></html>';
return '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script nonce="' . $this->nonce . '" src="' . $this->scriptUrl . '" type="module"></script></head><body>' . $this->content . '<div data-iframe-height></div></body></html>';
}
}
Loading

0 comments on commit c55089b

Please sign in to comment.