-
-
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
Use a11y activation util #38477
Use a11y activation util #38477
Conversation
Signed-off-by: Christopher Ng <[email protected]>
@@ -49,7 +49,7 @@ import $ from 'jquery' | |||
|
|||
import OC from './index.js' | |||
import OCA from '../OCA/index.js' | |||
import { isA11yActivation } from '../Util/a11y.js' | |||
import { isA11yActivation } from '@nextcloud/vue' |
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.
This will increase the dist bundle size by about 5MB.
Webpack is not good at tree shaking, so the best would be to use import ... from '@nextcloud/vue/dist/.../'
but the a11y is currently not exported like this.
BTW: The other option to use the named import schema in every core file, is even worse...
Before this | With this | Everything as named import |
---|---|---|
57872356 | 62524760 | 73743763 |
(bytes)
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.
5MB seems to be a lot
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.
Yeah this already known (one of the reasons I am pushing ESM + vite).
But for now we need to add an entry point for this to the @nextcloud/vue
library and stick with the explicit default import.
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'm voting for usage of import ... from '@nextcloud/vue/dist/.../' too
Summary
Use util from
@nextcloud/vue
and drop core utilChecklist