-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preview URL: https://devhubweb4.testnet.page/ Notice that the served index.html is referencing `web4browserclient.js` with a `blockHeight` parameter. The block height of the latest deployed `web4browserclient.js` is obtained to a preload call to socialdb. This ensures that the browser will always load the latest version of the script, and allow local caching as long as there are no changes. <img width="1249" alt="image" src="https://github.com/user-attachments/assets/468e78a2-7393-4fd0-9db3-e4c55ac1a6c5"> The javascript file, which is stored in socialdb, can then be loaded from this URL: https://devhubweb4.testnet.page/resources/devhub.near/web4browserclient.js?blockHeight=127582922 This will query socialdb for the latest block height of the javascript referenced in the web4 deployment, and reference the script in the served index.html. The script will also served through web4. Having the blockheight in the query string when referencing the script, ensure that it's always the latest script being loaded, but also enables caching in the browser as long as there are no changes. This is a good alternative to referencing a CDN where you often don't have the same opportunity to check which version is the latest, and also we can reduce the number of dependencies this way. Both when it comes to referencing the script, as we now only can use the web4 gateway, and also in deployment, where everything can be deployed to socialdb. Resolves #146
- Loading branch information
1 parent
7673833
commit 093e9d5
Showing
11 changed files
with
238 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
{ | ||
"image": "ghcr.io/near/near-devcontainer:latest", | ||
"features": { | ||
"ghcr.io/devcontainers/features/rust:1": {}, | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dtsvet.vscode-wasm", | ||
"rust-lang.rust-analyzer", | ||
"github.vscode-github-actions" | ||
"github.vscode-github-actions", | ||
"vadimcn.vscode-lldb" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "./.devcontainer/post-create.sh" | ||
} | ||
} |
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,6 +1,9 @@ | ||
#!/bin/bash | ||
|
||
(cd discussions && cargo near build) | ||
(cd community && cargo near build) | ||
(cd community-factory && cargo near build) | ||
cargo near build | ||
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh | ||
|
||
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh | ||
(cd discussions && cargo near build --no-docker) | ||
(cd community && cargo near build --no-docker) | ||
(cd community-factory && cargo near build --no-docker) | ||
cargo near build --no-docker |
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
Oops, something went wrong.