Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Quickstart Apps with New Init flow #46

Merged
merged 33 commits into from
Mar 20, 2025
Merged

Conversation

skylerjokiel
Copy link
Collaborator

@skylerjokiel skylerjokiel commented Mar 3, 2025

This more complex flow is required for our new Self-hosted model on the BP side.

❗Note: This change also requires coordination with the Docs to update the Configure Ditto section of the Quickstarts.

Apps

  • Swift
  • android-cpp
  • android-java
  • android-kotlin
  • cpp-tui
  • dotnet-maui
  • dotnet-tui
  • flutter_app
  • javascript-tui
  • javascript-web
  • react-native
  • rust-tui

@biozal biozal self-requested a review March 3, 2025 19:42
@biozal
Copy link
Contributor

biozal commented Mar 3, 2025

added Kotlin support - ran locally and app still works after changes.

@biozal
Copy link
Contributor

biozal commented Mar 3, 2025

Updated to include Android Java and Rust

biozal added 2 commits March 3, 2025 15:48
…it breaks Javascript which reads in the file and assumes Ditto is the prefix for all environment values
@biozal
Copy link
Contributor

biozal commented Mar 3, 2025

Update: I've updated the Swift and Sample file because Javascript needs the prefix DITTO in front of all values in the env file in order to read them. This will make all values in the .env file consistent.

Copy link
Collaborator Author

@skylerjokiel skylerjokiel left a comment

Choose a reason for hiding this comment

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

Some small nits.

biozal and others added 5 commits March 3, 2025 17:14
…ickstart/tasks/TasksApplication.kt

Co-authored-by: Skyler Jokiel <skjokiel@microsoft.com>
Co-authored-by: Skyler Jokiel <skjokiel@microsoft.com>
Co-authored-by: Skyler Jokiel <skjokiel@microsoft.com>
Co-authored-by: Skyler Jokiel <skjokiel@microsoft.com>
@biozal
Copy link
Contributor

biozal commented Mar 3, 2025

Some small nits.

Cleaned up.

@biozal
Copy link
Contributor

biozal commented Mar 18, 2025

Updated .NET to 4.10 and customUrl

@biozal
Copy link
Contributor

biozal commented Mar 19, 2025

Updated Android CPP and CPP Tui.

@biozal
Copy link
Contributor

biozal commented Mar 19, 2025

This is now ready for review.

Copy link
Collaborator

@nicholastmosher nicholastmosher left a comment

Choose a reason for hiding this comment

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

I didn't try building anything, but I did a visual check of the following quickstarts and they all look good to me ✅

  • android-java
  • flutter_app
  • javscript-tui
  • javascript-web
  • react-native
  • rust-tui

I'd recommend somebody else check on the others:

  • android-cpp
  • android-kotlin
  • cpp-tui
  • dotnet-maui
  • dotnet-tui
  • swift

Copy link
Collaborator Author

@skylerjokiel skylerjokiel left a comment

Choose a reason for hiding this comment

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

Looks good to me. Added some nits.

@biozal
Copy link
Contributor

biozal commented Mar 20, 2025

All comments were resolved - comments were added to explain disabling cloud sync.

@biozal biozal self-assigned this Mar 20, 2025
@biozal biozal added the enhancement New feature or request label Mar 20, 2025
@biozal biozal requested a review from nicholastmosher March 20, 2025 13:13
Copy link
Collaborator

@kristopherjohnson kristopherjohnson left a comment

Choose a reason for hiding this comment

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

I made comments about a couple of nits, but didn't see anything that should prevent merging.

For the C++ code, I've been using clang-format to provide consistent formatting for all the C++ files. There is a make format target in each of the Makefiles for C++ projects that will apply it. Arguably, clang-format's default style is not easily readable for tutorial-style code, so maybe we could tweak the style for this repo, but I'd like to keep auto-formatting code in this repo if we can.

@biozal biozal merged commit 912643f into main Mar 20, 2025
3 checks passed
@biozal biozal deleted the update-initialization branch March 20, 2025 18:18
Comment on lines +70 to +73
const transportConfig = new TransportConfig();
transportConfig.connect.websocketURLs.push(websocketURL);
transportConfig.setAllPeerToPeerEnabled(true);
ditto.setTransportConfig(transportConfig);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not using ditto.updateTransportConfig()? This has some implications because TransportConfig has different defaults than Ditto.transportConfig and I thought our guidance had been to use updateTransportConfig() in general. @skylerjokiel

Choose a reason for hiding this comment

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

Yep, always use updateTransportConfig().

Comment on lines +21 to +27
// Set the Ditto Websocket URL
var config = DittoTransportConfig()
config.connect.webSocketURLs.insert(Env.DITTO_WEBSOCKET_URL)

// Enable all P2P transports
config.enableAllPeerToPeer()
ditto.transportConfig = config
Copy link

@konstantinbe konstantinbe Mar 21, 2025

Choose a reason for hiding this comment

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

As pointed out by @pvditto, this should be using updateTransportConfig():

Suggested change
// Set the Ditto Websocket URL
var config = DittoTransportConfig()
config.connect.webSocketURLs.insert(Env.DITTO_WEBSOCKET_URL)
// Enable all P2P transports
config.enableAllPeerToPeer()
ditto.transportConfig = config
// Add the Ditto Websocket URL
ditto.updateTransportConfig { transportConfig in
transportConfig.connect.webSocketURLs.insert(Env.DITTO_WEBSOCKET_URL)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants