## Description
closes#3872
- [x] - Builder support
- [x] - Publish support
## Steps for reproduction
Example
https://add-json.staging.webstudio.is/builder/8160e16d-5ab4-4249-86de-0c98a64526a3https://test-json-ki9yj.wstd.work/
## 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
- [x] - Sync fixtures by buildId `pnpm cli sync --buildId blabla`
- [x] - Sync with current branch deployment
## 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
Here split everything imported from react-sdk by published sites into
separate entry point react-sdk/runtime.
The result in ssg fixture is the following
```diff
- 429788 chunk-CuG10VAj.js
+ 370366 chunk-D4NWbWis.js
```
## Description
### Todos
- [x] - Expand support: `ssg` and `ssg-(netlify|vercel)` differ by only
one file. This expansion allows a single external template to apply to
multiple internal uses (previously hardcoded in prebuild, see
`defaults`).
- [x] - Add & test ssg-vercel and ssg-netlify constants.mjs templates to
support image optimizations.
## Steps for reproduction
```bash
cd ./fixtures/ssg
pnpm cli build --template ssg-netlify --template internal --preview && pnpm prettier --write .
pnpm build
```
then drag drop on netlify and see the result
[example](https://66a9d3c5c6bb86681c6611e4--inspiring-liger-df7a81.netlify.app/)
```html
<img alt="" width="14" height="16" src="/.netlify/images?url=%2Fassets%2Ficonly_svg_converted-converted_zMaMiAAutUl8XrITgz7d1.svg&w=32&q=80" class="w-image c161qeci" sizes="100vw" srcset="/.netlify/images?url=%2Fassets%2Ficonly_svg_converted-converted_zMaMiAAutUl8XrITgz7d1.svg&w=16&q=80 16w, /.netlify/images?url=%2Fassets%2Ficonly_svg_converted-converted_zMaMiAAutUl8XrITgz7d1.svg&w=32&q=80 32w" decoding="async" loading="lazy">
```
```bash
cd ./fixtures/ssg
pnpm cli build --template ssg-vercel --template internal --preview && pnpm prettier --write .
pnpm build
```
Upload to https://github.com/webstudio-is/ssg-vercel-test/tree/main
See vercel deployment
[example](https://ssg-vercel-test-r0a778rpj-getwebstudio.vercel.app/)
```html
<img alt="" width="14" height="16" src="/_vercel/image?url=%2Fassets%2Ficonly_svg_converted-converted_zMaMiAAutUl8XrITgz7d1.svg&w=32&q=80" class="w-image c161qeci" sizes="100vw" srcset="/_vercel/image?url=%2Fassets%2Ficonly_svg_converted-converted_zMaMiAAutUl8XrITgz7d1.svg&w=16&q=80 16w, /_vercel/image?url=%2Fassets%2Ficonly_svg_converted-converted_zMaMiAAutUl8XrITgz7d1.svg&w=32&q=80 32w" decoding="async" loading="lazy">
```
## 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
We want to replace n8n handler as proprietary code with injected
handler. The idea is to return resource request from this handler which
can be executed same way as user defined resource.
## Description
Only support without any UI
Corresponding saas
https://github.com/webstudio-is/webstudio-saas/pull/312
## 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
Closes https://github.com/webstudio-is/webstudio/issues/3789
Here stopped submitting webhook form with custom action to n8n and
requested directly from generated code. This has a few benefits
- self-hosted websites (vercel, netlify) no longer have to setup n8n to
support forms
- we can pay n8n for these executions no more
- user no longer have to unsubscribe from emails when setup custom
webhook
Ref https://github.com/webstudio-is/webstudio/issues/3789
Here changed a few things
- replace WebhookForm action prop with resource, which is sent with
hidden field instead of instance id
- prevented generating method and action in client side code
- generate "action" resource instead of form properties for server
action prop is replaced only inside cli to not require support in
builder yet, in the future this can be part of client migrations
Ref https://github.com/webstudio-is/webstudio/issues/3763
Here added new "ssg" template to cli.
Generated non-remix app. `vike build` generates
static site at `dist/client`.
```
cd fixtures/ssg
pnpm build
npx sirv-cli client/dist
```
Here made constants path easier to access from dynamic paths by
automatically replacing __CONSTANTS__ with actual relative path.
This is necessary for vike support which has folder based routes.
We wanna support other frameworks than remix.
At least to support SSG we need to additionally deploy vike.dev.
Here split all remix specifics into separate module. It provides the
list of components (including overrides) and templates getter.
Templates allow to provide multiple module per route which is essential
for many frameworks like svelte and vike which do not rely on
treeshaking for client/server splitting.
## Description
1. What is this PR about (link the issue and add a short description)
## 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
Here improved replacing placeholders in our templates. Before used some
relative path to stubs. Now use explicitly named placeholders like
`__CLIENT__`, `__SERVER__`, `__CSS__` and `__SITEMAP__`.
This will give more flexibility when support other frameworks, for
example vike.
Here improved our checks. No longet rely on "checks" script but run
"test" and "typescript" scripts from each package in monorepo.
Would also make each package less boilerplaty.
## Description
1. What is this PR about (link the issue and add a short description)
## 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
Reload scripts in HTML Embed on dynamic pages
Closes#3581
## Steps for reproduction
Open
https://scripts-reload-saas-2-pgmkm.wstd.work/test/1
dynamic link clicks should cause `console.log` from IFrame
Anchor link should not.
## 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
- Adds the ability to place images on the canvas immediately during
upload, using the file blob or a provided URL.
- Enables images to use width and height from asset metadata.
- Detects duplicate assets and displays a warning message.
<img width="323" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/fe810dd8-3e3d-4cab-8669-b0d739044f49">
These changes allow images to appear on the canvas upon pasting, even if
the asset is not fully uploaded yet.
## Steps for reproduction
Start uploading few files on a slow connection, select them before
upload, see image on canvas is changed
## 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
Following code in Project Setting Custom Code
```
<script data-cf-beacon='{"token": "123"}'>
```
failed on build
## 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
- restrict node to >= 20.12 with "engines" field
- write .npmrc by code instead of copying from template because publish
always cuts it from cli package
- use `npx webstudio@latest` to always install fresh cli if necessary
Our vite setup in builder is getting slower
because of huge amount of modules.
Here I merged more than 400 icon modules into 2 modules string and
components.
This should improved vite experience and slightly reduce bundling time.
Here upgraded storybook with reresolved transitive dependencies. Removed
babel/types override, will eventually let us deduplicate a lot of
dependencies.
Finally figured out how to leverage node conditions to run webstudio cli
in fixtures without rebuilding it on every change.
Import conditions is another thing which allows
to constrain not exposed modules but internal ones.
Now to run cli locally it should be have this env
which is basically same we do with vite.
Works for both import and export conditions.
```
NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio
```
## Description
Corresponding SAAS PR
https://github.com/webstudio-is/webstudio-saas/pull/298
(Must be renamed to "release.staging" on release to allow testing)
closes#3378
## Steps for reproduction
See fixtures now have working scripts.
Publish see saas supports script and language
https://rewrites.staging.webstudio.is/builder/f30da574-8022-433e-9a15-050792747b6f
.
## 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
Upgraded both tsx and esbuild to the latest version and removed override
for esbuild. As a result we have 5 duplicates of esbuild but they will
go away with time.