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

demo should be easy to read #98

Closed
vvo opened this issue Sep 17, 2015 · 6 comments
Closed

demo should be easy to read #98

vvo opened this issue Sep 17, 2015 · 6 comments
Assignees
Milestone

Comments

@vvo
Copy link
Contributor

vvo commented Sep 17, 2015

use the standard build and standard js file instead of a full webpack example.

@vvo vvo self-assigned this Sep 17, 2015
@vvo
Copy link
Contributor Author

vvo commented Sep 17, 2015

@redox Not sure how to deal with it.

Currently the templates are well separated in example/templates/*.html. If I start rewriting the demo "old school" then I will need to put the templates either in the js files or in the main html file. It would be a pain for us then to update it.

If the goal is for the user to understand the underlying code, we can definitely link from the demo page to the github example/ folder where it will be easier to them to understand.

@redox
Copy link
Contributor

redox commented Sep 17, 2015

I would rather do something like:

<script src="//cdn,jsdelivr.com/............/latest/instantsearch.js"></script>
<!-- or -->
<script src="../dist/instantsearch.js"></script>

<script>
$(function() {
  var search = instantsearch(....);

  search.addWidget(
    instantsearch.widgets.searchBox({
      container: '#q-container',
      cssClass: 'form-control input-lg'
    })
  );

 // [...]  

  search.start();
});
</script>

@vvo
Copy link
Contributor Author

vvo commented Sep 17, 2015

I would rather do something like:

Yes that's what I wanted to do, but then, where do we store the templates?

I do not want to again include templates in <script> inside the main html file etc.. and showing it to our users. This is a bad practice we give to our users in the end. It cripples the html file and prevent the templates to be cached (and the js to be cached).

I'd rather prefer them to discover the underlying simple webpack config file and great things like require('template.html').

From a documentation point of view we will do the straightforward things: no webpack advice etc.. But still, as for our own code, the fact that we do use webpack should not be an issue for them.

If they want to see the code and templates I will link to the github project.

Even inlining everything will have it's own limit, we would end up with a very big html file. If the user is smart enough to "view source" then it will be no problem for him to come to github I am sure.

What do you think?

@redox
Copy link
Contributor

redox commented Sep 17, 2015

I do not want to again include templates in <script> inside the main html file etc.. and showing it to our users. This is a bad practice we give to our users in the end. It cripples the html file and prevent the templates to be cached (and the js to be cached).

I get your point but that's what we're gonna do in most integrations.

But still, as for our own code, the fact that we do use webpack should not be an issue for them.

Sure fair enough, but let's just make it readable by including the dist file + another non-minified include with the templates and the widgets setup; most users don't want to understand the github repository/build system when looking at a demo.

<script src="//cdn,jsdelivr.com/............/latest/instantsearch.js"></script>
<!-- or -->
<script src="../dist/instantsearch.js"></script>

<script src="app.js"></script>
  var hitTemplate = '......'; /* require("hit.html") */

  var search = instantsearch(....);

  search.addWidget(
    instantsearch.widgets.searchBox({
      container: '#q-container',
      cssClass: 'form-control input-lg'
    })
  );

 // [...]  

  search.start();

@pixelastic pixelastic added this to the backlog milestone Sep 28, 2015
redox added a commit that referenced this issue Oct 9, 2015
Split the example and library bundle files into several ones to improve
the readability of the example while inspecting the source code.
Fix #98
@redox redox assigned redox and unassigned vvo Oct 9, 2015
@redox redox closed this as completed Oct 9, 2015
@redox redox removed the in progress label Oct 9, 2015
@redox redox reopened this Oct 9, 2015
@vvo
Copy link
Contributor Author

vvo commented Oct 9, 2015

You want to keep track of the issue thats it? Wfm

@redox
Copy link
Contributor

redox commented Oct 9, 2015

Wrong waffle manipulation actually :)

@vvo vvo added the wontfix label Oct 9, 2015
@vvo vvo closed this as completed Oct 9, 2015
@vvo vvo removed the in progress label Oct 9, 2015
sarahdayan pushed a commit that referenced this issue Dec 12, 2022
* fix(panel): align button and make clearer

fixes #97

* chore: remove headerText
sarahdayan pushed a commit that referenced this issue Dec 14, 2022
* fix(panel): align button and make clearer

fixes #97

* chore: remove headerText
dhayab pushed a commit that referenced this issue Jul 10, 2023
  * FIX : algolia/algoliasearch-helper-js#29 Avoid callback for outdated queries
  * FIX : algolia/algoliasearch-helper-js#64 Sum up the processing time of all queries
  * FIX : algolia/algoliasearch-helper-js#92 Parameters that can be set in the dashboard shouldn't have defaults
  * FIX : algolia/algoliasearch-helper-js#62 Make sure disctinct is set to false when it's not possible to use distinct in Algolia
  * FEATURE : algolia/algoliasearch-helper-js#91 Support for tags (with support for the raw format #98)
  * FEATURE : algolia/algoliasearch-helper-js#70 Ability to get all refined values : helper.getRefinements( facetname )
  * FEATURE : algolia/algoliasearch-helper-js#51 multiple filters for a single conjunctive facet (tests)
  * FEATURE : Ability to modify any parameter of the state easily (algolia/algoliasearch-helper-js#76 #84 #12)
  * FEATURE : algolia/algoliasearch-helper-js#69 Ability to know if a facet is refined, whatever the value
  * FEATURE : algolia/algoliasearch-helper-js#86 Expose SearchParameters, AlgoliaSearchHelper, SearchResults to users directly in the builds
  * FEATURE : algolia/algoliasearch-helper-js#25 let the user do a clearRefinement with a function as a filter
  * REFACTORING : SearchParameters is immutable (algolia/algoliasearch-helper-js#14)
  * REFACTORING : Ensure SearchParameters is totally frozen (algolia/algoliasearch-helper-js#14)
  * LIB : Update lodash version to 3.9.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants