Skip to content

Commit

Permalink
Build assets
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jun 9, 2023
1 parent b175da1 commit 4f00666
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
24 changes: 16 additions & 8 deletions dist/livewire.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
return this.get(key).forEach(callback);
}
};
function dispatch(el, name, detail = {}, bubbles = true) {
el.dispatchEvent(new CustomEvent(name, {
detail,
bubbles,
composed: true,
cancelable: true
}));
}
function isObjecty(subject) {
return typeof subject === "object" && subject !== null;
}
Expand Down Expand Up @@ -1517,8 +1525,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
function start() {
if (!document.body)
warn2("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
dispatch(document, "alpine:init");
dispatch(document, "alpine:initializing");
dispatch2(document, "alpine:init");
dispatch2(document, "alpine:initializing");
startObservingMutations();
onElAdded((el) => initTree(el, walk));
onElRemoved((el) => destroyTree(el));
Expand Down Expand Up @@ -3862,7 +3870,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
"X-Synthetic": ""
}
};
let finishWiretap = trigger2("wiretap.request", options);
let finishProfile = trigger2("profile.request", options);
let finishFetch = trigger2("fetch", uri, options);
let response = await fetch(uri, options);
response = finishFetch(response);
Expand All @@ -3879,7 +3887,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
}
let failed = true;
};
await handleResponse(response, succeed, fail, finishWiretap);
await handleResponse(response, succeed, fail, finishProfile);
}
function getCsrfToken() {
if (document.querySelector("[data-csrf]")) {
Expand All @@ -3890,7 +3898,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
function processEffects(target, effects) {
trigger2("effects", target, effects);
}
async function handleResponse(response, succeed, fail, finishWiretap) {
async function handleResponse(response, succeed, fail, finishProfile) {
let content = await response.text();
if (response.ok) {
if (response.redirected) {
Expand All @@ -3899,13 +3907,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
if (contentIsFromDump(content)) {
[dump, content] = splitDumpFromContent(content);
showHtmlModal(dump);
finishWiretap({ content: "{}", failed: true });
finishProfile({ content: "{}", failed: true });
} else {
finishWiretap({ content, failed: false });
finishProfile({ content, failed: false });
}
return await succeed(content);
}
finishWiretap({ content: "{}", failed: true });
finishProfile({ content: "{}", failed: true });
let skipDefault = false;
trigger2("response.error", response, content, () => skipDefault = true);
if (skipDefault)
Expand Down
Loading

0 comments on commit 4f00666

Please sign in to comment.