Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/svelte.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"prettier-plugin-svelte": "^3.2.4",
"satori": "^0.10.13",
"satori-html": "^0.3.2",
"svelte": "5.3.0",
"svelte": "5.14.0",
"svelte-check": "^4.1.1",
"svelte-preprocess": "^6.0.3",
"tiny-glob": "^0.2.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"publint": "^0.2.12",
"svelte": "^5.1.11",
"svelte": "^5.14.0",
"svelte-check": "^4.1.1",
"typescript": "^5.0.0",
"vite": "^5.0.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"esrap": "^1.2.2",
"marked": "^14.1.2",
"resolve.exports": "^2.0.2",
"svelte": "5.1.11",
"svelte": "5.14.0",
"tarparser": "^0.0.4",
"zimmerframe": "^1.1.2"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/repl/src/lib/Output/ReplProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export default class ReplProxy {
case 'unhandledrejection':
return this.handlers.on_unhandled_rejection(event.data);
case 'console':
if (event.data.command === 'info' && event.data.args[0]?.type === '__error') {
const data = event.data.args[0];
const e = new Error(data.message);
e.name = data.name;
e.stack = data.stack;
event.data.args[0] = e;
}

return this.handlers.on_console(event.data);
}
};
Expand Down
6 changes: 5 additions & 1 deletion packages/repl/src/lib/Output/console/ConsoleLine.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@
{#if !part.formatted}
{' '}
{/if}{#if part.type === 'value'}
<JSONNode value={part.value} defaultExpandedLevel={log.expanded ? 1 : 0} />
{#if part.value instanceof Error}
<pre>{part.value.name + '\n' + part.value.stack.replace(/^\n+/, '')}</pre>
{:else}
<JSONNode value={part.value} defaultExpandedLevel={log.expanded ? 1 : 0} />
{/if}
{:else}
<!-- svelte-ignore a11y_no_static_element_interactions -->
<span class="styled" style={part.style} onclick={(e) => e.stopPropagation()}>
Expand Down
15 changes: 15 additions & 0 deletions packages/repl/src/lib/Output/srcdoc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@
<script>
(function () {
function send(payload, origin = '*') {
if (payload.command === 'info' && payload.args[0] instanceof Error) {
const error = payload.args[0];

if (/^(CreatedAt|UpdatedAt|TracedAt)Error$/.test(error.name)) {
// structuredClone obliterates useful info
// TODO do this for all errors?
payload.args[0] = {
type: '__error',
name: error.name,
message: error.message,
stack: error.stack
};
}
}

parent.postMessage(payload, origin);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/site-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"marked": "^14.1.2",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.4",
"svelte": "5.1.11",
"svelte": "5.14.0",
"svelte-check": "^4.1.1",
"typescript": "^5.5.4",
"vite": "^5.4.3"
Expand Down
293 changes: 97 additions & 196 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Loading