Skip to content

Commit

Permalink
Merge branch 'fix-duplicate-stream-definitions' of https://github.com…
Browse files Browse the repository at this point in the history
…/yext/pages into fix-duplicate-stream-definitions
  • Loading branch information
briantstephan committed Oct 17, 2023
2 parents adc360d + 8d6be95 commit 3312f8a
Show file tree
Hide file tree
Showing 6 changed files with 1,486 additions and 1,021 deletions.
42 changes: 42 additions & 0 deletions packages/pages/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
#### 1.0.0-rc.5 (2023-10-10)

##### New Features

* **dev:**
* set siteInternalHostName locally (#401) (07d77e97)
* add noMigration flag for upgrade (#400) (62670993)
* add scope to yextrc (#397) (609e471a)
* add upgrade command (#395) (41e21259)
* **plugin:** move urlWriteback into pagesJS (#393) (b6b040d7)

##### Bug Fixes

* **plugin:** remove import meta resolve (#403) (f5afbeaf)
* **pages-plugins:** slugManager searchIds not working on webhook update (#399) (9ae11b06)

##### Other Changes

* [email protected] (391ea0cf)

##### Reverts

* **dev:** use esbuild instead of ts-morph to parse template configs (#396) (c5c2d656)

##### New Features

* **dev:**
* set siteInternalHostName locally (#401) (07d77e97)
* add noMigration flag for upgrade (#400) (62670993)
* add scope to yextrc (#397) (609e471a)
* add upgrade command (#395) (41e21259)
* **plugin:** move urlWriteback into pagesJS (#393) (b6b040d7)

##### Bug Fixes

* **plugin:** remove import meta resolve (#403) (f5afbeaf)
* **pages-plugins:** slugManager searchIds not working on webhook update (#399) (9ae11b06)

##### Reverts

* **dev:** use esbuild instead of ts-morph to parse template configs (#396) (c5c2d656)

#### 1.0.0-rc.4 (2023-09-20)

##### Chores
Expand Down
6 changes: 3 additions & 3 deletions packages/pages/THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ SOFTWARE.

The following npm package may be included in this product:

- rollup@3.28.0
- rollup@3.29.4

This package contains the following license and notice below:

Expand Down Expand Up @@ -1350,7 +1350,7 @@ END OF TERMS AND CONDITIONS

The following npm package may be included in this product:

- [email protected].0
- [email protected].3

This package contains the following license and notice below:

Expand Down Expand Up @@ -1380,7 +1380,7 @@ SOFTWARE.

The following npm package may be included in this product:

- [email protected].9
- [email protected].11

This package contains the following license and notice below:

Expand Down
2 changes: 1 addition & 1 deletion packages/pages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yext/pages",
"version": "1.0.0-rc.4",
"version": "1.0.0-rc.5",
"description": "The default React development toolchain provided by Yext",
"author": "[email protected]",
"license": "BSD-3-Clause",
Expand Down
25 changes: 16 additions & 9 deletions packages/pages/src/common/src/template/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ export const getHydrationTemplate = (
templateModulePath: string,
props: TemplateRenderProps
): string => {
const posixModulePath = makeAbsolute(convertToPosixPath(templateModulePath));
const posixRenderPath = makeAbsolute(
convertToPosixPath(clientRenderTemplatePath)
);
return `
const componentUrl = import.meta.resolve("/${convertToPosixPath(
templateModulePath
)}");
const renderUrl = import.meta.resolve("/${convertToPosixPath(
clientRenderTemplatePath
)}");
const component = await import(componentUrl);
const render = await import(renderUrl);
const componentURL = new URL("${posixModulePath}", import.meta.url)
const component = await import(componentURL);
const renderURL = new URL("${posixRenderPath}", import.meta.url)
const render = await import(renderURL);
render.render(
{
Expand All @@ -82,6 +82,13 @@ export const getHydrationTemplate = (
`;
};

const makeAbsolute = (path: string): string => {
if (!path.startsWith("/")) {
return "/" + path;
}
return path;
};

/**
* Get the server template with injected html common to both the dev and plugin side of things.
* For the most part, injects data into the <head> tag. It also provides validation.
Expand Down
Binary file added packages/pages/yext-pages-1.0.0-rc.2.1.tgz
Binary file not shown.
Loading

0 comments on commit 3312f8a

Please sign in to comment.