Skip to content

Commit

Permalink
create transition package: remove all code, empty package and depend …
Browse files Browse the repository at this point in the history
…on "tetra>=0.1.0"
  • Loading branch information
nerdoc committed Apr 9, 2024
1 parent f98e255 commit 5d8418f
Show file tree
Hide file tree
Showing 99 changed files with 36 additions and 5,966 deletions.
27 changes: 16 additions & 11 deletions docs/changelog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
Title: Change Log
---
title: Changelog
---

# Change Log
# Changelog

> **Note:** Tetra is still early in its development, and we can make no promises about API stability at this stage.
>
> The intention is to stabilise the API prior to a V1 release this summer, as well as implementing some additional functionality. After V1 we will move to using [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.0.5] - 2024-04-09
### Changed
- **This is the last package with the name "tetraframework", transition to "tetra"**
- Provisional Python 3.8 support

## [0.0.3] - 2022-5-29
### Fixed
- Windows support

### Added

- `_parent` client attribute added, this can be used to access the parent component mounted in the client.
## [0.0.4] - 2022-06-22
- Cleanup

- `_redirect` client method added, this can be used to redirect to another url from the public server methods. `self.client._redirect("/test")` would redirect to the `/test` url.

## [0.0.3] - 2022-05-29
### Added
- `_parent` client attribute added, this can be used to access the parent component mounted in the client.
- `_redirect` client method added, this can be used to redirect to another url from the public server methods. `self.client._redirect("/test")` would redirect to the `/test` url.
- `_dispatch` client method added, this is a wrapper around the Alpine.js [`dispatch` magic](https://alpinejs.dev/magics/dispatch) allowing you to dispatch events from public server methods. These bubble up the DOM and be captured by listeners on (grand)parent components. Example: `self.client._dispatch("MyEvent", {'some_data': 123})`.

- `_refresh` public method added, this simply renders the component on the server updating the dom in the browser. This can be used in combination with `_parent` to instruct a parent component to re-render from a child components public method such as: `self.client._parent._refresh()`

### Changed

- Built in Tetra client methods renamed to be prefixed with an underscore so that they are separated from user implemented methods:
- `updateHtml` is now `_updateHtml`
- `updateData` is now `_updateData`
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
recursive-include tetra/static *
recursive-include tetra/js *
recursive-include tetra/templates *
prune demosites
71 changes: 17 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,25 @@

Full stack component framework for [Django](http://djangoproject.com) using [Alpine.js](https://alpinejs.dev)

Tetra is a new full stack component framework for Django, bridging the gap between your server logic and front end presentation. It uses a public shared state and a resumable server state to enable inplace updates. It also encapsulates your Python, HTML, JavaScript and CSS into one file for close proximity of related concerns.
The package `tetraframework` was renamed to `tetra`:
This is just an empty transition package that depends on `tetra`.

See examples at [tetraframework.com](https://www.tetraframework.com)
Ressources:
* https://github.com/tetra-framework/tetra
* https://www.tetraframework.com/

Read the [Documentation](https://www.tetraframework.com/docs)

```
pip install tetraframework
For new projects, install:
```bash
python -m pip install tetra
```

## What does Tetra do?

- Django on the backend, Alpine.js in the browser

Tetra combines the power of Django with Alpine.js to make development easier and quicker.

- Component encapsulation

Each component combines its Python, HTML, CSS and JavaScript in one place for close proximity of related code.

- Resumable server state

The components' full server state is saved between public method calls. This state is encrypted for security.

- Public server methods

Methods can be made public, allowing you to easily call them from JS on the front end, resuming the component's state.

- Shared public state

Attributes can be decorated to indicate they should be available in the browser as Alpine.js data objects.

- Server "watcher" methods
If you already had `tetraframework` installed, you can just upgrade it, and remove the old package afterwords:

Public methods can be instructed to watch a public attribute, enabling reactive re-rendering on the server.

- Inplace updating from the server

Server methods can update the rendered component in place. Powered by the Alpine.js morph plugin.

- Component library packaging

Every component belongs to a "library"; their JS & CSS is packed together for quicker browser downloads.

- Components with overridable blocks

Component can have multiple {% block(s) %} which can be overridden when used.

- JS/CSS builds using [esbuild](https://esbuild.github.io)

Both for development (built into runserver) and production your JS & CSS is built with esbuild.

- Source Maps

Source maps are generated during development so that you can track down errors to the original Python files.

- Syntax highlighting with type annotations

Tetra uses type annotations to syntax highlight your JS, CSS & HTML in your Python files with a [VS Code plugin](https://github.com/samwillis/python-inline-source/tree/main/vscode-python-inline-source)
```bash
# upgrade tetraframework
pip install -U tetraframework
# This will install "tetra" as dependency...

# now it should be safe to remove the old package:
pip uninstall tetraframework
```
Empty file removed demosite/demo/__init__.py
Empty file.
3 changes: 0 additions & 3 deletions demosite/demo/admin.py

This file was deleted.

6 changes: 0 additions & 6 deletions demosite/demo/apps.py

This file was deleted.

163 changes: 0 additions & 163 deletions demosite/demo/components.py

This file was deleted.

30 changes: 0 additions & 30 deletions demosite/demo/migrations/0001_initial.py

This file was deleted.

23 changes: 0 additions & 23 deletions demosite/demo/migrations/0002_todo_sessionid_alter_todo_added.py

This file was deleted.

17 changes: 0 additions & 17 deletions demosite/demo/migrations/0003_rename_sessionid_todo_session_key.py

This file was deleted.

Empty file.
9 changes: 0 additions & 9 deletions demosite/demo/models.py

This file was deleted.

Loading

0 comments on commit 5d8418f

Please sign in to comment.