Skip to content

Add offline web app demo (#9542)#9543

Merged
yasmoradi merged 5 commits intobitfoundation:developfrom
yasmoradi:release
Dec 25, 2024
Merged

Add offline web app demo (#9542)#9543
yasmoradi merged 5 commits intobitfoundation:developfrom
yasmoradi:release

Conversation

@yasmoradi
Copy link
Member

@yasmoradi yasmoradi commented Dec 25, 2024

closes #9542

Summary by CodeRabbit

  • New Features

    • Introduced new jobs for deploying Blazor WebAssembly applications with AOT compilation and offline database support.
    • Added new entries in the README for showcased applications, including AOT Compiled PWA and a smaller version of the Todo demo app.
  • Bug Fixes

    • Simplified project setup for Windows by removing the --offlineDb option from the workflow.
  • Documentation

    • Updated README to include new hosting details and enhance clarity on application deployment and capabilities.

@yasmoradi yasmoradi requested a review from msynk December 25, 2024 13:56
@coderabbitai
Copy link

coderabbitai bot commented Dec 25, 2024

Walkthrough

The pull request introduces modifications to GitHub Actions workflow files for Admin and Todo Sample projects, along with updates to the README.md. The changes focus on enhancing deployment configurations, introducing Ahead-of-Time (AOT) compilation for Blazor WebAssembly, and adding new deployment variations for the Todo application. The README.md is updated to reflect these new deployment options and showcase the expanded capabilities of the bitplatform applications.

Changes

File Change Summary
.github/workflows/admin-sample.cd.yml Removed --offlineDb option from Windows hybrid build job
.github/workflows/todo-sample.cd.yml - Renamed deploy_blazor_wasm_standalone to deploy_blazor_wasm_standalone_aot
- Added AOT compilation parameter
- Introduced three new deployment jobs for different configurations
README.md - Added descriptions for AOT, smaller, and offline database Todo app versions
- Updated hosting details for applications
- Added new application links and descriptions

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant Boilerplate as Project Boilerplate
    participant Build as Build Process
    participant Deploy as Deployment Target

    GHA->>Boilerplate: Create Project
    Boilerplate-->>GHA: Project Created
    GHA->>Build: Configure Build Parameters
    alt AOT Compilation
        Build->>Build: Apply AOT Compilation
    end
    Build->>Deploy: Publish Application
    Deploy-->>GHA: Deployment Complete
Loading

Poem

🐰 Workflows dancing, configs so bright,
AOT compilation takes its flight!
Blazor builds with newfound might,
Smaller, offline, a coder's delight
Deployment magic, pure and light! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
README.md (1)

51-54: Fix hyphenation in "Todo" and consider adding deployment details.

  1. For consistency, consider hyphenating "Todo" to "To-do" in the application names.
  2. Consider adding brief descriptions of the key features/benefits of each variation to help users choose the appropriate version.

Apply this diff to fix the hyphenation:

-7. [todo-aot.bitplatform.cc](https://todo-aot.bitplatform.cc): .NET 9 Todo demo app
+7. [todo-aot.bitplatform.cc](https://todo-aot.bitplatform.cc): .NET 9 To-do demo app
-8. [todo-small.bitplatform.cc](https://todo-small.bitplatform.cc): .NET 9 Todo demo app
+8. [todo-small.bitplatform.cc](https://todo-small.bitplatform.cc): .NET 9 To-do demo app
-9. [todo-offline.bitplatform.cc](https://todo-offline.bitplatform.cc): .NET 9 Todo demo app
+9. [todo-offline.bitplatform.cc](https://todo-offline.bitplatform.cc): .NET 9 To-do demo app
🧰 Tools
🪛 LanguageTool

[grammar] ~53-~53: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...ps://todo-small.bitplatform.cc): .NET 9 Todo demo app with smaller download footprin...

(TO_DO_HYPHEN)


[grammar] ~54-~54: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...://todo-offline.bitplatform.cc): .NET 9 Todo demo app with ef-core & sqlite (Azure s...

(TO_DO_HYPHEN)

.github/workflows/todo-sample.cd.yml (2)

171-217: Consider adding offline sync configuration.

The offline database deployment looks good, but consider adding configuration for offline sync strategy (e.g., conflict resolution, sync intervals).

Would you like me to provide an example configuration for offline sync settings?

🧰 Tools
🪛 yamllint (1.35.1)

[error] 176-176: trailing spaces

(trailing-spaces)


[error] 179-179: trailing spaces

(trailing-spaces)


[error] 191-191: trailing spaces

(trailing-spaces)


[error] 193-193: trailing spaces

(trailing-spaces)


[error] 203-203: trailing spaces

(trailing-spaces)


[warning] 205-205: too many spaces after colon

(colons)


[error] 206-206: trailing spaces

(trailing-spaces)


[error] 209-209: trailing spaces

(trailing-spaces)


218-263: Fix YAML formatting issues.

The job configuration has several formatting issues:

  • Trailing spaces
  • Inconsistent spacing after colons

Additionally, consider documenting the optimization techniques used for the smaller build footprint (e.g., tree shaking, compression).

🧰 Tools
🪛 yamllint (1.35.1)

[error] 223-223: trailing spaces

(trailing-spaces)


[error] 226-226: trailing spaces

(trailing-spaces)


[error] 238-238: trailing spaces

(trailing-spaces)


[error] 240-240: trailing spaces

(trailing-spaces)


[error] 250-250: trailing spaces

(trailing-spaces)


[warning] 252-252: too many spaces after colon

(colons)


[error] 253-253: trailing spaces

(trailing-spaces)


[error] 256-256: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5dd42e9 and d75d655.

📒 Files selected for processing (3)
  • .github/workflows/admin-sample.cd.yml (1 hunks)
  • .github/workflows/todo-sample.cd.yml (2 hunks)
  • README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~53-~53: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...ps://todo-small.bitplatform.cc): .NET 9 Todo demo app with smaller download footprin...

(TO_DO_HYPHEN)


[grammar] ~54-~54: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...://todo-offline.bitplatform.cc): .NET 9 Todo demo app with ef-core & sqlite (Azure s...

(TO_DO_HYPHEN)

🪛 yamllint (1.35.1)
.github/workflows/todo-sample.cd.yml

[error] 176-176: trailing spaces

(trailing-spaces)


[error] 179-179: trailing spaces

(trailing-spaces)


[error] 191-191: trailing spaces

(trailing-spaces)


[error] 193-193: trailing spaces

(trailing-spaces)


[error] 203-203: trailing spaces

(trailing-spaces)


[warning] 205-205: too many spaces after colon

(colons)


[error] 206-206: trailing spaces

(trailing-spaces)


[error] 209-209: trailing spaces

(trailing-spaces)


[error] 223-223: trailing spaces

(trailing-spaces)


[error] 226-226: trailing spaces

(trailing-spaces)


[error] 238-238: trailing spaces

(trailing-spaces)


[error] 240-240: trailing spaces

(trailing-spaces)


[error] 250-250: trailing spaces

(trailing-spaces)


[warning] 252-252: too many spaces after colon

(colons)


[error] 253-253: trailing spaces

(trailing-spaces)


[error] 256-256: trailing spaces

(trailing-spaces)

🔇 Additional comments (3)
README.md (1)

47-50: LGTM! Clear documentation of deployment configurations.

The deployment configurations are well documented with clear hosting details (Azure Web App + Cloudflare CDN).

.github/workflows/admin-sample.cd.yml (1)

189-189: Verify the impact of removing offline database support.

The removal of the --offlineDb option from the Windows build might affect users who rely on offline capabilities in the admin sample.

Run the following script to check for offline database dependencies:

✅ Verification successful

Offline database support is being moved to a separate deployment

Based on the verification results, the removal of --offlineDb from admin-sample.cd.yml is intentional and aligns with the repository's structure:

  • The offline database functionality still exists in the boilerplate templates and core components (Bit.Boilerplate and related files)
  • In todo-sample.cd.yml, offline database deployment has been moved to a separate workflow job deploy_blazor_wasm_standalone_offlineDb
  • This change represents a deployment strategy shift rather than a removal of the feature itself

This change improves deployment flexibility by allowing offline database support to be managed independently, similar to how it's now handled in the todo sample.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for offline database usage in the admin sample

# Check for offline database related code
rg -l "IndexedDb|SQLite" "AdminPanel/src/"

# Check for offline database configuration
rg -l "offlineEnabled|UseOfflineDb" "AdminPanel/src/"

Length of output: 208


Script:

#!/bin/bash
# Let's first find the correct paths in the repository
fd -t d "AdminPanel"

# Search for offline database related terms in the entire repository
rg -l "IndexedDb|SQLite|offlineEnabled|UseOfflineDb"

# Search for offline database related configuration in workflow files
rg "offlineDb" .github/workflows/

Length of output: 1664

.github/workflows/todo-sample.cd.yml (1)

Line range hint 124-170: LGTM! Well-configured AOT compilation setup.

The AOT compilation job is properly configured with the necessary build parameters:

  • Uses -p:RunAOTCompilation=true for AOT compilation
  • Disables multilingual support to reduce size
  • Deploys to a dedicated static web app

@yasmoradi yasmoradi merged commit 44afd49 into bitfoundation:develop Dec 25, 2024
@yasmoradi yasmoradi deleted the release branch December 25, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline web app demo is missing

1 participant