Commit Graph

4680 Commits

Author SHA1 Message Date
liuyi
c69e542b98
feat(server): add cache module (#4973) 2023-11-22 04:09:00 +00:00
liuyi
85bee72e6b
chore(server): remove deprecated redis manager (#4971) 2023-11-22 03:51:18 +00:00
liuyi
b7d6237c20
feat(server): add doc history support (#4970) 2023-11-22 03:31:22 +00:00
LongYinan
5f1a124b53
fix(core): add error boundary for workspace layout (#5014)
https://github.com/toeverything/AFFiNE/assets/3468483/d478bf4f-2be3-4d7d-8d94-aa95c1f74c8e
2023-11-22 09:58:33 +08:00
Peng Xiao
3839a9bd15
build(electron): asar (#4965)
Due to restrictions on how Electron package works, the `node_modules` should not be hoisted and not to use s/h-links at all. This is why we need to have two separate installs for electron and non-electron packages in the build.

Tested via the following script

```bash
#!/bin/bash

echo "step 1: clean up"
find . -name "node_modules" -prune -exec rm -rf '{}' +
# git clean -dfX
build_type=canary

echo "step 2: install web dependencies"
# firstly, build web static
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 SENTRYCLI_SKIP_DOWNLOAD=1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 HUSKY=1 yarn

echo "step 3: generate assets"
BUILD_TYPE="$build_type" yarn workspace @affine/electron generate-assets

# cleanup node_modules
find . -name "node_modules" -prune -exec rm -rf '{}' +

echo "step 4: install electron dependencies"
# install electron deps
yarn config set nmHoistingLimits workspaces
yarn config set enableScripts false
yarn config set nmMode classic
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 HUSKY=0 yarn workspaces focus @affine/electron @affine/monorepo

echo "step 5: build native"
# build native
yarn workspace @affine/native build
yarn workspace @affine/storage build

echo "step 6: build electron"
# build electron
yarn workspace @affine/electron build

echo "step 7: package electron"
# package
SKIP_GENERATE_ASSETS=1 BUILD_TYPE="$build_type" HOIST_NODE_MODULES=1 yarn workspace @affine/electron package
```
2023-11-21 17:44:30 +00:00
Peng Xiao
f33c49b27e
fix(core): hmr issue on dev (#5006)
I suspect HMR does not working properly on dev because we have multiple entries.
One relative issue: https://github.com/webpack/webpack-dev-server/issues/2792/

I think we do not need multiple entries for polyfills & plugins after all. They could be in the same chunk, and could be later optimized through splitChunks option.

`ses.ts` is changed to `ses-lockdown.ts` because `ses.ts` does not pass circular dependency check by madge. I haven't looked through the real root cause though. See https://github.com/pahen/madge/issues/355
2023-11-21 17:27:16 +00:00
Peng Xiao
615255706d
fix: invisible button should not be interactive (#5017) 2023-11-22 01:05:38 +08:00
EYHN
5e8103adbd
chore: faster lint-staged (#5013)
Co-authored-by: EYHN <13579374+EYHN@users.noreply.github.com>
2023-11-21 22:24:24 +08:00
JimmFly
f06bdd9a39
fix(core): cmdk crash when entering double quotes (#5008)
Due to a bug in the upstream repository, a temporary fix was implemented until the issue in the upstream repository is resolved.
https://github.com/pacocoursey/cmdk/issues/189
2023-11-21 12:51:22 +00:00
李华桥
00c11d40cf
v0.10.3-canary.0 2023-11-21 10:02:46 +08:00
李华桥
0f6b28fd06
c0.11.0-canary.0 2023-11-20 23:53:50 +08:00
EYHN
90c130cf15
fix(core): merge updates before push to storage (#4986) 2023-11-20 23:26:19 +08:00
EYHN
9370110cdc
feat(workspace): more status for SyncEngine (#4984) 2023-11-20 22:51:20 +08:00
EYHN
c9f1fd9649
feat(workspace): more status for SyncPeer (#4983) 2023-11-20 20:37:12 +08:00
EYHN
70e71bd43e
fix(core): make e2e more stable (#4987) 2023-11-20 20:17:30 +08:00
EYHN
899e46b1fa
fix(core): rerender (#4988) 2023-11-20 17:32:40 +08:00
dependabot[bot]
c127d449a1
chore: bump the all-cargo-dependencies group with 1 update (#4997)
Bumps the all-cargo-dependencies group with 1 update: [uuid](https://github.com/uuid-rs/uuid).

<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/uuid-rs/uuid/releases">uuid's releases</a>.</em></p>
<blockquote>
<h2>1.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>doc: fix links in v6 module by <a href="https://github.com/metalalive"><code>@​metalalive</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/714">uuid-rs/uuid#714</a></li>
<li>Stabilize UUIDv6-v8 support by <a href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/718">uuid-rs/uuid#718</a></li>
<li>Prepare for 1.6.0 release by <a href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a href="https://redirect.github.com/uuid-rs/uuid/pull/719">uuid-rs/uuid#719</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/metalalive"><code>@​metalalive</code></a> made their first contribution in <a href="https://redirect.github.com/uuid-rs/uuid/pull/714">uuid-rs/uuid#714</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/uuid-rs/uuid/compare/1.5.0...1.6.0">https://github.com/uuid-rs/uuid/compare/1.5.0...1.6.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="4609e61794"><code>4609e61</code></a> Merge pull request <a href="https://redirect.github.com/uuid-rs/uuid/issues/719">#719</a> from uuid-rs/cargo/1.6.0</li>
<li><a href="24330666ec"><code>2433066</code></a> prepare for 1.6.0 release</li>
<li><a href="9787ea1d0b"><code>9787ea1</code></a> Merge pull request <a href="https://redirect.github.com/uuid-rs/uuid/issues/718">#718</a> from uuid-rs/feat/stabilize-v6-plus</li>
<li><a href="90b0bc0a1c"><code>90b0bc0</code></a> Merge pull request <a href="https://redirect.github.com/uuid-rs/uuid/issues/714">#714</a> from metalalive/doc/fix-v6-links</li>
<li><a href="1eebe7d299"><code>1eebe7d</code></a> bump msrv to 1.60.0</li>
<li><a href="6bade3ae59"><code>6bade3a</code></a> just test lib with miri</li>
<li><a href="3df0aaa80d"><code>3df0aaa</code></a> stabilize UUIDv6-v8 support</li>
<li><a href="003dc57994"><code>003dc57</code></a> doc: fix links to timestamp module</li>
<li>See full diff in <a href="https://github.com/uuid-rs/uuid/compare/1.5.0...1.6.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uuid&package-manager=cargo&previous-version=1.5.0&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions


</details>
2023-11-20 14:43:11 +08:00
Peng Xiao
add20ec2f8
fix(core): blob key issue for cloud blob provider (#4907)
There are some resources that only exists on `/static`. Current prefix check is incorrect since it could start with `/static`
2023-11-20 14:06:24 +08:00
LongYinan
34c5e7d83d
build: remove useless source-map-loader to speedup webpack (#4910) 2023-11-20 11:04:57 +08:00
LongYinan
7f09652cca
fix(core): handle the getSession network error properly (#4909)
If network offline or API error happens, the `session` returned by the `useSession` hook will be null, so we can't assume it is not null.

There should be following changes:
1. create a page in ErrorBoundary to let the user refetch the session.
2. The `SessionProvider` stop to pull the new session once the session is null, we need to figure out a way to pull the new session when the network is back or the user click the refetch button.
2023-11-20 11:04:39 +08:00
Cats Juice
57d42bf491
refactor(core): remove all MUI related components and utilities (#4941) 2023-11-20 10:51:28 +08:00
JimmFly
4ef1f4c046
fix(core): escape cmdk value (#4947)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2023-11-20 10:49:32 +08:00
JimmFly
9bab1b5dff
feat(core): keep the latest toast showing when multiple call (#4961) 2023-11-20 10:47:09 +08:00
JimmFly
f09c717413
fix(core): adjust cmdk list scroll padding block (#4972) 2023-11-20 10:39:45 +08:00
Cats Juice
134428f38d
style(core): update pro plan card style (#4960) 2023-11-18 00:36:10 +08:00
Cats Juice
ce7a691eef
fix(component): stack notification cards expand animation (#4962) 2023-11-18 00:32:06 +08:00
EYHN
5fea0102fb
chore: add devcontainer config (#4974)
Co-authored-by: Reese <3253971+figadore@users.noreply.github.com>
2023-11-17 17:54:19 +08:00
JimmFly
ce2eeeffbe
feat(i18n): update translation (#4923) 2023-11-17 17:39:33 +08:00
EYHN
aa4c7407de
refactor: new provider (#4900) 2023-11-17 15:50:01 +08:00
liuyi
9baad36e41
fix(server): all viewers can share public link (#4968) 2023-11-17 13:48:09 +08:00
Flrande
8b2c3d4c41
chore: bump blocksuite (#4958) 2023-11-16 22:01:03 +08:00
LongYinan
703fad6a0d
ci: prevent error if rust build is cached by nx (#4951)
If Rust build was cached by nx, only the output file will be presented. The chmod command will be failed in this case like: https://github.com/toeverything/AFFiNE/actions/runs/6874496337/job/18697360212
2023-11-16 21:57:22 +08:00
Peng Xiao
791eb75ca8
fix(infra): page id compat fix for page ids in workspace.meta (#4950)
since we strip `page:` in keys of workspacedoc.spaces, we should also strip the prefix in meta.pages as well.
2023-11-16 21:57:17 +08:00
JimmFly
ddd7cab414
feat(core): support share edgeless mode (#4856)
Close #3287

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at d3fdf86</samp>

### Summary
📄🚀🔗

<!--
1.  📄 - This emoji represents the page and edgeless modes of sharing a page, as well as the GraphQL operations and types related to public pages.
2.  🚀 - This emoji represents the functionality of publishing and revoking public pages, as well as the confirmation modal and the notifications for the user.
3.  🔗 - This emoji represents the sharing URL and the query parameter for the share mode, as well as the hooks and functions that generate and use the URL.
-->
This pull request adds a feature to the frontend component of AFFiNE that allows the user to share a page in either `page` or `edgeless` mode, which affects the appearance and functionality of the page. It also adds the necessary GraphQL operations, types, and schema to support this feature in the backend, and updates the tests and the storybook stories accordingly.

*  Modify the `useIsSharedPage` hook to accept an optional `shareMode` argument and use the `getWorkspacePublicPagesQuery`, `publishPageMutation`, and `revokePublicPageMutation` from `@affine/graphql`
2023-11-15 16:02:58 +08:00
LongYinan
e7e617a791
chore: change default branch to canary (#4948) 2023-11-15 07:46:50 +00:00
LongYinan
cc2ade601c
ci: only disable postinstall on macOS in nightly desktop build (#4938) 2023-11-14 23:03:49 +08:00
Joooye_34
ea4f5ffc83
fix(infra): workspace migration without blockVersions (#4936) 2023-11-14 23:03:40 +08:00
Peng Xiao
9ac8a32e00
perf(component): use png instead of svg for rendering noise svg (#4935) 2023-11-14 23:03:19 +08:00
DarkSky
8d55e5cdf9
fix: change password token check (#4934) (#4932) 2023-11-14 23:03:01 +08:00
LongYinan
8bcc886b46
ci: disable postinstall in nightly desktop build (#4930)
Should be part of https://github.com/toeverything/AFFiNE/pull/4885
2023-11-14 14:45:52 +08:00
Peng Xiao
f9971ba922
fix(core): change server url of stable to insider (#4902) (#4926) 2023-11-14 14:40:06 +08:00
LongYinan
5b0b8cf216
test(e2e): add subdoc migration test (#4921)
test(e2e): add subdoc migration test

fix: remove .only
2023-11-14 14:39:59 +08:00
Peng Xiao
16488d594c
fix(infra): compatibility fix for space prefix (#4912)
It seems there are some cases that [this upstream PR](https://github.com/toeverything/blocksuite/pull/4747) will cause data loss.

Because of some historical reasons, the page id could be different with its doc id.
It might be caused by subdoc migration in the following (not 100% sure if all white screen issue is caused by it) 0714c12703/packages/common/infra/src/blocksuite/index.ts (L538-L540)

In version 0.10, page id in spaces no longer has prefix "space:"
The data flow for fetching a doc's updates is:
- page id in `meta.pages` -> find `${page-id}` in `doc.spaces` -> `doc` -> `doc.guid`
if `doc` is not found in `doc.spaces`, a new doc will be created and its `doc.guid` is the same with its pageId
- because of guid logic change, the doc that previously prefixed with `space:` will not be found in `doc.spaces`
- when fetching the rows of this doc using the doc id === page id,
  it will return EMPTY since there is no updates associated with the page id

The provided fix in the PR will patch the `spaces` field of the root doc so that after 0.10 the page doc can still be found in the `spaces` map. It shall apply to both of the idb & sqlite datasources.

Special thanks to @lawvs 's db file for investigation!
2023-11-14 14:39:50 +08:00
liuyi
c44a9a4903
fix(server): wrap updates applying in a transaction (#4922) 2023-11-14 14:39:39 +08:00
Peng Xiao
76b585d1ef
fix(storybook): page tags display (#4924) 2023-11-14 09:45:12 +08:00
dependabot[bot]
993974d20d
chore: bump the all-cargo-dependencies group with 5 updates (#4918)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 16:01:07 +08:00
LongYinan
f17c0e1268
Merge pull request #4915 from toeverything/chore/hotfix-back-to-master
fix: cherry pick hotfix back to master
2023-11-13 10:12:06 +08:00
Whitewater
eded501123
fix: get page preview based on block order (#4888)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-11-12 15:09:57 +00:00
DarkSky
ac3756ea23
chore: cleanup deployment 2023-11-12 11:22:21 +08:00
forehalo
dc8e84df31
fix(server): increase server acceptable websocket payload size 2023-11-12 11:22:00 +08:00