Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jul 21, 2023
1 parent 61be5cd commit 394edf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/alpinejs/src/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function generateFunctionFromString(expression, el) {
// calling function so that we don't throw an error AND a "return" statement can b e used.
let rightSideSafeExpression = 0
// Support expressions starting with "if" statements like: "if (...) doSomething()"
|| /^[\n\s]*if.*\(.*\)/.test(expression)
|| /^[\n\s]*if.*\(.*\)/.test(expression.trim())
// Support expressions starting with "let/const" like: "let foo = 'bar'"
|| /^(let|const)\s/.test(expression)
|| /^(let|const)\s/.test(expression.trim())
? `(async()=>{ ${expression} })()`
: expression

Expand Down
6 changes: 6 additions & 0 deletions packages/navigate/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export default function (Alpine) {

})
})

// Because DOMContentLoaded is fired on first load,
// we should fire alpine:navigated as a replacement as well...
setTimeout(() => {
fireEventForOtherLibariesToHookInto()
})
}

function fetchHtmlOrUsePrefetchedHtml(fromDestination, callback) {
Expand Down

0 comments on commit 394edf0

Please sign in to comment.