-
Notifications
You must be signed in to change notification settings - Fork 156
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
[WIP] Ability to package top bar as web component #2823
Conversation
|
Seems this is getting more tricky now: we need to load the config.json but also let apps register their icons, so we actually need to also load app extension points. Basically refactor the config and app bits of phoenix.js into utility functions so we can use them in Top-Bar.vue when included as web components. |
e64e20c
to
2b4e936
Compare
a117acf
to
1e17964
Compare
I managed to separate and slightly clean up the initialization code of Phoenix to make it reusable in the web component. However so far the web component doesn't properly boot and debugging minified code is no fun. |
Further attempts, but the drop down of apps menu and user menu are still stuck open. Including UIKit in the web component entry point didn't help with that. |
Next up would be to try to add debug statements in ODS to see if the UIKit code actually runs, but there is no initialization code as it's all "magic" and likely happens at the time the module is imported. This will be hard to debug. |
f6731f2
to
7760532
Compare
7760532
to
207a088
Compare
rebased |
pfff, I don't understand. I made every precaution to not import the vue router in the TopBarWebComponent and yet vue insists on calling it. Also I found the vue-router module in the build, as if it just bundled every possible thing instead of just the needed stuff. |
oh, seems the router is likely coming in from ODS:
|
UIkit cannot work fully in a Shadow DOM because it's using But the global MutationObserver is not observing DOM changes inside the shadow DOM: https://stackoverflow.com/q/46995421 It would require patching UIKit to use a more complex logic to find out about all shadow DOM entries that are added dynamically and then observe those as well, like it's done for example here: https://github.com/medialize/ally.js/pull/114/files Somehow it also feels wrong to go this way. Here UIKit is launched inside the Web Component, so I'd expect it to be able to find out about the shadow root and observe only that one. |
adding a "uk-grid" attribute outside the shadow DOM in the OC 10 page markup works, UIKit is initializing it there. |
abandoned as it's way more complex than anticipated |
Description
Make Top-Bar.vue compilable as Web Component.
Phoenix core now renders all apps fullscreen, no more top bar.
The apps must include the top bar explicitly, the files app does so here.
Related Issue
Motivation and Context
Ability for any separate SPA to include the Phoenix top bar and its menus for seamless navigation between apps.
The top bar is also included in OC 10 in this PR: owncloud/core#36529
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks:
properly pass URLs
webpack CORS thing
webpack target: export system.css into dist folder for dynamic inclusion
webpack target: export top-bar and other web components:
node_modules/.bin/vue build --target wc --name phoenix-top-bar src/components/Top-Bar.vue && cp dist/phoenix-top-bar.js ~/work/workspace/owncloud/core/js/phoenix-top-bar.js
l10n web component: load translations.json directly in Top-Bar.vue
l10n navigation.json
fix notifications
buggy menu toggling
file size issues in web component
files app missing scrollbars, probably missing scroll container (now that Phoenix renders the app full screen)
maybe for the first version, leave the files app alone ?
todo for later: decouple files app completely from Phoenix core...
raise: bundle size reduction ideas: