Commit 5569610
authored
fix: dictionary search engine late indexing (#49)
This Pull Request fixes the issue where the dictionary search engine
returns no result on initial load of the web app. This is exactly due to
the reason explained in #47. This fix implements direct computation of
the `dictionary` object property (derived from an `Astro.glob` operation
used to retrieve all entries from our words directory `pages/browse`)
inside of the homepage and the word layout, dropping usage of state to
share the value.
### Changes Made
- Deprecated and dropped the integration of the `$dictionary` state
- Compute value for the `search` island `dictionary` prop (which used to
be set to the `$dictionary.value`) directly in the server-side of the
following places
- `layouts/word.astro` - the word layout where the `search` island is
integrated in the `Navbar`
- `pages/index.astro` - the landing page where the `search` island is
prominently integrated
### Related Issue
Resolves #47
### Screencast/Screenshot
[screencast-jargons-dev-git-fix-dictionary-search-index-babblebeys-projects.vercel.app-2024.04.19-11_26_47.webm](https://github.com/babblebey/jargons.dev/assets/25631971/9c500897-63f3-4203-b604-372ee056527b)
📖1 parent af4c1e0 commit 5569610
5 files changed
Lines changed: 11 additions & 15 deletions
File tree
- src
- components/islands
- layouts
- lib/stores
- pages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 27 | | |
33 | 28 | | |
34 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments