Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/pre 1.0.2 #40

Merged
merged 12 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -27,17 +27,17 @@ jobs:
needs: [build]
strategy:
matrix:
python-version: [3.8, 3.9]
node-version: [16.x, 18.x]
django-version: [3.2, 4.0]
python-version: ['3.8', '3.9', '3.10']
node-version: [18.x, 20.x]
django-version: [3.2, 4.2]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Django ${{ matrix.django-version }}
Expand All @@ -60,17 +60,17 @@ jobs:
needs: [build]
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
node-version: [16.x, 18.x]
flask-version: [1.1.4, 2.2.2]
python-version: ['3.8', '3.9', '3.10']
node-version: [18.x, 20.x]
flask-version: [1.1.4, 2.2.2, 3.0.0]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Flask ${{ matrix.flask-version }}
Expand Down
9 changes: 5 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ $ cd frontend

# install dependency packages
$ npm install

# build js, scss files
$ npm run start
```

Now you can load bundle file in templates like
Now you can load bundle js and css files in template

```html
{% stylesheet_pack 'app' %}
{% javascript_pack 'app' 'app2' attrs='charset="UTF-8"' %}
{% javascript_pack 'app' %}
```

!!! note
1. You can import multiple entry files using one `javascript_pack` statement
1. You can import **multiple entry files** using `stylesheet_pack` and `javascript_pack` (`{% javascript_pack 'app' 'app2'`)
1. The `javascript_pack` would also **import dependency files automatically to handle code splitting**
1. You can use `attrs` to set custom attributes
1. You can use `attrs` to set custom attributes, (`{% javascript_pack 'app' attrs='charset="UTF-8"' %}`)
6 changes: 3 additions & 3 deletions docs/setup_with_django.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ frontend

```bash
$ node -v
v18.12.1
v20.9.0
$ npm -v
8.19.2
10.1.0
```

Now go to `frontend`
Expand Down Expand Up @@ -198,7 +198,7 @@ Add `index.html` to the above `example/templates`
</div>
</div>

{% javascript_pack 'app' 'app2' attrs='charset="UTF-8"' %}
{% javascript_pack 'app' %}

</body>
</html>
Expand Down
6 changes: 3 additions & 3 deletions docs/setup_with_flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ frontend

```bash
$ node -v
v18.12.1
v20.9.0
$ npm -v
8.19.2
10.1.0
```

Now go to `frontend`
Expand Down Expand Up @@ -166,7 +166,7 @@ Add `index.html` to `templates`
</div>
</div>

{{ javascript_pack('app', 'app2', attrs='charset="UTF-8"') }}
{{ javascript_pack('app', attrs='charset="UTF-8"') }}

</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest==6.2.2
pytest==7.4.3
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties"
"@babel/plugin-transform-class-properties"
]
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
lts/iron
Loading