ornj / hypernova-python Goto Github PK
View Code? Open in Web Editor NEWPython client for Hypernova https://github.com/airbnb/hypernova
License: MIT License
Python client for Hypernova https://github.com/airbnb/hypernova
License: MIT License
Integrate with Jinja or provide docs on how to do hit. Whichever makes sense.
Create an exception for plugins that can be caught to trigger on_error
.
If the Hypernova service is not available, throw on error and render fall back
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)
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:
(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:
Let me know what you think and thanks for your work so far with hypernova-python!
/ Martin
PS: Sorry for the long issue!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.