Commit 0445af0
Migrate Lexbox UI to Svelte 5 (#1634)
* Rename "derived" uses that mess up migration script
The `pnpx sv migrate svelte-5` script has trouble with changing `$:`
statements to `derived` when there are existing uses of `derived` in the
code, so we'll rename the three cases that have that problem before
running the migration script.
* Result of svelte-5 migration script
This is what `pnpx sv migrate svelte-5` produced, with no changes. There
is one file, `src/routes/(unauthenticated)/login/+page.svelte`, which
might need further attention: a `@migration task` commit was created
saying "review uses of `navigating`" (which used to be imported from
$app/stores and now comes from $app/state instead).
There might not be any changes needed, but if there are, that work will
go in a separate commit.
* Navigating state is guaranteed non-null
In SvelteKit version 2.12 or later, the `navigating` object is
guaranteed never to be null; its properties (from, to, etc.) will be
null if no navigation is going on, but you can safely check
`navigating.to` rather than `navigating?.to`.
* Fix now-incorrect ordering of variables
IconButton was using the `size` prop before it was declared. In Svelte 4
the compiler was reordering this, in Svelte 5 this is no longer allowed;
the variable that uses `size` needs to be moved after the $props call.
* Just use `$bindable()`, not `$bindable(undefined)`
In Svelte 5, if you have set a fallback value for a bindable prop then
you're not allowed to have the caller pass `undefined` to it. But if the
"fallback value" was just `undefined` in the first place, then that's
the default behavior of just plain `$bindable()` with no fallback value.
* Use `page` from `$app/state`, not `$app/stores`
Running the `pnpx sv migrate svelte-5` a second time allowed it to
migrate several uses of the `$page` store into the new `page` state.
This commit is the unchanged result of the migration tool.
* Allow eslint to fix auto-fixable errors
These are errors that used to be suppressed but are no longer errors,
and eslint automatically removed the error-suppressing comments.
* Fix consistent-type-imports errors
Types like `import('svelte').Snippet` are now forbidden, so we replace
them with explicit type imports at the top of the file.
Prettier made other code changes when I saved these files, which I've
placed into a separate commit to make refactoring slightly easier should
that prove necessary.
* Changes made by Prettier when fixing lint errors
Separated into separate commit so these changes will be slightly easier
to revert if they are wrong.
* Fix remaining lint errors
* Fix type errors
* Remove now-unused createBubbler() imports
* change custom overlay to use passed callbacks rather than custom events
* Pass rest props through intermediate Select components
* Fix errors on project page
* Address review comments
* Get rid of infinite loop on register page
* Fix PasswordStrengthMeter without infinite loop
Instead of setting a bindable prop based on a derived from the props
list, which was triggering an infinite loop, we will fall back to
function props and pass an onScoreUpdated function into the password
strength meter component. It's slightly more verbose, but it avoids the
infinite loop of effects triggering updates to themselves that our
previous approach was causing.
* Avoid infinite recursion during SSR
This works just fine in client-side rendering, but causes an infinite
recursive call to headerContent() when rendered server-side. Putting a
`$derived` in the middle breaks the loop and makes the page render
correctly in both SSR and CSR.
---------
Co-authored-by: Kevin Hahn <[email protected]>
Co-authored-by: Tim Haasdyk <[email protected]>1 parent 2719cd8 commit 0445af0
File tree
176 files changed
+4255
-2695
lines changed- frontend
- src
- lib
- components
- Badges
- FilterBar
- Markdown
- Orgs
- ProjectType
- Projects
- Table
- Users
- help
- modals
- email
- error
- forms
- icons
- layout
- Breadcrumbs
- notify
- overlay
- routes
- (authenticated)
- admin
- authorize
- org
- [org_id]
- create
- list
- project
- [project_code]
- viewer
- create
- resetPassword
- user
- (unauthenticated)
- forgotPassword
- login
- sandbox
- [status_code]
- i18n/late
- email/tester
- tests
- pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
176 files changed
+4255
-2695
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | | - | |
20 | | - | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | | - | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
13 | 31 | | |
14 | 32 | | |
15 | 33 | | |
16 | 34 | | |
17 | 35 | | |
18 | 36 | | |
19 | | - | |
| 37 | + | |
20 | 38 | | |
21 | 39 | | |
22 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
11 | 25 | | |
12 | 26 | | |
13 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
14 | 33 | | |
15 | | - | |
| 34 | + | |
16 | 35 | | |
17 | 36 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
6 | | - | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | | - | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | | - | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
8 | 20 | | |
9 | 21 | | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
13 | 25 | | |
14 | | - | |
| 26 | + | |
15 | 27 | | |
16 | 28 | | |
17 | 29 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
2 | 11 | | |
3 | 12 | | |
4 | 13 | | |
5 | | - | |
| 14 | + | |
6 | 15 | | |
7 | 16 | | |
Lines changed: 25 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
28 | 38 | | |
29 | 39 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
0 commit comments