Use URL objects for external URLs

Repository details (talkie)
Project page
talkie
Project log category
(588 entries)
Repository
@joelpurra/talkie
Owner
@joelpurra
Contributors
Contributors on Github
Project status
⏲️ This project has had recent commits.
📂 This project is open.
🌠 This project is popular.
Repository activity period
🗓
Commits
630 commits
Stars
69 stars
Commit details (93a05073)
Author
Authored at
Committer
Joel Purra
Committed at

Commit message

Use URL objects for external URLs

  • Prefer URL objects over strings to clearly distinguish the intent on a type level.
  • Currently only used for external URLs.
  • Cannot be (plainly) used for internal URLs, as they are always defined as relative.
    • URL objects require a base URL string when used with relative URL strings.
    • The base URL of web extensions contains the extension id, which is known for published extensions.
    • During webext debugging, a temporary id is generated, so the the base URL would need to be resolved at runtime.
    • Could use IInternalUrlProvider for each interal URL object creation/validation, but at this time chose not to.
Raw text
Use URL objects for external URLs

- Prefer URL objects over strings to clearly distinguish the intent on a type level.
- Currently only used for external URLs.
- Cannot be (plainly) used for internal URLs, as they are always defined as relative.
  - URL objects require a base URL string when used with relative URL strings.
  - The base URL of web extensions contains the extension id, which is known for published extensions.
  - During webext debugging, a temporary id is generated, so the the base URL would need to be resolved at runtime.
  - Could use `IInternalUrlProvider` for each interal URL object creation/validation, but at this time chose not to.

Changed files (10)

Path Additions Deletions
code/packages/options-application/src/app/main.tsx +4 -3
code/packages/options-application/src/components/navigation/nav-container-types.mts +6 -2
code/packages/options-application/src/components/navigation/nav.tsx +34 -39
code/packages/popup-application/src/app/main.tsx +1 -1
code/packages/shared-ui/src/slices/navigation.mts +4 -1
code/packages/shared-ui/src/utils/ui.mts +4 -2
code/packages/split-environment-interfaces/src/iapi.mts +1 -1
code/packages/split-environment-node/src/server-specific/api.mts +1 -1
code/packages/split-environment-webextension/src/browser-specific/api.mts +1 -1
code/packages/split-environment-webextension/src/browser-specific/urls.mts +12 -5

Commit categories (3)