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

Fix how URL concatenation works #419

Merged
merged 6 commits into from
Feb 11, 2025
Merged

Fix how URL concatenation works #419

merged 6 commits into from
Feb 11, 2025

Conversation

TheCactusBlue
Copy link
Contributor

@TheCactusBlue TheCactusBlue commented Feb 7, 2025


Important

Replaces URL concatenation with urlString template literal tag in StackServerInterface for improved URL handling and encoding.

  • Behavior:
    • Replaces URL concatenation with urlString template literal tag in StackServerInterface methods for encoding values.
    • Affects methods like getServerUserById, listServerTeamInvitations, and revokeServerTeamInvitation.
  • Functions:
    • Adds urlString function in urls.tsx for URL string creation with encoding.
    • Updates templateIdentity in strings.tsx to simplify string concatenation logic.
  • Misc:
    • Updates CSS processing in process-css.ts to use template literals for globalCSS export.

This description was created by Ellipsis for 31d071b. It will automatically update as commits are pushed.

Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 10:29pm
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 10:29pm
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 10:29pm

@N2D4 N2D4 requested a review from fomalhautb February 9, 2025 23:19
Copy link
Contributor

@N2D4 N2D4 left a comment

Choose a reason for hiding this comment

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

feel free to merge after the fix

packages/stack-shared/src/utils/urls.tsx Outdated Show resolved Hide resolved
@@ -12,8 +13,8 @@ export function isValidUrl(url: string) {
return !!createUrlIfValid(url);
}

export function isLocalhost(urlOrString: string | URL) {
const url = createUrlIfValid(urlOrString);
export function isLocalhost(urlOrString: URL | string | null | undefined) { ;
Copy link

Choose a reason for hiding this comment

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

Remove the stray semicolon after the function opening. Also, consider adding a brief comment on why the function now accepts null/undefined.

Suggested change
export function isLocalhost(urlOrString: URL | string | null | undefined) { ;
export function isLocalhost(urlOrString: URL | string | null | undefined) {

export function isLocalhost(urlOrString: string | URL) {
const url = createUrlIfValid(urlOrString);
export function isLocalhost(urlOrString: URL | string | null | undefined) { ;
const url = typeof urlOrString === "string" ? createUrlIfValid(urlOrString) : urlOrString;
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted it to its original implementation, my branch had a broken implementation for some reason before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants