## Description
Move rate-limit to cloudflare
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
## Description
This PR integrates a rate-limiting mechanism into the app using Vercel's
edge-layer middleware in combination with the Hono framework. This
middleware is written in JS with full JSDoc TypeScript typings.
### Architecture & Strategy
Vercel Middleware: Serves as the front-line defense, running at the edge
for optimal performance.
Hono Framework: For granular control, we utilize Hono middlewares for
applying or skipping rate limits.
Additionally, non-expensive routes benefit from an ephemeral cache to
further optimize performance
### Current Limitations
Due to a dependency on CommonJS, we cannot use TypeScript fully.
Consequently, session configurations are not yet shared across multiple
files. All utility functions are present in a single file for the time
being.
### Logic Breakdown
- Assets: Rate limiting skipped.
- Service Calls: Rate limiting skipped.
- /rest/ai/* Endpoint: Rate limit of 20 requests per 5 minutes,
identified by userId or IP.
- Unauthorized Users: Rate limit of 5 requests per 5 seconds, based
solely on IP.
- Authorized Users: Rate limit of 20 requests per 5 seconds, based on
userId.
### Next Steps
Plan to migrate to ESM for enabling TypeScript support for better
maintainability.
Use multiple regional KV
### Debug endpoint.
[Rate limit debug
endpoint](https://webstudio-builder-kscynssns-webstudio-is.vercel.app/rate-limit-debug)
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
## Description
Based on discussion, now space section tooltips are shown only on label
hovers
Supports alt/shift clicks
- [x] - During hover alt/shift works
- [x] - In case of multiple properties sources now group them
<img width="292" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/029b60a5-9a4e-4d85-ba2e-3db4fbbb344d">
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
## Description
This PR "swaps" the guiding principle behind what options are in the
base `tsconfig.json`.
Previously TS was configured to *not* emit declarations and we were
forcing for them to be emitted with CLI flags. This had an unfortunate
result - errors about "not portable type definitions" were not displayed
in the IDE because to its best knowledge the type definitions were never
supposed to be emitted. So it wasn't worthwhile to surface this error.
With the adjusted options those errors will be raised in the IDE which
should improve the feedback loop for those errors.
## Code Review
- [ ] hi @TrySound, @istarkov, @kof - you need to recheck if you have
any doubts about this approach, if you see anything wrong with it in the
context of this project
## Before merging
- [ ] test IDE setup
- [ ] test build script
- [ ] test typechecking and dts emit