-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge in main because rebasing is a pain
- Loading branch information
Showing
86 changed files
with
4,495 additions
and
7,491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import { App } from "./App"; | ||
import { Repo } from "@automerge/automerge-repo"; | ||
import { BroadcastChannelNetworkAdapter } from "@automerge/automerge-repo-network-broadcastchannel"; | ||
import { RepoContext } from "@automerge/automerge-repo-react-hooks"; | ||
import { v4 } from 'uuid' | ||
import React from "react" | ||
import ReactDOM from "react-dom/client" | ||
import { App } from "./App" | ||
import { Repo, isValidAutomergeUrl } from "@automerge/automerge-repo" | ||
import { BroadcastChannelNetworkAdapter } from "@automerge/automerge-repo-network-broadcastchannel" | ||
import { RepoContext } from "@automerge/automerge-repo-react-hooks" | ||
import { v4 } from "uuid" | ||
import { IndexedDBStorageAdapter } from "@automerge/automerge-repo-storage-indexeddb" | ||
|
||
const repo = new Repo({ | ||
storage: new IndexedDBStorageAdapter("use-awareness-example"), | ||
network: [ | ||
new BroadcastChannelNetworkAdapter() | ||
], | ||
}); | ||
network: [new BroadcastChannelNetworkAdapter()], | ||
}) | ||
|
||
const userId = v4(); | ||
const userId = v4() | ||
|
||
const rootDocUrl = `${document.location.hash.substring(1)}` | ||
const handle = isValidAutomergeUrl(rootDocUrl) | ||
? repo.find(rootDocUrl) | ||
: repo.create() | ||
|
||
const docUrl = (document.location.hash = handle.url) | ||
|
||
window.handle = handle // we'll use this later for experimentation | ||
window.repo = repo | ||
|
||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
<RepoContext.Provider value={repo}> | ||
<React.StrictMode> | ||
<App userId={userId} /> | ||
<App userId={userId} url={docUrl} /> | ||
</React.StrictMode> | ||
</RepoContext.Provider> | ||
); | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react-swc' | ||
import wasm from 'vite-plugin-wasm' | ||
import topLevelAwait from 'vite-plugin-top-level-await' | ||
import { defineConfig } from "vite" | ||
import react from "@vitejs/plugin-react-swc" | ||
import wasm from "vite-plugin-wasm" | ||
import topLevelAwait from "vite-plugin-top-level-await" | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
react(), | ||
wasm(), | ||
topLevelAwait() | ||
], | ||
plugins: [react(), wasm(), topLevelAwait()], | ||
worker: { | ||
plugins: () => [ | ||
wasm(), | ||
topLevelAwait() | ||
] | ||
} | ||
}); | ||
plugins: () => [wasm(), topLevelAwait()], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"useNx": true, | ||
"npmClient": "pnpm", | ||
"useWorkspaces": true, | ||
"version": "1.1.2" | ||
"version": "1.1.4" | ||
} |
Oops, something went wrong.