Skip to content

Commit

Permalink
Merge pull request #125 from basehub-ai/jb/strip-height-in-basehub-image
Browse files Browse the repository at this point in the history
Jb/strip height in basehub image
  • Loading branch information
julianbenegas authored Dec 12, 2024
2 parents ab97f30 + f756bb0 commit 7acdecb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/basehub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# basehub

## 7.5.29

### Patch Changes

- Strip out height in BaseHubImage, as next/image doesn't require it

## 7.5.28

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/basehub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "basehub",
"description": "A very fast Headless CMS.",
"author": "JB <[email protected]>",
"version": "7.5.28",
"version": "7.5.29",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down
8 changes: 7 additions & 1 deletion packages/basehub/src/next/image/primitive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ Expected origin to be one of:
!param.startsWith("width=") &&
!param.startsWith("quality=") &&
!param.startsWith("w=") &&
!param.startsWith("q=")
!param.startsWith("q=") &&
// also strip height because next.js doesn't need it
!param.startsWith("h=") &&
!param.startsWith("height=")
);
});
let newParams = [...filteredParams, ...params].join(",");
Expand All @@ -58,6 +61,9 @@ Expected origin to be one of:
if (url.searchParams.has("format") === false) {
url.searchParams.set("format", "auto");
}
// also strip height because next.js doesn't need it
url.searchParams.delete("height");
url.searchParams.delete("h");
}

// pass old origin to new origin
Expand Down
7 changes: 7 additions & 0 deletions playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# playground

## 0.0.171

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.170

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playground",
"private": true,
"version": "0.0.170",
"version": "0.0.171",
"scripts": {
"dev": "basehub dev & next dev --port 3003",
"build": "basehub && next build",
Expand Down

0 comments on commit 7acdecb

Please sign in to comment.