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 cms-kontent example to action PR feedback #37206

Merged
merged 1 commit into from
May 26, 2022

Conversation

tommarshall
Copy link
Contributor

@tommarshall tommarshall commented May 26, 2022

  • Updates the cms-kontent example Image component to implement the
    suggested improvements from @styfle in Fix cms-kontent example Next/Image domain error #37188.
    • Simplifies the Kontent loader host checking.
    • Reduces the default image quality from 100 to 75.
  • Add tslib as a dev dependency to fix Module not found: Can't resolve 'tslib' error when importing transformImageUrl in the Image component.
    • It looks like this might be a bug in v11 of the Kontent Delivery SDK,
      as it appears tslib needs to be included as a dependency, rather than
      a dev dependency.
    • I missed this originally as the example runs fine in the Next repo as the root
      yarn.lock has tslib. It's only when the example is used via
      yarn create next-app that the issue occurs.
    • We can likely remove this in future alongside an upgrade to the SDK package
      once this issue has been fixed and released there, ref:
      Module not found: Can't resolve 'tslib' when importing transformImageUrl kontent-ai/delivery-sdk-js#347

#37188

Documentation / Examples

  • Make sure the linting passes by running yarn lint

@ijjk ijjk added the examples Issue/PR related to examples label May 26, 2022
@tommarshall tommarshall force-pushed the cms-kontent-example-image-component-tweaks branch from 0187d05 to ab515dc Compare May 26, 2022 10:33
@tommarshall tommarshall force-pushed the cms-kontent-example-image-component-tweaks branch from ab515dc to c7b2195 Compare May 26, 2022 13:35
* Updates the `cms-kontent` example `Image` component to implement the
  suggested improvements from @styfle in vercel#37188.
* Simplifies the Kontent loader host checking.
* Reduces the default image quality to from `100` to `75`.
* Add `tslib` dependency to fix `Module not found: Can't resolve 'tslib'`
  error when importing `transformImageUrl` in the `Image` component.
  It looks like this might be a bug in v11 of the Kontent Delivery SDK,
  as it appears `tslib` needs to be included as dependency, rather than
  dev dependency. I missed this originally as the example runs fine in
  the Next repo as the root `yarn.lock` has `tslib`. It's only when the
  example is used via `yarn create next-app` that the issue occurs. We
  can likely remove this in future alongside an upgrade to the SDK
  package once this issue has been fixed and released there.

vercel#37188
@tommarshall tommarshall force-pushed the cms-kontent-example-image-component-tweaks branch from c7b2195 to 9e403f9 Compare May 26, 2022 13:36
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Thanks!

@ijjk ijjk merged commit 6a5bdb5 into vercel:canary May 26, 2022
@tommarshall tommarshall deleted the cms-kontent-example-image-component-tweaks branch May 26, 2022 17:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants