Skip to content

Commit

Permalink
fix(vuetify): remove defaultRtl handling
Browse files Browse the repository at this point in the history
With [3.5.0](https://github.com/vuetifyjs/vuetify/releases/tag/v3.5.0),
the defaultRtl information is hardcoded in the package and can't be treeshaken with our method.

Signed-off-by: GitHub <[email protected]>
  • Loading branch information
ferferga committed Feb 26, 2024
1 parent 8305937 commit 7f8bd1a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
16 changes: 0 additions & 16 deletions frontend/scripts/virtual-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ const vuetifyExports = localeNames
.map((l) => localeTransform(vuetifyKeys, l))
.filter((l): l is string => typeof l === 'string');

/**
* Map the RTL value of the mapped locales
*/
const transformedVuetifyRtl: Record<string, boolean> = {};

for (const e of vuetifyExports) {
const localeSplitted = e.includes(' as ') ? e.split(' as ') : e;
const originalLocale = Array.isArray(localeSplitted) ? localeSplitted[0] : e;
const targetLocale = Array.isArray(localeSplitted) ? localeSplitted[1] : e;

transformedVuetifyRtl[targetLocale] = vuetify.defaultRtl[originalLocale as keyof typeof vuetify.defaultRtl];
}

/**
* Get commit hash
*/
Expand All @@ -84,8 +71,5 @@ export default {
'virtual:locales/vuetify': `export { ${vuetifyExports.join(
', '
)} } from 'vuetify/locale'`,
'virtual:locales/vuetify/rtl': `export const defaultRtl = ${JSON.stringify(
transformedVuetifyRtl
)}`,
'virtual:commit': `export const commit_hash = ${commit_hash}`
};
4 changes: 1 addition & 3 deletions frontend/src/plugins/vuetify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as vuetifyLocales from 'virtual:locales/vuetify';
import { defaultRtl } from 'virtual:locales/vuetify/rtl';
import { createVuetify, type ThemeDefinition } from 'vuetify';
import { md3 } from 'vuetify/blueprints';
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg';
Expand Down Expand Up @@ -79,8 +78,7 @@ export const vuetify = createVuetify({
},
locale: {
fallback: 'en',
messages: vuetifyLocales,
rtl: defaultRtl
messages: vuetifyLocales
},
theme: {
themes: {
Expand Down
4 changes: 0 additions & 4 deletions frontend/types/modules/virtual.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ declare module 'virtual:locales/vuetify' {
export = typeWithoutRtl;
}

declare module 'virtual:locales/vuetify/rtl' {
export { defaultRtl } from 'vuetify/locale';
}

declare module 'virtual:commit' {
export const commit_hash: string | undefined;
}

0 comments on commit 7f8bd1a

Please sign in to comment.