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

feat: adding redis APL #374

Merged
merged 17 commits into from
Jan 20, 2025
Merged

feat: adding redis APL #374

merged 17 commits into from
Jan 20, 2025

Conversation

JannikZed
Copy link
Contributor

@JannikZed JannikZed commented Jan 7, 2025

this PR is used to bring native redis support as APL. It is fully tested and working.

@JannikZed JannikZed requested review from a team and andrzejewsky January 7, 2025 13:27
Copy link

changeset-bot bot commented Jan 7, 2025

🦋 Changeset detected

Latest commit: 3fa3866

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@saleor/app-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@krzysztofzuraw krzysztofzuraw left a comment

Choose a reason for hiding this comment

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

Good job 👏🏻 I added a couple of suggestion / questions 😄

@krzysztofzuraw
Copy link
Member

@JannikZed please update your branch - it should now have pnpm 9.12.3 :)

@JannikZed JannikZed requested a review from lkostrowski January 13, 2025 16:21
src/APL/index.ts Outdated
@@ -1,5 +1,6 @@
export * from "./apl";
export * from "./env-apl";
export * from "./file-apl";
export * from "./redis";
Copy link
Member

Choose a reason for hiding this comment

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

@JannikZed let's avoid that, now importing any other APL will evaluate redis, this causes issues, e.g. next is poor at tree shaking, possibly fail because it can't import redis sdk

Please check package.json and add exports key with new path, like vercel-kv. For example

    "./APL/redis": {
      "types": "./APL/redis/index.d.ts",
      "import": "./APL/redis/index.mjs",
      "require": "./APL/redis/index.js"
    },

also new entry point will be needed

https://github.com/saleor/app-sdk/blob/main/tsup.config.ts#L13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@IKarbowiak alright, check it out, if that works for you.
Is there a very easy way to test also if the package got build correctly and we can actually use the different APLs? are you spinning up an example saleor app and installing it locally or how are you doing that?

Copy link
Member

@lkostrowski lkostrowski Jan 17, 2025

Choose a reason for hiding this comment

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

I would do this

  1. build sdk
  2. set up app-template
  3. add sdk locally like pnpm add ../saleor-app-sdk
  4. pnpm install
  5. try it

of course other APLs must work if redis package is not installed

@JannikZed JannikZed requested a review from lkostrowski January 17, 2025 11:06
Copy link
Member

@lkostrowski lkostrowski left a comment

Choose a reason for hiding this comment

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

LGTM

@JannikZed
Copy link
Contributor Author

@krzysztofzuraw @lkostrowski I added redis integration tests now as well. They don't run automatically, as they need a running redis instance. I think it can help a lot to keep the quality high, as we test if the build is working and the final package can actually work with a real redis. Let me know, what you think. I can quickly remove it again, if that is not what you are expecting.

@lkostrowski
Copy link
Member

@JannikZed I'm fine with integration, but it has to be at least in readme how to run it. Best if you prepare docker-compose and document how to run it from scratch (run docker container, then run tests etc)

@JannikZed
Copy link
Contributor Author

@lkostrowski got it - included that now

@JannikZed
Copy link
Contributor Author

@andrzejewsky so it is just you remaining :)

@lkostrowski lkostrowski merged commit 7b51201 into saleor:main Jan 20, 2025
4 of 5 checks passed
@JannikZed JannikZed deleted the redis-apl branch January 20, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants