Skip to content

Commit

Permalink
Update Qwik to v.0.102.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Apr 16, 2023
1 parent dbb94d2 commit fba5f86
Show file tree
Hide file tree
Showing 12 changed files with 420 additions and 722 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ module.exports = {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/consistent-type-imports': 'warn',
'qwik/use-method-usage': 'off'
},
};
Empty file removed docs/docs/translation-functions.md
Empty file.
6 changes: 3 additions & 3 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export const config: SpeakConfig = {
_src/speak-functions.ts_
```typescript
import { server$ } from '@builder.io/qwik-city';
import type { LoadTranslationFn, TranslationFn } from 'qwik-speak';
import type { LoadTranslationFn, Translation, TranslationFn } from 'qwik-speak';

/**
* Translation files are lazy-loaded via dynamic import and will be split into separate chunks during build.
* Keys must be valid variable names
*/
const translationData = import.meta.glob('/i18n/**/*.json');
const translationData = import.meta.glob<Translation>('/i18n/**/*.json');

/**
* Using server$, translation data is always accessed on the server
Expand Down Expand Up @@ -167,7 +167,7 @@ export const ChangeLocale = component$(() => {
<div>
<h2>{t('app.changeLocale@@Change locale')}</h2>
{config.supportedLocales.map(value => (
<button onClick$={async () => await changeLocale$(value)}>
<button key={value.lang} onClick$={async () => await changeLocale$(value)}>
{value.lang}
</button>
))}
Expand Down
2 changes: 1 addition & 1 deletion docs/translation-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To improve performance, it is recommended to bundle translation files instead of
* Translation files are lazy-loaded via dynamic import and will be split into separate chunks during build.
* Keys must be valid variable names
*/
const translationData = import.meta.glob('/i18n/**/*.json');
const translationData = import.meta.glob<Translation>('/i18n/**/*.json');

const loadTranslation$: LoadTranslationFn = server$((lang: string, asset: string) =>
translationData[`/i18n/${lang}/${asset}.json`]?.()
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _src/speak-functions.ts_
* Translation files are lazy-loaded via dynamic import and will be split into separate chunks during build.
* Keys must be valid variable names
*/
const translationData = import.meta.glob('/i18n/**/*.json');
const translationData = import.meta.glob<Translation>('/i18n/**/*.json');

/**
* Using server$, translation data is always accessed on the server
Expand Down Expand Up @@ -149,7 +149,7 @@ _src/components/router-head/router-head.tsx_
<title>{t(head.title)}</title>

{head.meta.map((m) => (
<meta name={m.name} content={m.name === 'description' ? t(m.content!) : m.content} />
<meta key={m.key} name={m.name} content={m.name === 'description' ? t(m.content!) : m.content} />
))}
```

Expand Down Expand Up @@ -200,7 +200,7 @@ export const ChangeLocale = component$(() => {
<div>
<h2>{t('app.changeLocale@@Change locale')}</h2>
{config.supportedLocales.map(value => (
<button onClick$={async () => await navigateByLocale$(value)}>
<button key={value.lang} onClick$={async () => await navigateByLocale$(value)}>
{value.lang}
</button>
))}
Expand Down
Loading

0 comments on commit fba5f86

Please sign in to comment.