This is a collection of knowledge I have built up regarding browser powered drag and drop functionality
- timing: once as drag is starting
event.target
: draggableElement
# Stage 0 | |
FROM node:20-slim as base | |
LABEL maintainer="Nghiep <[email protected]>" | |
ENV PNPM_HOME="/pnpm" | |
ENV PATH="$PNPM_HOME:$PATH" | |
RUN corepack enable | |
RUN corepack prepare pnpm@9 --activate | |
ENV NEXT_TELEMETRY_DISABLED 1 | |
WORKDIR /app | |
COPY .npmrc package.json pnpm-lock.yaml pnpm-workspace.yaml cache-handler.mjs next.config.mjs ./ |
{ | |
"breadcrumbs.enabled": false, | |
"editor.fontFamily": "'MonoLisa', 'Dank Mono', 'Operator Mono Lig', 'Operator Mono', Menlo, Monaco, 'Courier New', monospace", | |
"editor.fontWeight": "400", | |
"editor.cursorBlinking": "smooth", | |
"editor.cursorSmoothCaretAnimation": "explicit", | |
"editor.stickyScroll.enabled": true, | |
"explorer.sortOrder": "type", | |
"workbench.editor.enablePreview": false, | |
"workbench.editor.highlightModifiedTabs": true, |
// Credit Ryan Carniato https://frontendmasters.com/courses/reactivity-solidjs/ | |
let context = []; | |
export function untrack(fn) { | |
const prevContext = context; | |
context = []; | |
const res = fn(); | |
context = prevContext; | |
return res; |
// Here's my current implementation of a Nuxt 3 server API catch-all with caching, retries, and request/response logging with total elapsed time: | |
// Place in: /server/api/[...].ts | |
import LRU from 'lru-cache'; | |
import { getCookie } from 'h3'; | |
const config = useRuntimeConfig(); | |
const cache = new LRU({ | |
max: 100, |
// ~/server/middleware/proxy.ts | |
import { defineEventHandler } from 'h3' | |
import { createProxyMiddleware } from 'http-proxy-middleware'; // npm install http-proxy-middleware@beta | |
const apiProxyMiddleware = createProxyMiddleware({ | |
target: 'https://jsonplaceholder.typicode.com', | |
changeOrigin: true, | |
ws: true, | |
pathRewrite: { | |
'^/api/todos': '/todos', |