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

Feature Branch for Consolidated SDK Docs #3255

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
4498f2f
Scaffold ToC for consolidated SDK docs
dacharyc May 7, 2024
d308023
Update landing page and add missing placeholder pages
dacharyc May 7, 2024
95361c0
Remove 'Swift' reference from landing page
dacharyc May 7, 2024
760a9ed
Add IoT
dacharyc May 7, 2024
9c249f6
Add test and debug section, move logging into new section
dacharyc May 7, 2024
3f5e7a0
Partial Create page as PoC
dacharyc May 8, 2024
6c255ff
Delete Java API reference to make build errors easier to parse
dacharyc May 8, 2024
ca4d1bf
Fix includes file naming
dacharyc May 8, 2024
1a9a3dd
Fix build errors
dacharyc May 8, 2024
7996661
Provide examples to copy for easier implementation
dacharyc May 8, 2024
12149ed
Add consolidated page example
dacharyc May 8, 2024
43d6c79
Consolidate and rename code example placeholders
dacharyc May 9, 2024
4da6ed0
Add missing serialization & threading pages
dacharyc May 13, 2024
971dfd3
Add release notes, fix API reference issues
dacharyc May 13, 2024
b59b8d5
Add a placeholder page for live vs. frozen objects
dacharyc May 13, 2024
4528af3
Move temp files out of source and resolve build errors
dacharyc May 15, 2024
db143e6
Fix remaining build errors
dacharyc May 15, 2024
6ae1805
Add meta and facet values to the page template
dacharyc May 20, 2024
39b1564
DOCSP-39161 .NET updateBaseURL (#3246)
lindseymoore May 20, 2024
643a481
Add new IDs to templates, add new Java Kotlin placeholders
dacharyc May 22, 2024
a0659fc
(DOCSP-39539): Consolidate Stream Data to Atlas page (#3268)
dacharyc May 24, 2024
97d3e5b
(DOCSP-39540) Consolidate Partition-Based Sync page (#3279)
dacharyc Jun 4, 2024
8ee6c6b
(DOCSP-39501): Consolidate Quick Start page (#3280)
dacharyc Jun 18, 2024
c33fc22
(DOCSP-39525): Consolidate Create and Delete Users page (#3289)
dacharyc Jun 18, 2024
7cf0f51
(DOCSP-39526): Consolidate Authenticate Users page (#3281)
dacharyc Jun 18, 2024
bfa23dd
(DOCSP-26313): Swift: Add a Handle Sync Errors page for SwiftUI (#2524)
dacharyc May 17, 2024
b8d909b
DOCSP-39161 .NET updateBaseURL (#3246)
lindseymoore May 20, 2024
a3d9c9a
Review comments for DOCSP-39161 .NET baseurl (#3267)
lindseymoore May 23, 2024
6a10d8b
Add C++ template app and tutorial to SDK docs (#3263)
dacharyc May 17, 2024
ba89df7
Realm Java cannot use RealmAny in new apps (#3274)
kneth May 24, 2024
dd89a55
DOCSP-40104: Fixed typo in read.txt (#3284)
osharaf-mdb Jun 5, 2024
5a50133
DOCSP-36167: Update .NET compatibility with note on source generator …
cbullinger Jun 11, 2024
96b31f0
(DOCSP-40014): Update Swift 'static' framework install instructions (…
dacharyc Jun 11, 2024
6ca5b90
DOCSP-39924: Update eligible SDKs with collections in mixed info (#3293)
cbullinger Jun 17, 2024
a51fffb
DOCSP-40232 formatting typo (#3294)
osharaf-mdb Jun 12, 2024
227206b
Create netlify.toml (#3309)
branberry Jun 24, 2024
3b7abbe
Merge branch 'feature-consolidated-sdk-docs' into master
dacharyc Jun 24, 2024
22a4cb8
Remove misplaced .NET file
dacharyc Jun 24, 2024
451b40f
DOCSP-16785 the the typo (#3297)
osharaf-mdb Jun 25, 2024
569a50d
(DOCSP-39541) Consolidate logging page (#3273)
krollins-mdb Jun 25, 2024
ae0e146
(DOCSP-39513): Consolidate Create page (#3270)
dacharyc Jun 25, 2024
b9d858c
(DOCSP-39538): Consolidate Manage Sync Sessions page (#3285)
dacharyc Jun 25, 2024
c607575
Merge branch 'master' into feature-consolidated-sdk-docs
dacharyc Jun 25, 2024
1021196
(DOCSP-39536): Consolidate Write Data to a Synced Database page (#3286)
dacharyc Jul 11, 2024
81be17c
(DOCSP-39503): Consolidate Relationships page (#3287)
dacharyc Jul 12, 2024
ebc8e9d
(DOCSP-39502): Consolidate Define an Object Model page (#3314)
dacharyc Jul 19, 2024
9cd2167
DOCSP-36298 : Refactor RQL for JSv12 (#3266)
cbullinger Jul 19, 2024
f8eb607
(DOCSP-39530): Consolidate Multi-User Applications page (#3323)
dacharyc Jul 19, 2024
bca55ae
Merge branch 'master' into feature-consolidated-sdk-docs
dacharyc Jul 19, 2024
07d21c7
Don't run Java tests in CI anymore, but keep the workflows just in case
dacharyc Jul 19, 2024
78520c0
Fix build error related to changed ref target
dacharyc Jul 19, 2024
c63b55c
(DOCSP-41633): Consolidation: Incorporate Counter and Progress Notifi…
dacharyc Jul 22, 2024
e7fa389
(DOCSP-39523): Consolidate Call a Function page (#3322)
dacharyc Jul 23, 2024
fc3abb9
(DOCSP-41466): Create: Use third-party libraries for some C# operatio…
dacharyc Jul 30, 2024
7f294fe
(DOCSP-39500): Consolidate Install page (#3326)
dacharyc Jul 31, 2024
6411c1c
(DOCSP-39535): Consolidate Manage Sync Subscriptions page (#3320)
dacharyc Aug 1, 2024
d492af4
(DOCSP-42045): Fix wrong C++ tab ID (#3353)
dacharyc Aug 1, 2024
6835ea9
(DOCSP-39527): Consolidate Custom User Data page (#3346)
dacharyc Aug 6, 2024
8f7001a
(DOCSP-39516): Consolidate Delete page (#3336)
dacharyc Aug 6, 2024
08af422
(DOCSP-39519): Port Swift Filter Data page for consolidated docs (#3349)
dacharyc Aug 8, 2024
6ffd8b5
(DOCSP-39531): Consolidate Link User Identities page (#3350)
dacharyc Aug 8, 2024
c2b6210
Consolidation Providers and Hooks (#3356)
osharaf-mdb Aug 9, 2024
ccb45ee
(DOCSP-39546): Port SwiftUI content for consolidated docs (#3365)
dacharyc Aug 16, 2024
ad32aa9
(DOCSP-39514): Consolidate Read page (#3357)
dacharyc Aug 16, 2024
c92d7f9
(DOCSP-39533): Consolidate Add Sync to an App page (#3351)
dacharyc Aug 16, 2024
3c38bc1
(DOCSP-39528): Consolidate User Metadata page (#3344)
dacharyc Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ Prepare docs for C++ GA release, including:
- Model Data
- Define an Object Model: Update info for C# nullable reference types and nullable-aware context, add a Bluehawked code example
- Data Binding: Move a section about data binding and MVVM from Define an Object Model to Data Binding page
- React to Changes: Add a callout with info about binding data to the UI and a link to the the Data Binding page
- React to Changes: Add a callout with info about binding data to the UI and a link to the Data Binding page

## Node.js SDK

Expand Down
25 changes: 11 additions & 14 deletions examples/dotnet/Examples/Asymmetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ namespace Examples
{
public partial class Asymmetrics
{
App app;
Realms.Sync.User user;
Realm realm;
const string myRealmAppId = Config.FSAppId;
const string myAppId = Config.FSAppId;

[OneTimeSetUp]
public void Setup()
{
app = App.Create(myRealmAppId);
user = app.LogInAsync(
// :snippet-start: connect-and-authenticate
App app = App.Create(myAppId);
Realms.Sync.User user = app.LogInAsync(
Credentials.Anonymous()).Result;

// :snippet-end:

// :snippet-start: configure-and-open-db
var config = new FlexibleSyncConfiguration(user)
{
Schema = new[] { typeof(Measurement) }
};


realm = Realm.GetInstance(config);
// :snippet-end:

// You cannot add a subscription for an AsymmetricObject
// This causes a compile-time error:
Expand All @@ -40,22 +41,18 @@ public void Setup()
//});
// :uncomment-end:
}

// :snippet-start: asymmetry
// :remove-start:
[Realms.Explicit]
// :remove-end:
// :snippet-start: define-asymmetric-object
private partial class Measurement : IAsymmetricObject
{
[PrimaryKey, MapTo("_id")]
public Guid Id { get; private set; } = Guid.NewGuid();
public double Value { get; set; }
public DateTimeOffset Timestamp { get; private set; } = DateTimeOffset.UtcNow;
}

// :remove-start:
// :snippet-end:
[Test]
// :remove-end:
// :snippet-start: asymmetry
public void SendMeasurementToRealm()
{
var measurement = new Measurement
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public void handleManualReset(App app, SyncSession session, ClientResetRequiredE

Log.w("EXAMPLE", "Opened a fresh instance of the realm.");

// Open the the realm backup -- as a dynamic realm
// Open the realm backup -- as a dynamic realm
// (no formal schema; access all data through field lookups)
DynamicRealm backupRealm = DynamicRealm.getInstance(error.getBackupRealmConfiguration());
Log.w("EXAMPLE", "Opened the backup realm.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class ClientResetTest : RealmTest() {
}
Log.w("EXAMPLE", "Opened a fresh instance of the realm.")

// Open the the realm backup -- as a dynamic realm
// Open the realm backup -- as a dynamic realm
// (no formal schema; access all data through field lookups)
val backupRealm =
DynamicRealm.getInstance(error.backupRealmConfiguration)
Expand Down
13 changes: 8 additions & 5 deletions examples/node/legacy/Examples/realm-query-language.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Realm, { BSON } from "realm";
import { ItemModel, ProjectModel } from "./schemas/rql-data-models";

// Tests for new RQL operators or updates should be placed in the new
// file compatible with JSv12 and later, located at
// examples/node/v12/__tests__/realm-query-language.test.js
/*
DON'T UPDATE THIS FILE. DEPRECATED IN FAVOR OF V12 TESTS.
Tests for new RQL operators or updates should be placed in the new
files compatible with JSv12 and later, located at:
examples/node/v12/__tests__/realm-query-language.test.js/ts
*/

describe("Realm Query Language Reference", () => {
let realm;
Expand Down Expand Up @@ -148,7 +151,7 @@ describe("Realm Query Language Reference", () => {
const progressMinutesRange = items.filtered(
// :remove-end:

// Find to-do items within a certain time range by finding items
// Find to-do items within a certain time range by finding items
// where the progressMinutes property is between two numbers.
"progressMinutes BETWEEN { $0 , $1 }", 30, 60
// :remove-start:
Expand Down Expand Up @@ -406,7 +409,7 @@ describe("Realm Query Language Reference", () => {
);
expect(shallowResultLinkingObjects.length).toBe(1);
expect(shallowResultLinkingObjects[0].name).toBe("Get coffee");

const shallowResultAtLinks = realm.objects("Item").filtered(
// :remove-end:
// Find items that are not referenced by any project
Expand Down
7 changes: 7 additions & 0 deletions examples/node/legacy/Examples/rql-data-models.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import Realm from "realm";
import { ItemModel, ProjectModel } from "./schemas/rql-data-models";

/*
DON'T UPDATE THIS FILE. DEPRECATED IN FAVOR OF V12 TESTS.
Updates should be placed in the new files compatible with
JSv12 and later, located at:
examples/node/v12/__tests__/rql-data-models.test.js/ts
*/

describe("test models", () => {
let realm;
const config = {
Expand Down
6 changes: 6 additions & 0 deletions examples/node/legacy/Examples/schemas/rql-data-models.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
DON'T UPDATE THIS FILE. DEPRECATED IN FAVOR OF V12 MODELS.
Updates should be placed in the new file compatible with
JSv12 and later, located at:
examples/node/v12/__tests__/models/rql-data-models.ts
*/
// :snippet-start: rql-data-models
const ItemModel = {
name: "Item",
Expand Down
54 changes: 54 additions & 0 deletions examples/node/v12/__tests__/models/rql-data-models.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Models for embedded objects & dot notation queries
const Address = {
name: "Address",
embedded: true,
properties: {
name: "string",
street: "string",
zipcode: "int",
},
};

const Office = {
name: "Office",
properties: {
name: "string",
address: "Address",
},
};

// :snippet-start: rql-data-models
const Item = {
name: "Item",
properties: {
_id: "objectId",
name: { type: "string", indexed: "full-text" },
isComplete: { type: "bool", default: false },
assignee: "string?",
priority: { type: "int", default: 0 },
progressMinutes: { type: "int", default: 0 },
projects: {
type: "linkingObjects",
objectType: "Project",
property: "items",
},
},
primaryKey: "_id",
};

const Project = {
name: "Project",
properties: {
_id: "objectId",
name: "string",
items: "Item[]",
quota: "int?",
comments: "string?{}",
projectLocation: "Office?",
additionalInfo: "mixed",
},
primaryKey: "_id",
};
// :snippet-end:

export { Address, Item, Office, Project };
59 changes: 45 additions & 14 deletions examples/node/v12/__tests__/models/rql-data-models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
import Realm, { BSON, ObjectSchema } from "realm";

// Models for embedded objects & dot notation queries
export class Address extends Realm.Object<Address> {
name!: string;
street!: string;
zipcode!: number;

static schema: ObjectSchema = {
name: "Address",
embedded: true,
properties: {
name: "string",
street: "string",
zipcode: "int",
},
};
}

export class Office extends Realm.Object<Office> {
name!: string;
address!: Address;

static schema: ObjectSchema = {
name: "Office",
properties: {
name: "string",
address: "Address",
},
};
}

// :snippet-start: rql-data-models
export class Item extends Realm.Object<Item> {
_id!: BSON.ObjectId;
name!: string;
Expand All @@ -12,17 +43,11 @@ export class Item extends Realm.Object<Item> {
name: "Item",
properties: {
_id: "objectId",
name: { type:"string", indexed: "full-text" },
name: { type: "string", indexed: "full-text" },
isComplete: { type: "bool", default: false },
assignee: "string?",
priority: {
type: "int",
default: 0,
},
progressMinutes: {
type: "int",
default: 0,
},
priority: { type: "int", default: 0 },
progressMinutes: { type: "int", default: 0 },
projects: {
type: "linkingObjects",
objectType: "Project",
Expand All @@ -32,12 +57,14 @@ export class Item extends Realm.Object<Item> {
primaryKey: "_id",
};
}

export class Project extends Realm.Object<Project> {
_id!: BSON.ObjectId;
name!: string;
items!: Realm.List<Item>
quota?: number
items!: Realm.List<Item>;
quota?: number;
comments?: Realm.Dictionary<string>;
projectLocation?: Office;
additionalInfo!: Realm.Mixed;

static schema: ObjectSchema = {
name: "Project",
Expand All @@ -46,7 +73,11 @@ export class Project extends Realm.Object<Project> {
name: "string",
items: "Item[]",
quota: "int?",
comments: "string?{}",
projectLocation: "Office?",
additionalInfo: "mixed",
},
primaryKey: "_id",
}
};
};
}
// :snippet-end:
Loading
Loading