-
Notifications
You must be signed in to change notification settings - Fork 155
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
[full-ci] Vite #7952
[full-ci] Vite #7952
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
b42df9f
to
fbffd7a
Compare
6079d5c
to
5530b9b
Compare
Just read it on my cell… ❤️ it… I give it a try tomorrow! Thank you 😘 |
4f94082
to
f0f7130
Compare
d212e7d
to
3163034
Compare
Allows better error reporting and prepares us for using importmaps later.
In a few places we rely on whitespaces for styling 👀 (e.g., AppTopBar buttons and in the account menu) ... in order to not break those occasions, we set this setting for now.
config/vite_ocis/config.json
Outdated
"search", | ||
"external", | ||
"user-management", | ||
"preview" |
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 mount preview
as external app, same as in config.json.sample-ocis
. The thumbnailer in ocis supports more mimetypes than the preview-app defaults.
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.
sorry... not in the file I mentioned. Anyway, please add the preview as follows to the external apps and remove it from the apps array:
{
"id": "preview",
"path": "web-app-preview",
"config": {
"mimeTypes": ["image/tiff","image/bmp","image/x-ms-bmp"]
}
}
…Type adding can be added
… runtime module could
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 think this still has some rough edges for devs:
- router is in hash mode (that's controlled server side at the moment, directly in ocis via modification of the index.html)
- public links are announced by the server and as such are not with port
9201
when running inpnpm vite
-dev-mode.
Both of those are not blockers for merging the PR. But it's really good that running the dev setup with vite
is not documented by this PR, yet. Since the production build
and build:w
still work the same in the dev setup, and that is what we've documented, I see no blockers for this PR.
Love how you modernized a whole lot of things. And HMR of course. 😁 ❤️ Let's get this merged asap.
SonarCloud Quality Gate failed. |
Good catch. Indeed, we need to add a {
name: 'add-base',
transformIndexHtml: {
transform() {
return [
{
tag: 'base',
attrs: {
'href': '/'
}
}
]
}
}
} I would just add it, but it's causing an endless redirect loop for me and I have no time to debug right now.
Yeah, not sure, what to do about that ... I'm afraid our only way of dealing with this, is rewriting the urls client side. Everything else would have quite some complexity server side and I doubt the server team(s) would be happy.
💪🏻 |
@diocas @elizavetaRa do you still rebase to |
Lovely! oC web, welcome to the wild 20s of the 21 century :D I'm {proud of,happy for} y'all |
Description
This makes oC Web build with Vite.
To test this you need to do
docker-compose up -d
.OAuth2 Application in oC 10 and OIDC Client in oCIS are setup automatically now.
pnpm vite
orpnpm vite:ocis
-> https://host.docker.internal:9201/-> currently uses a shitty workaround because of CORS issues when running web on different host ocis#5108
-> possibly needs more dirs added to
server.proxy
invite.config.ts
pnpm vite:oc10
-> http://host.docker.internal:8081/Motivation and Context
rollup builds are rather slow and we spend a lot of time waiting for builds during development.
vite supports Hot Module Reloading which makes changes instant. If there are errors they are shown in the browser and we don't need to switch to the terminal to notice them.
Moreover it's the standard tool in the Vue world by now.
It uses rollup as a bundling backend in production mode and has compatible plugin api, so we need to worry less about standard rollup plugins (because they are abstracted away by vite) and can still use more exotic rollup plugins.
Screenshots (if appropriate):
Open tasks:
oidc-callback.html
process.env.PACKAGE_VERSION
replacement.js
and.cjs
files as commonjs modules, use dynamic import only for.mjs
. Possibly worth accepting TypeScript variants of those extensions to ease development of external apps with vitescripts
inpackage.json
TypeError: r.pbkdf2Sync is not a function
on file download (in oCIS?) -> https://github.com/sodatea/vite-plugin-node-stdlib-browser ?@extend
is being used in a componentFollowup tasks:
config.json.dist
files for vite, so users can provide their ownconfig.json
without changes to files tracked in gitconfig.json
files: Vite: Get rid of Vite specific config files #8707* [ ] Add a helper to initializeconfig.json
files with.dist
files if they are not present. Could be handled in stylevite.config.ts
potentiallydocker-compose restart oc10
. The dist folder is completely emptied and so our bind mounts break, dist cannot be mounted completely because of the file structure and where the php files need to be put-> do not merge dist folder with app.js and php files but have it in a separate sub folder
pnpm vite
/pnpm vite:ocis
(not for oc10!)