Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Repository vs ContentTypes and Schemas #68

Closed
gallayl opened this issue Oct 6, 2017 · 1 comment
Closed

Repository vs ContentTypes and Schemas #68

gallayl opened this issue Oct 6, 2017 · 1 comment

Comments

@gallayl
Copy link
Contributor

gallayl commented Oct 6, 2017

The problem:

At the moment the generated classes (ContentTypes, Schemas, etc...) are bundled together with sn-client-js and tightly coupled with the Repository object. In that way we can not extend or add content types from different packages (e.g. if we want install the types from the Services, Webpages and our custom solution), the only way is to overwrite the whole ContentTypes library inside sn-client-js

Suggestion

In the future we should distribute ContentTypes in a different NPM package (see #67, e.g. @sensenet/content-services), maybe alongside with backend dependency releases and we should allow to add Content Types and Schemas

import { servicesContentTypes, servicesSchemas } from '@sensenet/content-services';
import { customerContentTypes, customerSchemas } from '../customer-related-stuff';
import { MyCustomizedRepository } from '../'

const myCustomizedRepository = new MyCustomizedRepository({
             // options
             ContentTypes: [servicesContentTypes, customerContentTypes],
             Schemas: [servicesSchemas, customerSchemas]
});

TBD

  • Conflict between different packages and their content - Is it possible?
@gallayl
Copy link
Contributor Author

gallayl commented Jan 2, 2018

The ticket is obsolete.

@gallayl gallayl closed this as completed Jan 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants