Skip to content

Commit 5efb6f8

Browse files
committed
update changes section of readme
1 parent 9ee4857 commit 5efb6f8

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,37 @@ mix task.
6363

6464
## Upgrading to v0.10
6565

66-
Version 0.10 of Scenic contains breaking changes, which will need to be updated in your app in order to run. This is all good through as it enables goodness in the forms of proper font metrics and dynamic raw pixel textures.
67-
68-
### Changes to the Cache
66+
Version 0.10 of Scenic contains both deprecations and breaking changes, which will need to be updated in your app in order to run. This is all good through as it enables goodness in the forms of proper font metrics and dynamic raw pixel textures.
67+
68+
### Deprecations
69+
70+
* `push_graph/1` is deprecated in favor of returning `{:push, graph}`
71+
([keyword](https://hexdocs.pm/elixir/Keyword.html)) options
72+
from the `Scenic.Scene` callbacks. Since this is only a deprecation `push_graph/1` will
73+
continue to work, but will log a warning when used. `push_graph/1` will be removed in a
74+
future release.
75+
* This allows us to utilize the full suite of OTP GenServer callback behaviors (such as
76+
timeout and `handle_continue`)
77+
* Replacing the call of `push_graph(graph)` within a callback function depends slightly
78+
on the context in which it is used.
79+
* in `init/2`:
80+
* `{:ok, state, [push: graph]}`
81+
* in `filter_event/3`:
82+
* `{:halt, state, [push: graph]}`
83+
* `{:cont, event, state, [push: graph]}`
84+
* in `handle_cast/2`:
85+
* `{:noreply, state, [push: graph]}`
86+
* in `handle_info/2`:
87+
* `{:noreply, state, [push: graph]}`
88+
* in `handle_call/3`:
89+
* `{:reply, reply, state, [push: graph]}`
90+
* `{:noreply, state, [push: graph]}`
91+
* in `handle_continue/3`:
92+
* `{:noreply, state, [push: graph]}`
93+
94+
### Breaking Changes
95+
96+
##### Changes to the Cache
6997

7098
The most important (and immediate) change you need to deal with is to the cache. In order to handle static items with different life-cycle requirements, the cache has been broken out into multiple smaller caches, each for a specific type of content.
7199

@@ -78,13 +106,13 @@ The module `Scenic.Cache` is gone and should be replace with the appropriate cac
78106
| Font Metrics | `Scenic.Cache.Static.FontMetrics` |
79107
| Dynamic Textures | `Scenic.Cache.Dynamic.Texture` |
80108

81-
### Static vs. Dynamic Caches
109+
##### Static vs. Dynamic Caches
82110

83111
Note that caches are marked as either static or dynamic. Things that do not change and can be referred to by a hash of their content go into Static caches. This allows for future optimizations, such as caching these assets on a CDN.
84112

85113
The Dynamic.Texture cache is for images that change over time. For example, this could be an image coming off of a camera, or something that you generate directly in your own code. Note that Dynamic caches are more expensive overall as they will not get the same level of optimization in the future.
86114

87-
### Custom Fonts
115+
##### Custom Fonts
88116

89117
If you have used custom fonts in your application, you need to use a new process to get them to load and render.
90118

0 commit comments

Comments
 (0)