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

refactor: remove project meta from client #3290

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
Expand All @@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
projectMeta,
} from "../__generated__/_index.server";

import css from "../__generated__/index.css?url";
Expand Down Expand Up @@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
Expand All @@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
const { pageMeta, projectMeta } = data;
const { pageMeta } = data;

if (data.url) {
metas.push({
Expand All @@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {

const origin = `https://${data.host}`;

if (projectMeta?.siteName) {
if (siteName) {
metas.push({
property: "og:site_name",
content: projectMeta.siteName,
content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
name: projectMeta.siteName,
name: siteName,
url: origin,
},
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
Expand All @@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
projectMeta,
} from "../__generated__/[script-test]._index.server";

import css from "../__generated__/index.css?url";
Expand Down Expand Up @@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
Expand All @@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
const { pageMeta, projectMeta } = data;
const { pageMeta } = data;

if (data.url) {
metas.push({
Expand All @@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {

const origin = `https://${data.host}`;

if (projectMeta?.siteName) {
if (siteName) {
metas.push({
property: "og:site_name",
content: projectMeta.siteName,
content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
name: projectMeta.siteName,
name: siteName,
url: origin,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
Expand All @@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
projectMeta,
} from "../__generated__/[sitemap-html]._index.server";

import css from "../__generated__/index.css?url";
Expand Down Expand Up @@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
Expand All @@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
const { pageMeta, projectMeta } = data;
const { pageMeta } = data;

if (data.url) {
metas.push({
Expand All @@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {

const origin = `https://${data.host}`;

if (projectMeta?.siteName) {
if (siteName) {
metas.push({
property: "og:site_name",
content: projectMeta.siteName,
content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
name: projectMeta.siteName,
name: siteName,
url: origin,
},
});
Expand Down
11 changes: 5 additions & 6 deletions fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
Expand All @@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
projectMeta,
} from "../__generated__/[world]._index.server";

import css from "../__generated__/index.css?url";
Expand Down Expand Up @@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
Expand All @@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
const { pageMeta, projectMeta } = data;
const { pageMeta } = data;

if (data.url) {
metas.push({
Expand All @@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {

const origin = `https://${data.host}`;

if (projectMeta?.siteName) {
if (siteName) {
metas.push({
property: "og:site_name",
content: projectMeta.siteName,
content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
name: projectMeta.siteName,
name: siteName,
url: origin,
},
});
Expand Down
Loading
Loading