From b3826c1dc115400749a57233eac94cf06d49af71 Mon Sep 17 00:00:00 2001 From: Jaylum Chen Date: Wed, 8 Aug 2018 18:16:12 -0700 Subject: [PATCH 1/6] take url as an arg --- react/render_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react/render_server.py b/react/render_server.py index 679cc8b..b7d7d48 100644 --- a/react/render_server.py +++ b/react/render_server.py @@ -21,8 +21,9 @@ def __unicode__(self): class RenderServer(object): - def render(self, path, props=None, to_static_markup=False, request_headers=None, timeout=None): - url = conf.settings.RENDER_URL + def render(self, path, props=None, to_static_markup=False, request_headers=None, timeout=None, url=None): + if not url: + url = conf.settings.RENDER_URL if props is not None: serialized_props = json.dumps(props, cls=JSONEncoder) From 8a44adf0d9d2bb1078d759c1fae219b75005a024 Mon Sep 17 00:00:00 2001 From: Mark Finger Date: Mon, 8 Oct 2018 20:54:46 +1100 Subject: [PATCH 2/6] 4.3.0 --- CHANGELOG.md | 20 ++++++++++++++++++-- react/__init__.py | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b21d1ad..2d309cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,19 @@ Changelog ========= + +### 4.3.0 (8/10/2018) + +- Add option to pass a URL explicitly instead of reading from settings. + ([jchen-eb](https://github.com/jchen-eb)) + https://github.com/markfinger/python-react/pull/88 + + ### 4.2.1 (17/6/2018) - Fix for a missing argument bug that could occur with rendering deactivated. - ### 4.2.0 (17/6/2018) - API for returning extra items returned by render server. @@ -21,7 +28,6 @@ Changelog https://github.com/markfinger/python-react/pull/81 - ### 4.1.0 (1/3/2017) - `render_component` now accepts a `timeout` keyword argument which is passed to `RenderServer.render`. @@ -40,6 +46,7 @@ Changelog rendering. - Documentation updates regarding `RenderServer` API. + ### 3.0.1 (6/4/2016) - Documentation updates. @@ -65,6 +72,7 @@ Changelog ([Pringels](https://github.com/Pringels)) https://github.com/markfinger/python-react/pull/55 + ### 2.0.0 (22/9/2015) - **Breaking change** The base renderer's __init__ no longer accepts the RENDER_URL setting as an argument. @@ -89,6 +97,7 @@ Changelog - Fixed a potential path issue in config files - Replaced the webpack-service dependency with webpack-wrapper. + ### 0.8.0 (26/1/2015) - Boosting render performance by using a dedicated render server. @@ -97,6 +106,7 @@ Changelog render server, 'django_react.render_server.ReactRenderServer'. The legacy renderer is useable by setting DJANGO_REACT['RENDERER'] = 'django_react.renderer.ReactRenderer'. + ### 0.7.0 (2/1/2015) - Changed `django_react.exceptions.ReactComponentMissingSourceAttribute` to `django_react.exceptions.ReactComponentMissingSource` @@ -107,10 +117,12 @@ Changelog - The Python<->JS bridge used to render components now relies on a `--serialized-props-file` argument, formerly it was `--serialized-props`. - Switched the JSX loader to a fork which improves the debug information provided during error handling + ### 0.6.0 (24/12/2014) - The NODE_ENV environment setting is now controlled by the `DJANGO_REACT['DEBUG']` setting. Activating it will provides some improvements to the rendering performance. + ### 0.5.0 (14/12/2014) - Renamed `django_react.exceptions.PropSerialisationError` to `django_react.exceptions.PropSerializationError`. @@ -132,6 +144,7 @@ Changelog - Added a test suite and harness. - Added basic documentation. + ### 0.4.0 (11/12/2014) - Fixed a bug where errors caused during a component's prop serialization could silently fail. @@ -144,6 +157,7 @@ Changelog - `ReactComponent.get_component_variable` is now `ReactComponent.get_library`. - Moved the Webpack configuration into the ReactComponent class. + ### 0.3.0 (3/12/2014) - `django_react.exceptions.ReactComponentSourceFileNotFound` is now `django_react.exceptions.SourceFileNotFound` @@ -154,10 +168,12 @@ Changelog - `django_react.utils.render` no longer accepts a `ReactComponent` as an argument, it now takes `path_to_source`, `serialised_props`, and `to_static_markup`. - `django_react/render.js` no longer accepts the `--path-to-component` argument, instead it takes `--path-to-source`. + ### 0.2.0 (3/12/2014) - Replaced the post-install step in setup.py with django-node's dependency and package resolver. + ### 0.1.0 (2/12/2014) - Initial release diff --git a/react/__init__.py b/react/__init__.py index 0910eff..66cf931 100644 --- a/react/__init__.py +++ b/react/__init__.py @@ -1,3 +1,3 @@ -__version__ = '4.2.1' +__version__ = '4.3.0' default_app_config = 'react.apps.ReactConfig' \ No newline at end of file From 787a17a2fc82ce56e67b2f731154cefe59388efc Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Mon, 14 Sep 2020 11:48:57 -0300 Subject: [PATCH 3/6] Test on travis with newer versions of Python and Django --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2308405..7fcdacb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,13 @@ language: python python: - "2.7" - - "3.4" + - "3.8" env: - DJANGO_VERSION=1.7.8 - DJANGO_VERSION=1.8.1 + - DJANGO_VERSION=2.2.16 + - DJANGO_VERSION=3.1.1 install: # Install node 6 (current LTS as of January 2017) From c68dacc4d53449e5e1f049f317b1f542cabe33c0 Mon Sep 17 00:00:00 2001 From: Tim Gates Date: Mon, 28 Dec 2020 21:46:38 +1100 Subject: [PATCH 4/6] docs: fix simple typo, browswer -> browser There is a small typo in examples/frontend-rendering-with-webpack/README.md. Should read `browser` rather than `browswer`. --- examples/frontend-rendering-with-webpack/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/frontend-rendering-with-webpack/README.md b/examples/frontend-rendering-with-webpack/README.md index f7b9908..05f9421 100644 --- a/examples/frontend-rendering-with-webpack/README.md +++ b/examples/frontend-rendering-with-webpack/README.md @@ -1,7 +1,7 @@ Running the example =================== -As mentioned in the ***Using React on the front-end*** section, [Webpack](https://webpack.github.io/) is used to bundle the respective js files into `dist.js` and included in `index.html`. To make React attributes like `onClick` etc. work, the app has to be re-rendered (along with all the props passed down) when it loads on the browswer. React is intelligent enough to not re-paint the browser and only update the changes, thus adding all the component properties. +As mentioned in the ***Using React on the front-end*** section, [Webpack](https://webpack.github.io/) is used to bundle the respective js files into `dist.js` and included in `index.html`. To make React attributes like `onClick` etc. work, the app has to be re-rendered (along with all the props passed down) when it loads on the browser. React is intelligent enough to not re-paint the browser and only update the changes, thus adding all the component properties. In this example, the basic_rendering example is modified to submit the Comment Form through ajax and update the Comment List by fetching the updated comments and rendering the application with new props. From fe54b3e78fda2952d22fb32d89bf91bdebc393b9 Mon Sep 17 00:00:00 2001 From: lolivera-eb <80480298+lolivera-eb@users.noreply.github.com> Date: Mon, 5 Jul 2021 14:50:42 -0300 Subject: [PATCH 5/6] update python version --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7fcdacb..a61f73b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: python python: - "2.7" + - "3.5" + - "3.7" - "3.8" env: @@ -9,6 +11,7 @@ env: - DJANGO_VERSION=1.8.1 - DJANGO_VERSION=2.2.16 - DJANGO_VERSION=3.1.1 + - DJANGO_VERSION=1.8.19 install: # Install node 6 (current LTS as of January 2017) From 1703ebe0805fd187f54a945ca03796ece518fca1 Mon Sep 17 00:00:00 2001 From: xav <73826012+gravybrux@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:25:41 +0100 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2d4e40..b73e30c 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ rendered = render_component('path/to/component.jsx', {'foo': 'bar'}) print(rendered) ``` -The object returned has two properties: +The object returned has three properties: - `markup` - the rendered markup - `props` - the JSON-serialized props