Skip to content

Conversation

@JeremS
Copy link
Contributor

@JeremS JeremS commented Jul 3, 2025

This PR mainly contains the changes for the new ADR:

  • the public API functions have been renamed
  • the remove-elements and the execute-script functionality is now sugar on top of patch-elements
  • the hello world example and all the code snippets for the website are updated to the new names
  • the SDK examples have also been updated to the new API

I used these changes as an opportunity to review some things:

  • I moved the clj-kondo config to allows other lib to use the starfederation.datastar.clojure ns for their clj-kondo configs.
  • I refactored the unit tests for the core API, they now should be easier to understand, maintain and are more repl friendly

I also added 2 new features:

  • support for brotli compression as a library see the sdk-brotli directory (and the associated commit)
  • an alternative http-kit api that works better with the ring model at the cost of using 1 middleware (see the http-kit2 namespace)

All in all, the breaking changes are ADR related, the new features are additive and optional.

Cheers!

@JeremS JeremS requested review from bencroker and delaneyj as code owners July 3, 2025 13:20
@bennyandresen
Copy link

bennyandresen commented Jul 5, 2025

Thanks a lot @JeremS!

For information: After updating to the newest SDK from this PR I merely had to change merge-fragments! to patch-elements! in my application code and everything continued to work.

Went from rc11 to rc13.

Brotli is currently not working for me, but we'll investigate this via Discord.

@bencroker
Copy link
Collaborator

Is this ready for merging?

@JeremS
Copy link
Contributor Author

JeremS commented Jul 7, 2025

Brotli on Http-kit works. When using jetty that's another story. I suspect it's a Jetty buffering issue not a SDK one. I will add a notice to the Brotli lib's README to that effect.

@bencroker Usually @andersmurphy & @Ramblurr review the Clojure SDK. I think it's fine to be merged but I'd also like to get their go ahead. I should have mentioned them in this PR sooner.

JeremS added 5 commits July 7, 2025 14:28
- moved clj-kondo config to allows other lib to use the
  starfederation.datastar.clojure ns for their clj-kondo configs.
- refactored the base SDK unit tests
- removing superfluous newline char when terminating a sse event
- using the bundle from the repo in dev examples and tests
@anastygnome
Copy link
Contributor

anastygnome commented Jul 7, 2025

Jetty will not work if you don't set the settings as per

jetty/jetty.project#4317

@JeremS
Copy link
Contributor Author

JeremS commented Jul 7, 2025

@anastygnome Hi, I am not sure what you mean, what settings should we set? For info the SDK's GZIP write profile works with Jetty, it's the Brotli one that does not.

@Ramblurr
Copy link
Contributor

Ramblurr commented Jul 8, 2025

I am looking at this today.

@anastygnome
Copy link
Contributor

@anastygnome Hi, I am not sure what you mean, what settings should we set? For info the SDK's GZIP write profile works with Jetty, it's the Brotli one that does not.

I'll check this when I get to that point with the jetty buffer, but this is the same kind of buffer issue we encounter with gzip (even though it works)

@bencroker
Copy link
Collaborator

Can we get this finalised today for the public RC?

@bencroker bencroker added the sdk SDK related issues label Jul 10, 2025
Copy link
Contributor

@Ramblurr Ramblurr left a comment

Choose a reason for hiding this comment

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

@bencroker My comments only affect the testing/example files, not the core SDK code. IMO it can be merged as is. I've tested that the core functionality works in my apps (though I haven't used the new http-kit2 ns yet).

@JeremS I'm approving these changes despite the comments above, maybe you can address them later?

@bencroker
Copy link
Collaborator

Let’s get these resolved first.

@JeremS
Copy link
Contributor Author

JeremS commented Jul 10, 2025

I have fixed the mistakes @Ramblurr caught. They were in example snippets I use to test not the ones that go into the D* website though. I checked, these mistake are only in my tests, not on the website.

@Ramblurr Thanks for the review.
@bencroker We are good to go!

@bencroker bencroker merged commit d86d859 into starfederation:develop Jul 10, 2025
1 check passed
@JeremS JeremS deleted the ADR-changes branch July 10, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk SDK related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants