✨ 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
55 lines
1.5 KiB
Markdown
55 lines
1.5 KiB
Markdown
# get-nonce
|
|
|
|
just returns a **nonce** (number used once). No batteries included in those 46 bytes of this library.
|
|
|
|
---
|
|
|
|
- ✅ build in `webpack` support via `__webpack_nonce__`
|
|
|
|
# API
|
|
|
|
- `getNonce(): string|undefined` - returns the current `nonce`
|
|
- `setNonce(newValue)` - set's nonce value
|
|
|
|
## Why?
|
|
|
|
Why we need a library to access `__webpack_nonce__`? Abstractions!
|
|
|
|
"I", as a library author, don't want to "predict" the platform "you" going to use.
|
|
"I", as well, want an easier way to test and control `nonce` value.
|
|
|
|
Like - `nonce` is supported out of the box only by webpack, what you are going to do?
|
|
|
|
This is why this "man-in-the-middle" was created.
|
|
Yep, think about `left-pad` :)
|
|
|
|
## Webpack
|
|
|
|
> https://webpack.js.org/guides/csp/
|
|
|
|
To activate the feature set a **webpack_nonce** variable needs to be included in your entry script.
|
|
|
|
```
|
|
__webpack_nonce__ = uuid(); // for example
|
|
```
|
|
|
|
Without `webpack` `__webpack_nonce__` is actually just a global variable,
|
|
which makes it actually bundler independent,
|
|
however "other bundlers" are able to replicate it only setting it as a global variable
|
|
(as here in tests) which violates a "secure" nature of `nonce`.
|
|
|
|
`get-nonce` is not global.
|
|
|
|
## Used in
|
|
|
|
- `react-style-singleton` <- `react-remove-scroll` <- `react-focus-on`
|
|
|
|
## Inspiration
|
|
|
|
- [this issue](https://github.com/theKashey/react-remove-scroll/issues/21)
|
|
- [styled-components](https://github.com/styled-components/styled-components/blob/147b0e9a1f10786551b13fd27452fcd5c678d5e0/packages/styled-components/src/utils/nonce.js)
|
|
|
|
# Licence
|
|
|
|
MIT
|