cloudflare / kotlin-worker-hello-world

Apache License 2.0
56 stars 11 forks source link

Modernize example with support for ES Modules #5

Open ccjernigan opened 10 months ago

ccjernigan commented 10 months ago

This PR modernizes the Kotlin Cloudflare Worker example in several ways:

  1. Updates Gradle and Kotlin dependencies
  2. Improve build performance and configurability with new Gradle and Kotlin build features
  3. Refactor to use a Gradle submodule to contain worker-app (which makes the following changes easier)
  4. Migrate from Service Workers to ES Modules (enabling future changes to support new Cloudflare features like D1 or Vectorize)
  5. Add integration test with Miniflare by introducing miniflare-lib for the Miniflare external classes, plus worker-integration-test for the test cases. (Note that the integration tests are in a separate module instead of worker-app/jsTest, because worker-app uses the Kotlin browser target to enable Kotlin packaging tasks, while Miniflare requires the nodejs target)

These changes could be broken into independent pull requests in top-to-bottom order, although they'd need to be created one at a time due to later changes depending on earlier changes. Let me know if that would be preferred.