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

[@types/shopify-buy] Add language to the Config interface #46541

Merged
merged 1 commit into from Aug 9, 2020

Conversation

Gomah
Copy link
Contributor

@Gomah Gomah commented Aug 4, 2020

If the Shopify store supports multiple languages, the Storefront API can return translated resource types and fields.

// Initializing a client to return translated content
const clientWithTranslatedContent = Client.buildClient({
  domain: 'your-shop-name.myshopify.com',
  storefrontAccessToken: 'your-storefront-access-token',
  language: 'ja-JP'
});

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.

  • Test the change in your own code. (Compile and run.)

  • Follow the advice from the readme.

  • Avoid common mistakes.

  • Run npm run lint package-name (or tsc if no tslint.json is present).

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/Shopify/js-buy-sdk#initializing-the-client

  • Add or edit tests to reflect the change. (Run with npm test.)
    N/A as the change require adding locales to the existing shopfront.

If the Shopify store supports multiple languages, the Storefront API can return translated resource types and fields.

```ts
// Initializing a client to return translated content
const clientWithTranslatedContent = Client.buildClient({
  domain: 'your-shop-name.myshopify.com',
  storefrontAccessToken: 'your-storefront-access-token',
  language: 'ja-JP'
});```
@typescript-bot typescript-bot added the Untested Change This PR does not touch tests label Aug 4, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 4, 2020

@Gomah Thank you for submitting this PR!

This is a live comment which I will keep updated.

This PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Have you considered adding tests to cover the change you're making? Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you.

Code Reviews

This PR can be merged once it's reviewed by a DT maintainer.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Only a DT maintainer can approve changes without tests

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 46541,
  "author": "Gomah",
  "owners": [
    "openminder",
    "straiforos",
    "totemika",
    "kilinkis",
    "chrisworman-pela",
    "MaciekBaron"
  ],
  "dangerLevel": "ScopedAndUntested",
  "headCommitAbbrOid": "76fa592",
  "headCommitOid": "76fa59235af76db0ff08c2e2b24712850832b3ab",
  "mergeIsRequested": true,
  "stalenessInDays": 0,
  "lastPushDate": "2020-08-04T06:33:45.000Z",
  "lastCommentDate": "2020-08-09T02:22:27.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46541/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "anyPackageIsNew": false,
  "packages": [
    "shopify-buy"
  ],
  "files": [
    {
      "path": "types/shopify-buy/index.d.ts",
      "kind": "definition",
      "package": "shopify-buy"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-08-08T01:08:36.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 6,
  "isChangesRequested": false
}

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Aug 4, 2020
@typescript-bot
Copy link
Contributor

🔔 @openminder @straiforos @totemika @kilinkis @chrisworman-pela @MaciekBaron — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@danger-public
Copy link

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

shopify-buy (unpkg)

was missing the following properties:

  1. The declaration doesn't match the JavaScript module 'shopify-buy'. Reason:
    The JavaScript module can be called or constructed, but the declaration module cannot.

Generated by 🚫 dangerJS against 76fa592

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Aug 4, 2020
@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #46541 diff
Batch compilation
Memory usage (MiB) 100.8 102.3 +1.5%
Type count 24157 24157 0%
Assignability cache size 4649 4649 0%
Language service
Samples taken 665 665 0%
Identifiers in tests 665 665 0%
getCompletionsAtPosition
    Mean duration (ms) 526.7 523.5 -0.6%
    Mean CV 8.2% 8.4%
    Worst duration (ms) 1187.3 1122.9 -5.4%
    Worst identifier $cartItem $cartItem
getQuickInfoAtPosition
    Mean duration (ms) 522.7 519.0 -0.7%
    Mean CV 8.5% 8.3% -1.4%
    Worst duration (ms) 1240.6 1156.3 -6.8%
    Worst identifier append append

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Aug 4, 2020
@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Aug 4, 2020
Copy link
Contributor

@straiforos straiforos left a comment

Choose a reason for hiding this comment

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

This is an optional parameter added to the interface which is safe for addition and extension as far as I am aware, test may want to be revisited if this could be added at the moment this will suffice and thank you for your contribution @Gomah!

I double checked on the current API Docs for this, seems like it could be nonoptional so if tests do not break I would leave it be.

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Aug 8, 2020
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Author to Merge in New Pull Request Status Board Aug 8, 2020
@straiforos
Copy link
Contributor

@Gomah may I set this to merge or if you would like put in the comment ready to merge.

I would like this to not impeed your work.

@straiforos
Copy link
Contributor

Oops hopefully that doesn't merge it 🤦🤦‍♂️

@Gomah
Copy link
Contributor Author

Gomah commented Aug 9, 2020

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Aug 9, 2020
@typescript-bot typescript-bot merged commit 464e13b into DefinitelyTyped:master Aug 9, 2020
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Aug 9, 2020
@Gomah Gomah deleted the patch-2 branch August 29, 2020 04:53
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
… the Config interface by @Gomah

If the Shopify store supports multiple languages, the Storefront API can return translated resource types and fields.

```ts
// Initializing a client to return translated content
const clientWithTranslatedContent = Client.buildClient({
  domain: 'your-shop-name.myshopify.com',
  storefrontAccessToken: 'your-storefront-access-token',
  language: 'ja-JP'
});```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainer Approved Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants