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.
Monorepo setup for storybook is very complicated, it has two major
problems
- it is very annoying to look for any link in commit status
- hard to upgrade comparing with single project setup
Here merged all storybooks into one in the root.
## Description
To have --force
## 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
Add simple protection against non js and jsdom bots
Idea is to add hidden js generated field on submit, and check that
matchMedia is working.
## Steps for reproduction
Go here
https://saas-form-rdlrc.wstd.work/
then check via curl
```bash
curl 'https://saas-form-rdlrc.wstd.work/?index=&_data=routes%2F_index' \
-H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
-H 'referer: https://saas-form-rdlrc.wstd.work/' \
--data-raw 'ws--form-id=2TIgyB2vQViDMitiYiGSK&name=wewe&email=wewe&ws--form-bot=18f72a6'
curl 'https://saas-form-rdlrc.wstd.work/?index=&_data=routes%2F_index' \
-H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
-H 'referer: https://saas-form-rdlrc.wstd.work/' \
--data-raw 'ws--form-id=2TIgyB2vQViDMitiYiGSK&name=wewe&email=wewe'
curl 'https://saas-form-rdlrc.wstd.work/?index=&_data=routes%2F_index' \
-H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
-H 'referer: https://saas-form-rdlrc.wstd.work/' \
--data-raw 'ws--form-id=2TIgyB2vQViDMitiYiGSK&name=wewe&email=wewe&ws--form-bot=jsdom'
```
## 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
Turns out no-internal-imports did not forbid anything out of the box but
requires specifying specific folders to forbid. This does not scale well
and this rule mostly harms because requires either excluding each
package with submodules or suppressing it with comment.
Ref https://github.com/webstudio-is/webstudio/issues/2903
Here added support for new `<ws:descendent />` component. It allows to
style any children or descendents of components. Primary usage is for
embed content which renders html and need to style tags.
Descendent component accepts "selector" prop which can be suffix like `
img`, ` .image` or `::first-child` pseudo-element.
Potentially it could be used as tag styling for any element.
Can be tested in any element by dropping "Descendent" component from
"internal" category.