Sitecore / jss

Software development kit for JavaScript developers building web applications with Sitecore Experience Platform
https://jss.sitecore.com
Apache License 2.0
262 stars 272 forks source link

Export more types from @sitecore-jss/sitecore-jss-nextjs #1036

Closed pzi closed 2 years ago

pzi commented 2 years ago

Is your feature request related to a problem? Please describe.

The following types are not available from the nextjs package (not re-exported):

import type {ComponentConsumerProps} from '@sitecore-jss/sitecore-jss-react/types/enhancers/withSitecoreContext';

import type {ImageFieldValue} from '@sitecore-jss/sitecore-jss-react/types/components/Image';

import type {ImageProps} from '@sitecore-jss/sitecore-jss-react/types/components/Image';

import type {ImageSizeParameters} from '@sitecore-jss/sitecore-jss-react/types/components/Image';

import type {PlaceholderComponentProps} from '@sitecore-jss/sitecore-jss-react/types/components/Placeholder';

Describe the solution you'd like

Be able to import all these types from @sitecore-jss/sitecore-jss-nextjs.

Describe alternatives you've considered

Augment @sitecore-jss/sitecore-jss-nextjs to include those, or keep importing them from within @sitecore-jss/sitecore-jss-react/types

Additional information

Is there a specific reason why these types are not exposed in the nextjs pkg? It seems inconsistent as some related types are exported (e.g. LinkFieldValue), so maybe they were missed?

pzi commented 2 years ago

If all it needs is to list more exports in https://github.com/Sitecore/jss/blob/dev/packages/sitecore-jss-nextjs/src/index.ts, then I can PR it if everyone's ok with it?

ambrauer commented 2 years ago

@pzi Yep, that should be all it takes. We would gladly welcome a PR :)

pzi commented 2 years ago

@pzi Yep, that should be all it takes. We would gladly welcome a PR :)

Done :)