Skip to content

Commit

Permalink
Merge branch 'release/7.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
marteinn committed Jan 7, 2023
2 parents cb781d6 + 6f6dcde commit e417bc3
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 21 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
django: ["3.2", "4.0"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
django: ["3.2", "4.0", "4.1"]
exclude:
- python-version: "3.7"
django: "4.0"
- python-version: "3.7"
django: "4.1"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -26,6 +28,7 @@ jobs:
- name: Test
run: |
python runtests.py
lint-black:
runs-on: ubuntu-latest
needs: test
Expand All @@ -35,7 +38,8 @@ jobs:
with:
options: "--check --verbose"
src: "."
version: "21.5b1"
version: "22.3.0"

lint-isort:
runs-on: ubuntu-latest
needs: test
Expand All @@ -49,7 +53,8 @@ jobs:
python -m pip install --upgrade pip
pip install isort
isort . --check-only
deploy:
publish:
runs-on: ubuntu-latest
needs: [test, lint-black, lint-isort]
steps:
Expand Down
117 changes: 117 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
### Changed
### Fixed
### Removed

## [7.0.1] - 2023-01-07

### Added
- Add changelog

### Fixed
- Add python 3.11 support (@marteinn)
- Add django 4.1 support (@marteinn)
- Fix invalid assert (code-review-doctor)

## [7.0.0] - 2022-01-04

### Fixed
- Add Django 4.0 support
- Add Python 3.10 support

### Removed
- Drop Python 2 support
- Drop Python 3.6 support
- Drop support for EOL versions of Django (1 and 2)

## [6.0.2] - 2020-09-05

### Fixed
- Make context_processor mandatory again

## [6.0.1] - 2020-08-30

### Fixed
- Solved XSS issue (@anthonynsimon, @marteinn)
- Add security policy

## [6.0.0] - 2020-04-28

### Added
- Add official support for Hypernova SSR service
- Add attribute “no_placeholder” when you want to skip the DRTT provided placeholder

### Fixed
- Add official Django 3 support (@niespodd, @marteinn)
- Remove context_processor required to run library (@niespodd)
- Solve issue with requests import (Aria Moradi)
- Use unit.patch instead of responses to mock requests (Umair)

### Removed
- Drop Django 1 support
- Drop pypy support


## [5.4.0] - 2019-04-28

### Added
- Make it possible to use your own SSRService

### Fixed
- Update docs
- Add project logo

## [5.3.0] - 2019-04-24

### Added
- Add SSRContext for passign values to SSR (@mikaelengstrom, @marteinn)
- Add support for disabling SSR using header HTTP_X_DISABLE_SSR

### Fixed
- Include example project
- Drop python 3.4 support

## [5.2.1] - 2018-08-10

### Fixed
- Add better SSR errors (thanks @mikaelengstrom)

## [5.2.0] - 2018-08-09

### Fixed
- Use render() if SSR is not available
- Fix bug when passing in standalone primitives in react_render
- Update docs

## [5.1.0] - 2018-05-22

### Added
- Add support for a replaceable tag manager (@aleehedl)
- Add configurable headers for SSR (@aleehedl, @marteinn)

## [5.1.0] - 2018-04-05

### Fixed
- Update react requirements in readme
- Change NotImplemented error to to_react_representation

### Removed
- Drop django support for django 1.10 and below
- Drop custom JSON serializer

## [4.0.0] - 2017-12-06

### Fixed
- Solved bug where to_react_representation triggered twice under SSR

### Removed
- Dropped support for django 1.8
- Removed templatetags for filters
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2021 Fröjd Interactive
Copyright (c) 2015-2023 Fröjd Interactive

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions django_react_templatetags/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"""

__title__ = "django_react_templatetags"
__version__ = "7.0.0"
__build__ = 700
__version__ = "7.0.1"
__build__ = 701
__author__ = "Martin Sandström"
__license__ = "MIT"
__copyright__ = "Copyright 2015-2021 Fröjd Interactive"
__copyright__ = "Copyright 2015-2022 Fröjd Interactive"
1 change: 0 additions & 1 deletion django_react_templatetags/ssr/hypernova.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import logging
import re

Expand Down
2 changes: 1 addition & 1 deletion django_react_templatetags/templatetags/react.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def props_to_json(resolved_data, context):
@staticmethod
def render_placeholder(attributes, component_html=""):
attr_pairs = map(lambda x: '{}="{}"'.format(*x), attributes)
return u"<div {}>{}</div>".format(
return "<div {}>{}</div>".format(
" ".join(attr_pairs),
component_html,
)
Expand Down
2 changes: 1 addition & 1 deletion django_react_templatetags/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def test_to_model_representation_data(self):
def test_unicode_chars(self):
"Tests that the data is added as correct json into the react render"

self.mocked_context["component_data"] = {"name": u"ÅÄÖ"}
self.mocked_context["component_data"] = {"name": "ÅÄÖ"}

out = Template(
"{% load react %}"
Expand Down
2 changes: 0 additions & 2 deletions django_react_templatetags/tests/test_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from django.template import Context, Template
from django.test import SimpleTestCase, override_settings

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.test import SimpleTestCase, override_settings
from django.test import SimpleTestCase

from django_react_templatetags.mixins import RepresentationMixin

Expand Down
3 changes: 0 additions & 3 deletions django_react_templatetags/tests/test_ssr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
except ImportError:
import mock

from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.urls import reverse

from django_react_templatetags.tests.demosite.models import MovieWithContext, Person


class CustomSSRService:
"Used for testing using a custom ssr service"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import logging

from .mock_response import MockResponse
Expand Down Expand Up @@ -202,7 +201,7 @@ def test_only_ssr_html_are_returned_on_no_placeholder(self, mocked):
).render(self.mocked_context)

queue = self.mocked_context["REACT_COMPONENTS"]
self.assertTrue(len(queue), 1)
self.assertEqual(len(queue), 1)
self.assertFalse(out.startswith('<div id="Component_'))


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python

import io
import os
import re
import sys
from pathlib import Path

from setuptools import find_packages, setup
Expand Down Expand Up @@ -56,9 +54,11 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Topic :: Utilities",
"Programming Language :: JavaScript",
],
Expand Down

0 comments on commit e417bc3

Please sign in to comment.