Help me solve morphdom woes in Livewire
Blade "@if" statements can sometimes cause problems in Livewire.
I can eliminate those problems if I can inject markers around those conditional block like so:
@if (...)
<div>foo</div>
@endif
import { reactive } from '@vue/reactivity' | |
function lens(value) { | |
let lookup = {} | |
let current | |
let get = () => current | |
let set = (newValue) => { |
<?php | |
function memoize($target) { | |
static $memo = new WeakMap; | |
return new class ($target, $memo) { | |
function __construct( | |
protected $target, | |
protected &$memo, | |
) {} |
Blade "@if" statements can sometimes cause problems in Livewire.
I can eliminate those problems if I can inject markers around those conditional block like so:
@if (...)
<div>foo</div>
@endif
<html> | |
<script src="/basic/canvas.js"></script> | |
<script src="/basic/ml.js"></script> | |
<div style="border: 1px solid black; width: 100px; height: 100px;"> | |
<canvas width="200" height="200" id="points" style="position: absolute; width: 100px; height: 100px"></canvas> | |
<canvas width="200" height="200" id="line" style="position: absolute; width: 100px; height: 100px"></canvas> | |
</div> | |
<script> |
<script data-turbo-eval="false"> | |
document.addEventListener('turbo:before-render', () => { | |
let permanents = document.querySelectorAll('[data-turbo-permanent]') | |
let undos = Array.from(permanents).map(el => { | |
el._x_ignore = true | |
return () => { | |
delete el._x_ignore | |
} |
function benchmark(times, callbacks) { | |
let result = {} | |
Object.entries(callbacks).forEach(([key, value]) => { | |
let thing = {} | |
let start = performance.now() | |
for (let index = 0; index < times; index++) { | |
value() | |
} |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tailwindcss/ui@latest/dist/tailwind-ui.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@0.7.4/dist/tailwind.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> |
{ | |
"title": "Caleb's Vim Mode", | |
"author": "Caleb Porzio(calebporzio.com)", | |
"rules": [ | |
{ | |
"description": "Vim Mode [D as Trigger Key]", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "d", |
{ | |
"title": "Caps Lock To Command/Escape", | |
"author": "Caleb Porzio(calebporzio.com)", | |
"homepage": "https://gist.github.com/calebporzio/2d07cd0e3013e7eaf16f5a2ea4f594ae", | |
"import_url": "karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/calebporzio/2d07cd0e3013e7eaf16f5a2ea4f594ae/raw/08c397b09fbaa5ec90cf161e5bca97bdb43e8c55/caps_lock_to_command_escape.json", | |
"rules": [ | |
{ | |
"description": "Caps Lock to Command/Escape", | |
"manipulators": [ | |
{ |