Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

refactor: drop imageBaseUrl from constants.mjs (#4766)

Bogdan Chadkina556b6b2aa73
diff --git a/fixtures/react-router-docker/app/constants.mjs b/fixtures/react-router-docker/app/constants.mjs
index 8559b68eb6..5dbbec107c 100644
--- a/fixtures/react-router-docker/app/constants.mjs
+++ b/fixtures/react-router-docker/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/fixtures/ssg-netlify-by-project-id/app/constants.mjs b/fixtures/ssg-netlify-by-project-id/app/constants.mjs
index 1e1639f807..9074945237 100644
--- a/fixtures/ssg-netlify-by-project-id/app/constants.mjs
+++ b/fixtures/ssg-netlify-by-project-id/app/constants.mjs
@@ -4,7 +4,6 @@
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/fixtures/ssg-netlify-by-project-id/vike.d.ts b/fixtures/ssg-netlify-by-project-id/vike.d.ts
index 3c77162037..2b59d4529c 100644
--- a/fixtures/ssg-netlify-by-project-id/vike.d.ts
+++ b/fixtures/ssg-netlify-by-project-id/vike.d.ts
@@ -11,7 +11,6 @@ declare global {
interface PageContext {
constants: {
assetBaseUrl: string;
- imageBaseUrl: string;
imageLoader: ImageLoader;
};
data: {
diff --git a/fixtures/ssg/app/constants.mjs b/fixtures/ssg/app/constants.mjs
index 54a32d6295..d6a9c3cf51 100644
--- a/fixtures/ssg/app/constants.mjs
+++ b/fixtures/ssg/app/constants.mjs
@@ -4,7 +4,6 @@
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/fixtures/ssg/vike.d.ts b/fixtures/ssg/vike.d.ts
index 3c77162037..2b59d4529c 100644
--- a/fixtures/ssg/vike.d.ts
+++ b/fixtures/ssg/vike.d.ts
@@ -11,7 +11,6 @@ declare global {
interface PageContext {
constants: {
assetBaseUrl: string;
- imageBaseUrl: string;
imageLoader: ImageLoader;
};
data: {
diff --git a/fixtures/webstudio-cloudflare-template/app/constants.mjs b/fixtures/webstudio-cloudflare-template/app/constants.mjs
index dc5dbb0f5c..8eea5a78ce 100644
--- a/fixtures/webstudio-cloudflare-template/app/constants.mjs
+++ b/fixtures/webstudio-cloudflare-template/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/constants.mjs b/fixtures/webstudio-remix-netlify-edge-functions/app/constants.mjs
index a288e7c5dc..bef2400ae8 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/constants.mjs
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/fixtures/webstudio-remix-netlify-functions/app/constants.mjs b/fixtures/webstudio-remix-netlify-functions/app/constants.mjs
index a288e7c5dc..bef2400ae8 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/constants.mjs
+++ b/fixtures/webstudio-remix-netlify-functions/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/fixtures/webstudio-remix-vercel/app/constants.mjs b/fixtures/webstudio-remix-vercel/app/constants.mjs
index 47140fba63..8bfaf11067 100644
--- a/fixtures/webstudio-remix-vercel/app/constants.mjs
+++ b/fixtures/webstudio-remix-vercel/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/defaults/app/constants.mjs b/packages/cli/templates/defaults/app/constants.mjs
index dc5dbb0f5c..8eea5a78ce 100644
--- a/packages/cli/templates/defaults/app/constants.mjs
+++ b/packages/cli/templates/defaults/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/netlify-edge-functions/app/constants.mjs b/packages/cli/templates/netlify-edge-functions/app/constants.mjs
index a288e7c5dc..bef2400ae8 100644
--- a/packages/cli/templates/netlify-edge-functions/app/constants.mjs
+++ b/packages/cli/templates/netlify-edge-functions/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/netlify-functions/app/constants.mjs b/packages/cli/templates/netlify-functions/app/constants.mjs
index a288e7c5dc..bef2400ae8 100644
--- a/packages/cli/templates/netlify-functions/app/constants.mjs
+++ b/packages/cli/templates/netlify-functions/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/react-router-docker/app/constants.mjs b/packages/cli/templates/react-router-docker/app/constants.mjs
index 8559b68eb6..5dbbec107c 100644
--- a/packages/cli/templates/react-router-docker/app/constants.mjs
+++ b/packages/cli/templates/react-router-docker/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/ssg-netlify/app/constants.mjs b/packages/cli/templates/ssg-netlify/app/constants.mjs
index 1e1639f807..9074945237 100644
--- a/packages/cli/templates/ssg-netlify/app/constants.mjs
+++ b/packages/cli/templates/ssg-netlify/app/constants.mjs
@@ -4,7 +4,6 @@
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/ssg-vercel/app/constants.mjs b/packages/cli/templates/ssg-vercel/app/constants.mjs
index 190f2a792d..ef50a882d1 100644
--- a/packages/cli/templates/ssg-vercel/app/constants.mjs
+++ b/packages/cli/templates/ssg-vercel/app/constants.mjs
@@ -4,7 +4,6 @@
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/ssg/app/constants.mjs b/packages/cli/templates/ssg/app/constants.mjs
index 54a32d6295..d6a9c3cf51 100644
--- a/packages/cli/templates/ssg/app/constants.mjs
+++ b/packages/cli/templates/ssg/app/constants.mjs
@@ -4,7 +4,6 @@
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/cli/templates/ssg/vike.d.ts b/packages/cli/templates/ssg/vike.d.ts
index 3c77162037..2b59d4529c 100644
--- a/packages/cli/templates/ssg/vike.d.ts
+++ b/packages/cli/templates/ssg/vike.d.ts
@@ -11,7 +11,6 @@ declare global {
interface PageContext {
constants: {
assetBaseUrl: string;
- imageBaseUrl: string;
imageLoader: ImageLoader;
};
data: {
diff --git a/packages/cli/templates/vercel/app/constants.mjs b/packages/cli/templates/vercel/app/constants.mjs
index 47140fba63..8bfaf11067 100644
--- a/packages/cli/templates/vercel/app/constants.mjs
+++ b/packages/cli/templates/vercel/app/constants.mjs
@@ -3,7 +3,6 @@
* and we use `node --eval` to extract the constants.
*/
export const assetBaseUrl = "/assets/";
-export const imageBaseUrl = "/assets/";
/**
* @type {import("@webstudio-is/image").ImageLoader}
diff --git a/packages/image/src/image-loaders.ts b/packages/image/src/image-loaders.ts
index 20b5aab041..555fed111a 100644
--- a/packages/image/src/image-loaders.ts
+++ b/packages/image/src/image-loaders.ts
@@ -60,11 +60,3 @@ export const wsImageLoader: ImageLoader = (props) => {
// Cloudflare docs say that we don't need to urlencode the path params
return resultUrl.href;
};
-
-type ImageLoaderOptions = {
- imageBaseUrl?: string;
-};
-
-export const createImageLoader = (
- _loaderOptions: ImageLoaderOptions
-): ImageLoader => wsImageLoader;
diff --git a/packages/react-sdk/placeholder.d.ts b/packages/react-sdk/placeholder.d.ts
index 1c0a9af14e..90359ef0d2 100644
--- a/packages/react-sdk/placeholder.d.ts
+++ b/packages/react-sdk/placeholder.d.ts
@@ -1,7 +1,6 @@
declare module "__CONSTANTS__" {
import type { ImageLoader } from "@webstudio-is/image";
export const assetBaseUrl: string;
- export const imageBaseUrl: string;
export const imageLoader: ImageLoader;
}