algolia / doc-code-samples

This repository holds the Algolia documentation big code samples like GeoSearch, Calendar...
93 stars 121 forks source link

Angular samples don't use instantsearch.css styles directly #41

Closed tkrugg closed 2 years ago

tkrugg commented 5 years ago

This makes them inconsistent with the rest of our samples https://github.com/algolia/doc-code-samples/blob/master/Angular%20InstantSearch/getting-started/angular.json#L26

Haroenv commented 5 years ago

we should probably remove the bundle alltogether

tkrugg commented 5 years ago

Agree, but that would be a breaking change. I think it should be done as part of making instantsearch.css a peerDependency of angular-instantsearch.

Btw, I see Vue IS has

I forgot what was the plan: make them both peer dependencies?

Haroenv commented 5 years ago

InstantSearch.js as a dependency or peerDependency (I'm not convinced of either, both can go bad)

InstantSearch.css as no dependency or as an optionalDependency

tkrugg commented 5 years ago

I think Instantsearch.js as a dependency is better. To me the only libs that belong to it peer dependencies are those that might be required by other libs the user might be using, typically to have a single copy of it (eg. lodash, react). It's unlikely with Instantsearch.js. WDYT?

I might be missing something but to me optionalDependencies are for system specific dependencies and doesn't apply to instantsearch.css

Haroenv commented 5 years ago

InstantSearch.css isn't required, so it isn't a peerDependency. It's either nothing at all, or an optional one.

There's still use cases where something can be imported from InstantSearch.js directly (router, connectors e.g.), but in that case we can just assume that they know too make sure it's the same version

Haroenv commented 2 years ago

the samples use InstantSearch.css now as far as I can tell