Skip to content

(DOCSP-39523): Consolidate Call a Function page #3322

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

Merged
merged 9 commits into from
Jul 23, 2024

Conversation

dacharyc
Copy link
Collaborator

@dacharyc dacharyc commented Jul 16, 2024

Pull Request Info - SDK Docs Consolidation

Jira ticket: https://jira.mongodb.org/browse/DOCSP-39523

Staged Page

Page Source

Add links to every SDK's pages where you got the SDK-specific information:

PR Author Checklist

Before requesting a review for your PR, please check these items:

  • Open the PR against the feature-consolidated-sdk-docs branch instead of master
  • Tag the consolidated page for:
    • genre
    • meta.keywords
    • meta.description

Naming

Links and Refs

  • Create new consolidated SDK ref targets starting with "_sdks-" for relevant sections
  • Remove or update any SDK-specific refs to use the new consolidated SDK ref targets
  • Update any Kotlin API links to use the new Kotlin SDK roles

Content

  • Shared code boxes have snippets or placeholders for all 9 languages
  • API description sections have API details or a generic placeholder for all 9 languages
  • Check related pages for relevant content to include
  • Create a ticket for missing examples in each relevant SDK: Consolidation Gaps epic

Reviewer Checklist

As a reviewer, please check these items:

  • Shared code example boxes contain language-specific snippets or placeholders for every language
  • API reference details contain working API reference links or generic content
  • Realm naming/language has been updated
  • All relevant content from individual SDK pages is present on the consolidated page

@dacharyc dacharyc added the merge to feature branch Unreleased feature - do not merge to Master label Jul 16, 2024
Copy link

github-actions bot commented Jul 16, 2024

Readability for Commit Hash: d0fab64

You can see any previous Readability scores (if they exist) by looking
at the comment's history.

Readability scores for changed documents:

  • source/sdk/serialization: Grade Level: 17.4, Reading Ease: -8.39
  • source/sdk/atlas/call-function: Grade Level: 7.7, Reading Ease: 60.01

For Grade Level, aim for 8 or below.

For Reading Ease scores, aim for 60 or above:

Score Difficulty
90-100 Very Easy
80-89 Easy
70-79 Fairly Easy
60-69 Medium
50-59 Fairly Hard
30-49 Hard
0-29 Very Hard

For help improving readability, try Hemingway App.

Copy link
Collaborator

@krollins-mdb krollins-mdb left a comment

Choose a reason for hiding this comment

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

Thanks again, @dacharyc! Mostly looks good, but I'm requesting changes for a few reasons:

  • Some Java API doc links weren't working as expected
  • Swift API details have headings that don't appear in other language's details content
  • A suggestion for potentially removing the Atlas Function example

Comment on lines 44 to 46
The example on this page demonstrates calling an :ref:`Atlas Function <functions>`
named ``sum`` or ``concatenate`` that takes two arguments, sums or concatenates
them, and returns the result:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This paragraph is confusing. Here are a few thoughts:

  • In the following code block, we're not showing calling the Function from the SDK - we're showing the Atlas Function itself. The current set up is a bit misleading. I think "The example on this page" may not mean the closest code example, but that's how most people will read it.
  • Why would it matter what the Atlas Function is named? We don't show that in the following code block.
  • While it's true that the code example could sum or concatenate in JavaScript, this wouldn't work in other languages. I think it would make sense to simplify to just sum or concatenate and not worry about JavaScript's weirdness

EDIT: I see what you were going for. See next comment for more well-informed thoughts. 😆

Copy link
Collaborator

Choose a reason for hiding this comment

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

  • I think the distance between stating what the Atlas Function is and the example(s) where the Function is invoked is too much for readers to easily associate the two.
  • Did you consider putting the Atlas Function example in the "Call a Function" section - maybe it's own subsection - where it's more clearly highlighted that this is the Function that the following code examples will invoke?
  • I'm tempted to remove the Atlas Function example entirely. In the context of the consolidated examples, it's more confusing than helpful, I think. It would be nice to have, but I think there are some fundamental things we'd need to fix that are beyond the scope of this PR. (like the fact that the Function example explicitly states it's concatenating strings in a comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did experiment with a few different placements for it, but landed on this. But I understand it's not ideal.

I've removed the example and have reworded the description of the Function we're calling to be generic enough to apply to all the examples, I think.

We can revisit adding some other example in the future if this page becomes a high enough priority to warrant a bigger time investment.

In this case, ``functions.concatenate()`` refers to the ``concatenate``
function. Pass a ``BSONArray`` of arguments.

Async/Await
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Async/Await and Completion Handler headings are included in the on-this-page TOC for every language. But they only work for Swift because it's the only language with API details that include these headings.

Is the only way around this to remove the headers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ugh, yes, I meant to make this page depth 1. Good catch, thank you!

@@ -0,0 +1,18 @@
To execute a function in Swift, use the ``functions`` object on the currently
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that the Swift content doesn't link to the Swift API ref docs. Worth adding links?

- id: typescript
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.ts
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can share the JS example with TS here, as there wouldn't be any difference between the two.

Co-authored-by: Kyle Rollins <115574589+krollins-mdb@users.noreply.github.com>
Copy link

netlify bot commented Jul 22, 2024

Deploy Preview for device-sdk ready!

Name Link
🔨 Latest commit d0fab64
🔍 Latest deploy log https://app.netlify.com/sites/device-sdk/deploys/669ed635f4a77800080f1110
😎 Deploy Preview https://deploy-preview-3322--device-sdk.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 35 (🟢 up 4 from production)
Accessibility: 92 (🔴 down 1 from production)
Best Practices: 75 (no change from production)
SEO: 62 (🔴 down 7 from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@dacharyc dacharyc requested a review from krollins-mdb July 22, 2024 22:01
Copy link
Collaborator

@krollins-mdb krollins-mdb left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks again, Dachary!

@dacharyc dacharyc merged commit e7fa389 into mongodb:feature-consolidated-sdk-docs Jul 23, 2024
10 checks passed
@dacharyc dacharyc deleted the DOCSP-39523 branch July 23, 2024 15:45
@docs-builder-bot
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge to feature branch Unreleased feature - do not merge to Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants