Commit Graph
21 Commits
Author SHA1 Message Date
Bogdan Chadkin 1b0fc0eadc refactor: move builder data loading to client side (#3464)
To synchronize data between tabs it should be consistent and be easily
accessible. Loading from server creates huge latency and data can be
changed by loading from another tab.

Here moved data loading to client side so it can be shared through
IndexedDB.

Added new `/rest/data/:buildId` endpoint and defined global setter and
getter for current state.
2024-06-01 14:46:29 +03:00
Bogdan Chadkin 45fdd6404c experimental: save path in history when navigate with link (#3381)
Here improved history support. Now navigating with links from preview
adds paths into page history. This will let to reach same page without
switching to the list of posts.
2024-05-19 14:35:25 +03:00
Oleg Isonen 8e2e07ea23 feat: Allow selecting a nested path for link href (#2773)
Ref https://github.com/webstudio-is/webstudio/issues/404

## Description

- can select a nested path for link pages
- can click in preview to get to the page

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @TrySound , 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
2024-01-17 19:02:41 +01:00
Oleg Isonen 65d0df8213 feat: Nested routes compiler (#2766)
Ref https://github.com/webstudio-is/webstudio/issues/404

## Description

- generate remix app with nested routes

## Steps for reproduction

1. create nested routes 
2.  generate app using cli

## Code Review

- [ ] hi @istarkov , 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
2024-01-16 17:03:54 +01:00
Oleg Isonen b2bf220ed6 chore: Rename all *Store to $store (#2747)
## Description

Pure renaming, nothing else.

## Code Review

- [ ] hi @TrySound , 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
2024-01-09 13:32:51 +01:00
Bogdan Chadkin 4928661d9a refactor: drop react wrappers from auth stores (#2366)
Similar to https://github.com/webstudio-is/webstudio/pull/2365

Here migrated auth permit and auth token to direct access and renamed
them according to new convention.
2023-09-25 18:12:11 +04:00
Bogdan Chadkin 63f597225b refactor: drop react wrapper from preview mode store (#2365)
Nanostore react wrappers in many cases introduce additional renders
because of subscription even when only store.set is used. Searching for
references become complicated because we have both direct store access
and react wrapper.

Here migrated to use direct store access for preview mode store and
renamed it to $previewMode according to new convention.
2023-09-25 17:11:31 +04:00
Bogdan Chadkin 5794e8d1e7 Move app schema to sdk (#2237)
We are planning to decouple cli from prisma and all unrelated packages.
Here moved whole app schema into sdk package.
2023-09-03 22:27:30 +04:00
Ivan Starkov 97f0cc00d7 use useMount instead of sync once (#1937)
## Description

useSyncInitializeOnce is incompatibel with modern React especially in
dev mode.
useUnmount can't be used with it and any hooks with cleanup would give
the same issue.

Should affect only devmode
2023-07-15 14:02:43 +03:00
Ivan StarkovandOleg Isonen 7632b05fe7 Fix hash scroll (#1861)
## Description

closes #1824

- [x] single edgecase left if id is equal to `hello%20world` nothing
works
- [x] fix back button cause chrome bug
https://discord.com/channels/955905230107738152/1122839004375691355
- [x] allow edit form in preview mode to close issue above

Fix corresponding issue in RR
https://github.com/remix-run/react-router/pull/10642

At SaaS patched too

## Steps for reproduction

create links on pages with anchor
<img width="254" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/46a880f3-cdd0-4e19-8cb4-b608bdc4f96a">

Check it works

## 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

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-06-28 10:06:54 +04:00
Ivan Starkov 1a21c4d3c3 Fix preview mode toggle and sync (#1865)
## Description

closes #1841

## 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
2023-06-28 10:05:07 +04:00
Ivan Starkov cba00105db Sync pages change (#1856)
## Description

Changed pages synchronisation.

We had following path on link click in canvas:

- We intercept it in handleLinkClick and do publish('switchPage', {});
- We subscribe on 'switchPage' at builder and do navigate(builderPath, {
pageId});
- We subscribe on useSearchParams extract from there pageId and do
selectedPageIdStore.set(pageId)
- On Canvas we subscribe on selectedPageStore and finally render the
page

Now we just change
`selectedPageHashStore`, `selectedPageIdStore` in a single function
`switchPage`
`location.searchParams` used only for initial and popstate
synchronisation.


pageHashStore added for future use, no logic now.



## 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
2023-06-26 10:22:13 +04:00
Roman Pominov 68243c6876 Assets copy-paste (#1636)
## Description

1. Closes #1325
2. Assets used in styles are copied
3. Assets used in props are copied
2023-05-16 14:34:42 +03:00
Bogdan Chadkin 6c57597b6c Reset selected instance on page manipulation (#1494)
Forced reset when page is created, deleted or navigated. Selected
instance should be reset to avoid manipulation from another page.
2023-04-20 10:54:02 +07:00
Bogdan Chadkin 919d560396 Delete pages with stores (#1289)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1084

Now whole pages management is managed by immerhin patches. Got rid of
pages/$projectId endpoint and no longer used form utils.
2023-03-25 18:56:24 +07:00
Bogdan Chadkin 92342a22a4 Update pages with store (#1288)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1084
https://github.com/webstudio-is/webstudio-builder/issues/1286

Currently only create page patches propagate to canvas. Here migrated
update to immerhin too.
2023-03-25 11:35:15 +07:00
Roman Pominov 4b1a6847a4 Refactor link behaviour in preview (#1237)
## Description

- Removed Link wrapper that used to apply `preserveBuildParams` (part 1
of #1120)
- Removed `preserveBuildParams` completely, because we no longer need it
as we request page switch instead of letting link to navigate
- Removed `mode` parameter from BuildParams, because it's always "edit"
now
- Fixes #1231

## Steps for reproduction

1. Open preview mode
2. Click on some links
2023-03-14 18:06:24 +03:00
Bogdan Chadkin 25d30967aa Create page on client (#1232)
Newly created instance does not propagate to client because we no longer
reload on navigating to new page.

Here moved page and root instance creation to client with patches.
2023-03-13 18:42:26 +03:00
Roman Pominov 8259b42d35 Fix page settings (#1085)
## Description

Fixes #1061 .

## Steps for reproduction

- Try to rename page title or page name
- It should not revert back in few seconds
2023-02-20 20:11:44 +03:00
Bogdan Chadkin 7bd744c7d9 Move pages schema to project-build (#1040)
We are moving all build related code from project to project-build. Here
moved pages schema and Build type.
2023-02-15 22:46:57 +03:00
Andras Bacsai ac413cdd5f rename designer to builder 2023-02-14 11:15:24 +01:00