Live data from Hacker News

Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

github.com

41–46 of 46 posts

Re: Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

#41

Earlier quoted context omitted.

Hi, I'm a Redux maintainer. We're currently working on a package called `redux-starter-kit` that contains some utilities to help simplify common concerns about Redux, including store setup, generating action creators, and writing reducer logic and immutable updates: https://github.com/reduxjs/redux-starter-kit I'd appreciate it if you could take a look, try it out, and give us some feedback. It's currently JS-only, b…

Hi, I've not actually used redux at any scale but I have used react a lot (sounds silly?). I was wondering, would it be possible to have something like a strict subset of redux with minimal boilerplate and very few and very simple API functions which are redux compatible. But which can eventually be swapped with the full Redux library if need be?

No, not really. Redux itself _is_ already small - if you strip out the safety checks, it's less than 100 lines [0], and you can see the core concept in less than 25 [1].

Part of the issue is that people use the word "boilerplate" to refer to many different things, such as writing action creator functions, writing immutable update logic, calling `connect()` to generate wrapper components that talk to the Redux store, etc. Everyone seems to have a different thing that they are concerned about.

The "starter kit" package I linked tries to address several of the most common concerns, while still keeping Redux the way it's meant to be used.

[0] https://gist.github.com/gaearon/ffd88b0e4f00b22c3159

[1] https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-ta...

Re: Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

#42

Earlier quoted context omitted.

Thanks, it started out as regular, valid JS, then I figured I might as well convert it to TypeScript, and I did so (perhaps too) quickly. I do plan to add stronger typing later.

What advantages did you get from typescript? Seems like type safety is a huge trade off from what you lost by adding those amounts of complexity, especially when you’re not really utilising it.

Honestly, I'm using it for it's marketability. I haven't yet found it particularly useful.

Re: Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

#43

Earlier quoted context omitted.

I agree but I’d pick graphql for that instead of typescript.

Not sure TypeScript and GraphQL are mutually exclusive.

They aren’t, but graphql would give you safer types in your api than typescript.

Re: Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

#44
post #18

Earlier quoted context omitted.

Hi, I'm a Redux maintainer. We're currently working on a package called `redux-starter-kit` that contains some utilities to help simplify common concerns about Redux, including store setup, generating action creators, and writing reducer logic and immutable updates: https://github.com/reduxjs/redux-starter-kit I'd appreciate it if you could take a look, try it out, and give us some feedback. It's currently JS-only, b…

I know this is going to sound like blasphemy, but is the TS version also going to support Angular?

You can already use Redux with any UI layer or framework, whether it be React, Angular, Vue, jQuery, or vanilla JS.

The starter kit package just provides some additional utilities for common use cases. You could use it in a TS app already, you'd just have to stub out the type declarations yourself. Reworking the package to be written in TS is mostly to allow easier integration with users building their apps in TS.

Re: Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

#45
post #8

I see that you are scraping the results directly, curious if you’d tried out Google’s json search api? Any thoughts about it? I was about to need it or similar for a project.

Google's json search api gives you a consistent easy to parse api.

However it requires a Google API key, which limits free usage.

Client-side scraping scales effectively, as it distributes the reads onto all the clients. But it's also more brittle, as Google could change a small implementation of their search and break all the scraping functions.

Re: Show HN: I Built a Metasearch Engine with React, Redux, Express and TypeScript

#46

Earlier quoted context omitted.

Not sure TypeScript and GraphQL are mutually exclusive.

They aren’t, but graphql would give you safer types in your api than typescript.

Not sure one gives you safer typing than the other in absolute. They both have a different context/purpose. TypeScript is great for typing a code base for function calls type of APIs, whereas GraphQL is great to express types for inter-system communication (usually over HTTP).

Using GraphQL to type your in-process API would be overkilled and would require quite a bit of contortionism, and while you can share same TypeScript types between your end-points interfaces (and can be a good first step), inter-process communication is better expressed with something like GraphQL or Protobuf.

Post reply on HN