Commit 36e8e65
Followup work on Svelte 5 migration - code cleanup and so on (#1652)
* Get rid of recursive updates in run() calls
TrainTracks and HgLogView components have slightly tricky logic that the
migration tool didn't quite figure out correctly. Pulling the run() call
apart into multiple `$derived` sections is much cleaner.
* Change `$props()` to const if not bindable
* Convert on:change in FilterBar to prop function
Also got to simplify a convoluted mess around ViewMode in the default
authenticated home page. Now that `$derived` values can be overridden,
it turned into a very simple `$derived(cookieVal ?? defaultVal)` line,
while still allowing the user to set the value.
* Remove most uses of `run()` from svelte/legacy
A couple uses of `run()` need something non-trivial done to replace
them. In one case we need to write better logic in lexSuperForm: the
project code should probably be split into two form entries, one
calculated code and one override, and the checkbox when checked smoothly
replaces the calculated code field with the override field.
In the other case where I kept a `run()` call, we will be able to
replace it easily once async deriveds become available in Svelte 5.
(They're available now in experimental mode, but it's been less than a
week so I want to wait until they settle a bit more).
* Remove more `run()` usages
* Remove `run()` use in project creation page
* Remove a preventDefault use from svelte/legacy
* Remove redundant undefineds in props
Optional props don't need `| undefined` in their type definition, as
it's implied by the `?`. And the assignment via `$props` likewise
doesn't need to set a default `undefined` value to optional props.
* Remove createEventDispatcher from components
* Get rid of `run()` in FilterBar and UserTypeahead
Also replaced PlainInput with a DebouncedInput component, so that we can
switch PlainInput back to being what it sounds like: a plain input field
that doesn't try to do anything clever.
* Remove `run()` usage from email tester page
Note that this would be better as an async derived once it's available
(see discussion #15845 in the Svelte repo for details). Until then,
this works well enough.
* Make PlainInput plain again
* UserTypeahead now uses a PlainInput
* Fix infinite effect loop in EditUserAccount
Accessing the `$form` in onScoreUpdated was causing Svelte to track the
entire form as a dependency of the PasswordStrengthMeter component,
causing an infinite effect loop as soon as we updated `$form.score`.
Svelte is smart enough not to track dependencies for `$form.foo = bar`
but needed to be told not to track the `if ($form)` part.
* Fix customCode reactivity
* Make code-exists error initially undefined
* Remove debouncing prop and refactor DebouncedInput to accept values pushes
* Fix code_exists error shown delayed
---------
Co-authored-by: Tim Haasdyk <[email protected]>1 parent ad2319a commit 36e8e65
File tree
151 files changed
+591
-749
lines changed- frontend
- src
- lib
- components
- Badges
- FilterBar
- Markdown
- Orgs
- ProjectType
- Projects
- Table
- Users
- help
- modals
- email
- forms
- icons
- layout
- Breadcrumbs
- util
- routes
- (authenticated)
- admin
- authorize
- org
- [org_id]
- list
- project
- [project_code]
- create
- resetPassword
- user
- (unauthenticated)
- acceptInvitation
- register
- sandbox
- [status_code]
- email/tester
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
151 files changed
+591
-749
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| 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 | | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 15 | + | |
| 16 | + | |
23 | 17 | | |
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
30 | | - | |
31 | | - | |
| 24 | + | |
| 25 | + | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 24 | + | |
31 | 25 | | |
32 | 26 | | |
33 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
| |||
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 10 | + | |
19 | 11 | | |
20 | 12 | | |
21 | | - | |
| 13 | + | |
22 | 14 | | |
| 15 | + | |
23 | 16 | | |
24 | 17 | | |
25 | 18 | | |
26 | | - | |
| 19 | + | |
27 | 20 | | |
28 | 21 | | |
29 | 22 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments