Giter VIP home page Giter VIP logo

Comments (11)

janosh avatar janosh commented on May 25, 2024 1

Ah yes, that would work nicely as well!

And regarding the possibility of merging dashboard and code settings, I agree that would likely cause more trouble than it's worth.

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 25, 2024 1

Hey @syivanes! The way to go is:

  1. add settings key (optional) to the queries array
  2. read it, and call setSettings on the index to the temporary index, before it's moved to the main one
  3. test it out on the example

Ideally there'd be real tests here, but I didn't add them yet, because I was still unsure which parts of the Gatsby life cycle to mock and which not to.

This should comfortably fit in a trial & community Algolia plan, but let me know your appId if you need bigger quota.

Let me know if you have any questions!

from gatsby-plugin-algolia.

syivanes avatar syivanes commented on May 25, 2024 1

Cool! Gatsby and Algolia are both foreign to me, but I'll dig in.

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 25, 2024 1

Don't hesitate to reach out in a more direct medium like twitter DM (I'm in EU time zone though) if you have any more questions) for this!

from gatsby-plugin-algolia.

janosh avatar janosh commented on May 25, 2024 1

@Haroenv I implemented the ability to specify settings programmatically in PR #17. Also tested it.

from gatsby-plugin-algolia.

janosh avatar janosh commented on May 25, 2024 1

Okay. Would be great though, if this could be released sooner rather than later. Let me know if I can help with the tests.

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 25, 2024

It's not a feature I added initially, since you were able to set them manually, but the change to never-down indexing broke that, since it now will move that staging index into the production index.

We have two options here:

  1. gatsby-plugin-algolia is the main source of truth

adds the settings to the Gatsby plugin, always set them and override anything set in the dashboard

  1. the dashboard is the source of truth

No settings allowed via Gatsby, but it will copy over those from the main index.

I'm personally leaning towards the first option; since it allows you to declaratively set the settings with the code.

Another option is something between those two options, where we can merge from the dashboard and the code, but that's likely going to cause confusion.

What's your POV on this?

from gatsby-plugin-algolia.

janosh avatar janosh commented on May 25, 2024

What's your POV on this?

Same here. I also think declaratively is the way to go. Otherwise people who fork the repo would have to manually pick those settings, meaning you would have to include them in the readme. It's usually a lot nicer to keep everything self-contained.

Perhaps you could offer a flag by which people could choose themselves between options 1 and 2 and make option 1 the default.

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 25, 2024

One option to avoid the flag is to check if settings is available in the config, and only set & override if it's given.

from gatsby-plugin-algolia.

syivanes avatar syivanes commented on May 25, 2024

Hello guys! I need some practice and this project and issue both look interesting. Which route should I go with for the settings?

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 25, 2024

PR has been merged, I'll test some things out in the coming weeks and try to add tests, then I will release it, in the meantime you can use your own fork :)

from gatsby-plugin-algolia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.