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

[NextJS] Move LayoutService to sitecore-jss package #511

Merged
merged 13 commits into from
Dec 17, 2020

Conversation

sc-illiakovalenko
Copy link
Contributor

Description

Motivation

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update (non-breaking change; modified files are limited to the /docs directory)

Checklist:

  • I have read the Contributing guide.
  • My code follows the code style of this project.
  • My code/comments/docs fully adhere to the Code of Conduct.
  • My change is a code change and it requires an update to the documentation.
  • My change is a documentation change and it requires an update to the navigation.

packages/sitecore-jss/src/layout-service.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/layout-service.ts Show resolved Hide resolved
packages/sitecore-jss/src/layout-service.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/layout-service.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/layout-service.ts Outdated Show resolved Hide resolved
import { HttpJsonFetcher } from './httpClientInterface';
import { IncomingMessage, ServerResponse } from 'http';

export type DataFetcherResolver = (req?: IncomingMessage, res?: ServerResponse) => HttpJsonFetcher<LayoutServiceData>;
export type DataFetcherResolver<T> = (req?: IncomingMessage, res?: ServerResponse) => HttpJsonFetcher<T>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Think we could make an exception and use any here to avoid having 2 DataFetcherResolvers on the LayoutServiceInstanceConfig.

Suggested change
export type DataFetcherResolver<T> = (req?: IncomingMessage, res?: ServerResponse) => HttpJsonFetcher<T>;
export type DataFetcherResolver = (req?: IncomingMessage, res?: ServerResponse) => HttpJsonFetcher<any>;

fetchPlaceholderData(
placeholderName: string,
itemPath: string,
req?: IncomingMessage,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add language?: string, as 3rd parameter and pass it to getFetchOptions().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, will add

@sc-illiakovalenko sc-illiakovalenko merged commit d05e22d into dev Dec 17, 2020
@sc-illiakovalenko sc-illiakovalenko deleted the feature/439758 branch December 17, 2020 06:44
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.

3 participants