[PR #495] [MERGED] Introduce specialized ModuleKey(Factory) for http uris #583

Closed
opened 2025-12-30 01:25:29 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/495
Author: @bioball
Created: 5/15/2024
Status: Merged
Merged: 5/16/2024
Merged by: @bioball

Base: mainHead: http-module-key


📝 Commits (1)

  • 99f3877 Make http URLs their own module key

📊 Changes

8 files changed (+65 additions, -26 deletions)

View changed files

📝 pkl-cli/src/main/kotlin/org/pkl/cli/CliRepl.kt (+1 -0)
📝 pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliCommand.kt (+1 -0)
📝 pkl-core/src/main/java/org/pkl/core/EvaluatorBuilder.java (+1 -0)
📝 pkl-core/src/main/java/org/pkl/core/module/ModuleKeyFactories.java (+16 -0)
📝 pkl-core/src/main/java/org/pkl/core/module/ModuleKeys.java (+44 -14)
📝 pkl-core/src/main/java/org/pkl/core/module/ResolvedModuleKeys.java (+0 -12)
📝 pkl-core/src/main/java/org/pkl/core/service/ExecutorSpiImpl.java (+1 -0)
📝 pkl-server/src/main/kotlin/org/pkl/server/Server.kt (+1 -0)

📄 Description

GenericUrl is a catch-all that uses URL.openConnection(). Since we now have special handling of HTTP urls, it makes more sense to put it in its own module key.

Those that don't use the Http module key specifically but use GenericUrl will still be able to fetch http urls, but it would use the standard URL.openConnection implementation. This works the same as file: URIs; if only the GenericUrl module key factory is used, Pkl can still load file: uris.

(FYI @translatenix)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/495 **Author:** [@bioball](https://github.com/bioball) **Created:** 5/15/2024 **Status:** ✅ Merged **Merged:** 5/16/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `http-module-key` --- ### 📝 Commits (1) - [`99f3877`](https://github.com/apple/pkl/commit/99f38774b3c1404156a765ea8c3b3efbd08fe657) Make http URLs their own module key ### 📊 Changes **8 files changed** (+65 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/CliRepl.kt` (+1 -0) 📝 `pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliCommand.kt` (+1 -0) 📝 `pkl-core/src/main/java/org/pkl/core/EvaluatorBuilder.java` (+1 -0) 📝 `pkl-core/src/main/java/org/pkl/core/module/ModuleKeyFactories.java` (+16 -0) 📝 `pkl-core/src/main/java/org/pkl/core/module/ModuleKeys.java` (+44 -14) 📝 `pkl-core/src/main/java/org/pkl/core/module/ResolvedModuleKeys.java` (+0 -12) 📝 `pkl-core/src/main/java/org/pkl/core/service/ExecutorSpiImpl.java` (+1 -0) 📝 `pkl-server/src/main/kotlin/org/pkl/server/Server.kt` (+1 -0) </details> ### 📄 Description GenericUrl is a catch-all that uses URL.openConnection(). Since we now have special handling of HTTP urls, it makes more sense to put it in its own module key. Those that don't use the Http module key specifically but use `GenericUrl` will still be able to fetch `http` urls, but it would use the standard `URL.openConnection` implementation. This works the same as `file:` URIs; if only the `GenericUrl` module key factory is used, Pkl can still load `file:` uris. (FYI @translatenix) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:25:29 +01:00
adam closed this issue 2025-12-30 01:25:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#583