Skip to content

Commit d8824b9

Browse files
committed
SuperDebug update.
1 parent 5412f9d commit d8824b9

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ Headlines: Added, Changed, Deprecated, Removed, Fixed, Security
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [1.3.0] - 2023-07-14
99

1010
### Fixed
1111

1212
- Fixed persisting form data when component used data from `$page` in combination with `onDestroy`. ([#164](https://github.com/ciscoheat/sveltekit-superforms/issues/164), thank you to everyone in that thread!)
1313
- Fixed exception message when the `dataType` option isn't set to `'json'` and the schema contains a nested object. ([#225](https://github.com/ciscoheat/sveltekit-superforms/issues/225))
1414
- Superforms are now ignoring normal SvelteKit form actions when they are posted. ([#230](https://github.com/ciscoheat/sveltekit-superforms/issues/230))
1515

16+
### Added
17+
18+
- More configuration options, customizable styling, automatic promise and store support for [SuperDebug](https://superforms.rocks/super-debug), thanks to [Josue](https://github.com/J-Josu)!
19+
1620
## [1.2.0] - 2023-07-06
1721

1822
### Added

src/lib/client/SuperDebug.svelte

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
export let display = true;
2424
/**
25-
* Controls when to show the http status code of the current page (reflecs the status code of the last request).
25+
* Controls when to show the HTTP status code of the current page (reflecs the status code of the last request).
2626
*
2727
* Default is `true`.
2828
*/
@@ -34,11 +34,11 @@
3434
/**
3535
* Controls the maximum length of a string field of the data prop.
3636
*
37-
* Default is `120` characters.
37+
* Default is `120` characters. Set to `0` to disable trimming.
3838
*/
3939
export let stringTruncate = 120;
4040
/**
41-
* Reference to the pre element that contains the shown d
41+
* Reference to the pre element that contains the data.
4242
*
4343
* @type {HTMLPreElement | undefined}
4444
*/
@@ -47,6 +47,7 @@
4747
* Controls if the data prop should be treated as a promise (skips promise detection when true).
4848
*
4949
* Default is `false`.
50+
* @deprecated Promises are auto-detected from 1.3.0.
5051
*/
5152
export let promise = false;
5253
/**
@@ -133,7 +134,12 @@
133134
return '#}F#' + `[function ${value.name}]`;
134135
}
135136
if (value instanceof Error) {
136-
return '#}E#' + `${value.name}: ${value.message || value.cause || 'uknown error message'}`;
137+
return (
138+
'#}E#' +
139+
`${value.name}: ${
140+
value.message || value.cause || '(No error message)'
141+
}`
142+
);
137143
}
138144
return value;
139145
},
@@ -154,7 +160,7 @@
154160
} else {
155161
cls = 'string';
156162
match =
157-
match.length > stringTruncate
163+
stringTruncate > 0 && match.length > stringTruncate
158164
? match.slice(0, stringTruncate / 2) +
159165
`[..${match.length}..]` +
160166
match.slice(-stringTruncate / 2)
@@ -292,9 +298,7 @@
292298
293299
Other use cases includes debugging plain objects, promises, stores and more.
294300
295-
More info:
296-
- [API](https://superforms.rocks/api#superdebug)
297-
- [Examples](https://github.com/ciscoheat/sveltekit-superforms/tree/main/src/routes/super-debug)
301+
More info: https://superforms.rocks/super-debug
298302
299303
**Short example:**
300304

src/routes/super-debug/+page.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
<strong>Note:</strong> looking for the capabilities of SuperDebug?
8686
Check
8787
<b>
88-
<a href="super-debug/extensive-usage-cases">All data cases examples</a></b
88+
<a href="super-debug/extensive-usage-cases"
89+
>All data cases examples</a
90+
></b
8991
>.
9092
</p>
9193
<b>Change name: <input bind:value={$form.full_name} /></b>

0 commit comments

Comments
 (0)