GithubHelp home page GithubHelp logo

hypernova-python's People

Contributors

dependabot[bot] avatar marteinn avatar ornj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

olpoco marteinn

hypernova-python's Issues

Jinja Integration

Integrate with Jinja or provide docs on how to do hit. Whichever makes sense.

Allow job/token name to be different than component name?

Should the lib be able to send a batch request for the same component, but with different props?
Eg, I was trying to do the following request:

{
  "Job1": {
    "name": "MyComponent",
    "data": {
      "title": "Foo",
      "content": "foo"
    }
  },
  "Job2": {
    "name": "MyComponent",
    "data": {
      "title": "Bar",
      "content": "bar"
    }
  }
}

However, I can only do this:

html = renderer.render({
    'MyComponent': {
        'title': 'Foo',
        'content': 'foo'
    },
    'MyComponent': {
        'title': 'Bar',
        'content': 'bar'
    }
})

which makes the first job be overridden by the second job because they have same component name (https://github.com/ornj/hypernova-python/blob/master/hypernova/__init__.py#L53).

I've taken a quick look at the nodejs and the ruby clients, and it seems they do it differently:

In Ruby (https://github.com/airbnb/hypernova-ruby/blob/master/lib/hypernova/batch.rb#L45), they make an array of jobs, and then make a hash with the keys being the index of the job in the array.

In Node(https://github.com/airbnb/hypernova-node/blob/master/src/index.js#L89), they use the component name as the job name (as in this lib)

Future of this project?

Hi there! You might have noticed me submitting two PR:s the last couple of weeks, I'm curious about the future of this project and how it can be more actively managed.

The reason is that I maintain a library called https://github.com/Frojd/django-react-templatetags and are looking into replacing our current SSR service with Hypernova. I did some research and found this library to be the most suitable, primarily because the code is easy to read, it does whats its supposed to without any major 3-party packages. (Yelp also has an interesting library but it is too reliant on Pyramid.)

But before adopting this library a few things needs to be done:

  • Make it fully python 3 compatible (right now this causes errors when using with the dev plugin)
  • Drop python 2 support (this can be discussed but with the python 2 EOL this a good chance to simplify management)

(I have a fork where you can see some of my fixes/implementations: https://github.com/marteinn/hypernova-python/). You can also see the hypernova integration in DRTT here: https://github.com/Frojd/django-react-templatetags/blob/develop/django_react_templatetags/ssr/hypernova.py

So my question is how - can I contribute without being a nuisance? :) (I know how open source work and just because you published a library does not mean just have any obligations)

My thoughts are this:

  • I submit PR:s like I've done before and you publish updates
  • Or you let me onboard as a maintainer or transfer project
  • Or I continue with my fork

Let me know what you think and thanks for your work so far with hypernova-python!
/ Martin

PS: Sorry for the long issue!

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.