Files
Laca-City/backend/node_modules/synckit/lib/index.js
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
2025-07-20 19:52:16 +07:00

73 lines
2.4 KiB
JavaScript

import module from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { parentPort, workerData, } from 'node:worker_threads';
import { MODULE_REGISTER_SUPPORTED } from './constants.js';
import { extractProperties, overrideStdio, startWorkerThread, } from './helpers.js';
export * from './common.js';
export * from './constants.js';
export * from './helpers.js';
export * from './types.js';
let syncFnCache;
export function createSyncFn(workerPath, timeoutOrOptions) {
syncFnCache ?? (syncFnCache = new Map());
if (typeof workerPath !== 'string' || workerPath.startsWith('file://')) {
workerPath = fileURLToPath(workerPath);
}
const cachedSyncFn = syncFnCache.get(workerPath);
if (cachedSyncFn) {
return cachedSyncFn;
}
if (!path.isAbsolute(workerPath)) {
throw new Error('`workerPath` must be absolute');
}
const syncFn = startWorkerThread(workerPath, typeof timeoutOrOptions === 'number'
? { timeout: timeoutOrOptions }
: timeoutOrOptions);
syncFnCache.set(workerPath, syncFn);
return syncFn;
}
export function runAsWorker(fn) {
if (!workerData) {
return;
}
const stdio = [];
overrideStdio(stdio);
const { workerPort, sharedBufferView, pnpLoaderPath } = workerData;
if (pnpLoaderPath && MODULE_REGISTER_SUPPORTED) {
module.register(pnpLoaderPath);
}
parentPort.on('message', ({ id, args }) => {
;
(async () => {
let isAborted = false;
const handleAbortMessage = (msg) => {
if (msg.id === id && msg.cmd === 'abort') {
isAborted = true;
}
};
workerPort.on('message', handleAbortMessage);
let msg;
try {
msg = { id, stdio, result: await fn(...args) };
}
catch (error) {
msg = { id, stdio, error, properties: extractProperties(error) };
}
workerPort.off('message', handleAbortMessage);
if (isAborted) {
stdio.length = 0;
return;
}
try {
workerPort.postMessage(msg);
Atomics.add(sharedBufferView, 0, 1);
Atomics.notify(sharedBufferView, 0);
}
finally {
stdio.length = 0;
}
})();
});
}
//# sourceMappingURL=index.js.map