File: CHANGELOG.md

package info (click to toggle)
ruby-batch-loader 2.0.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 296 kB
  • sloc: ruby: 788; makefile: 10; sh: 4
file content (219 lines) | stat: -rw-r--r-- 8,397 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# Changelog

The following are lists of the notable changes included with each release.
This is intended to help keep people informed about notable changes between
versions, as well as provide a rough history. Each item is prefixed with
one of the following labels: `Added`, `Changed`, `Deprecated`,
`Removed`, `Fixed`, `Security`. We also use [Semantic Versioning](http://semver.org)
to manage the versions of this gem so
that you can set version constraints properly.

#### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v2.0.6...HEAD)

* WIP

#### [v2.0.6](https://github.com/exAspArk/batch-loader/compare/v2.0.5...v2.0.6) - 2025-12-09

* `Fixed`: Double wrapping of `BatchLoader::GraphQL`. [#95](https://github.com/exAspArk/batch-loader/pull/95)

#### [v2.0.5](https://github.com/exAspArk/batch-loader/compare/v2.0.4...v2.0.5) - 2024-04-24

* `Fixed`: Warning about `BatchLoader` usage instead `BatchLoader::GraphQL` in GraphQL. [#94](https://github.com/exAspArk/batch-loader/pull/94)

#### [v2.0.4](https://github.com/exAspArk/batch-loader/compare/v2.0.3...v2.0.4) - 2024-04-02

* `Fixed`: Chaining `#execute_field` trace calls. [#93](https://github.com/exAspArk/batch-loader/pull/93)

#### [v2.0.3](https://github.com/exAspArk/batch-loader/compare/v2.0.2...v2.0.3) - 2024-03-25

* `Fixed`: `Schema.tracer(...)` GraphQL deprecation warning by making it compatible with `.trace_with(...)`. [#91](https://github.com/exAspArk/batch-loader/pull/91)

#### [v2.0.2](https://github.com/exAspArk/batch-loader/compare/v2.0.1...v2.0.2) - 2023-11-22

* `Fixed`: Compatibility with Ruby 3 kwargs. [#80](https://github.com/exAspArk/batch-loader/pull/80)

#### [v2.0.1](https://github.com/exAspArk/batch-loader/compare/v2.0.0...v2.0.1) - 2021-02-18

* `Fixed`: Compatibility with GraphQL and Ruby 3. [#71](https://github.com/exAspArk/batch-loader/pull/71)
* `Changed`: GraphQL tests. [03d5153](https://github.com/exAspArk/batch-loader/commit/03d51537bc4033fd3aab42db3eee3e9e1cb365fa)

#### [v2.0.0](https://github.com/exAspArk/batch-loader/compare/v1.5.0...v2.0.0) - 2021-02-18

* `Removed`: Support for GraphQL version <= 1.7. [#75](https://github.com/exAspArk/batch-loader/pull/75)

#### [v1.5.0](https://github.com/exAspArk/batch-loader/compare/v1.4.1...v1.5.0) - 2020-04-20

* `Added`: Support for GraphQL Interpreter. [#62](https://github.com/exAspArk/batch-loader/pull/62)
* `Deprecated`: `BatchLoader.for` in GraphQL. [#62](https://github.com/exAspArk/batch-loader/pull/62)

Please use `BatchLoader::GraphQL.for` instead:

```rb
field :user, UserType, null: false

def user # resolver
  BatchLoader::GraphQL.for...
end
```

Or wrap a BatchLoader instance with `BatchLoader::GraphQL.wrap`:

```rb
field :user, UserType, null: false

def user # resolver
  BatchLoader::GraphQL.wrap(lazy_user)
end

def lazy_user
  BatchLoader.for...
end
```

#### [v1.4.1](https://github.com/exAspArk/batch-loader/compare/v1.4.0...v1.4.1) - 2019-05-24

* `Fixes`: Does not allow mutating and corrupting a list of items in a `batch` block. [#46](https://github.com/exAspArk/batch-loader/pull/46)

#### [v1.4.0](https://github.com/exAspArk/batch-loader/compare/v1.3.0...v1.4.0) - 2019-04-29

* `Added`: new `replace_methods` argument to `BatchLoader#batch` to allow control over `define_method` calls. [#45](https://github.com/exAspArk/batch-loader/pull/45)

#### [v1.3.0](https://github.com/exAspArk/batch-loader/compare/v1.2.2...v1.3.0) - 2019-02-01

* `Added`: `BatchLoader::GraphQL.for` to make it compatible with `graphql` gem versions `>= 1.8.7`. [#30](https://github.com/exAspArk/batch-loader/issues/30)

#### [v1.2.2](https://github.com/exAspArk/batch-loader/compare/v1.2.1...v1.2.2) - 2018-12-03

* `Fixed`: Identify item by `key` object instead of `key` string representation. [#27](https://github.com/exAspArk/batch-loader/pull/27)

#### [v1.2.1](https://github.com/exAspArk/batch-loader/compare/v1.2.0...v1.2.1) - 2017-12-16

* `Fixed`: Do not depend on `method_missing` for `respond_to?`. [#14](https://github.com/exAspArk/batch-loader/pull/14)

#### [v1.2.0](https://github.com/exAspArk/batch-loader/compare/v1.1.1...v1.2.0) - 2017-11-16

* `Added`: `key` argument for the `BatchLoader#batch` method. [#12](https://github.com/exAspArk/batch-loader/pull/12)

#### [v1.1.1](https://github.com/exAspArk/batch-loader/compare/v1.1.0...v1.1.1) - 2017-11-06

* `Fixed`: `loader`, made it thread-safe again. [#10](https://github.com/exAspArk/batch-loader/pull/10)

#### [v1.1.0](https://github.com/exAspArk/batch-loader/compare/v1.0.4...v1.1.0) - 2017-11-02

* `Added`: `default_value` override option. [#8](https://github.com/exAspArk/batch-loader/pull/8)
* `Added`: `loader.call {}` block syntax, for memoizing repeat calls to the same item. [#8](https://github.com/exAspArk/batch-loader/pull/8)

#### [v1.0.4](https://github.com/exAspArk/batch-loader/compare/v1.0.3...v1.0.4) - 2017-10-12

* `Fixed`: Fix arity bug in `respond_to?` [#3](https://github.com/exAspArk/batch-loader/pull/3)

#### [v1.0.3](https://github.com/exAspArk/batch-loader/compare/v1.0.2...v1.0.3) – 2017-09-18

* `Fixed`: auto syncing performance up to 30x times compared to [v1.0.2](https://github.com/exAspArk/batch-loader/blob/master/CHANGELOG.md#v102--2017-09-14). Ruby `Forwardable` with `def_delegators` is too slow.
* `Fixed`: GraphQL performance up to 3x times by disabling auto syncing in favor of syncing with [graphql-ruby](https://github.com/rmosolgo/graphql-ruby) `lazy_resolve`.
* `Added`: more benchmarks.

#### [v1.0.2](https://github.com/exAspArk/batch-loader/compare/v1.0.1...v1.0.2) – 2017-09-14

* `Added`: `BatchLoader#inspect` method because of Pry, which [swallows errors](https://github.com/pry/pry/issues/1642).

```ruby
# Before:
require 'pry'
binding.pry

pry(main)> result = BatchLoader.for(1).batch { |ids, loader| raise "Oops" };
pry(main)> result # Pry called result.inspect and swallowed the "Oops" error
# => #<BatchLoader:0x8>
pry(main)> result.id
# => NoMethodError: undefined method `id' for nil:NilClass
```

```ruby
# After:
require 'pry'
binding.pry

pry(main)> result = BatchLoader.for(1).batch { |ids, loader| raise "Oops" };
pry(main)> result
# => #<BatchLoader:0x140653946335160>
pry(main)> result.id
# => RuntimeError: Oops
```

* `Added`: benchmarks.
* `Fixed`: caching `nil`s for not loaded values only after successful `#batch` execution.
* `Changed`: internal implementation with Ruby `Forwardable`, don't delegate methods like `object_id` and `__send__`.

#### [v1.0.1](https://github.com/exAspArk/batch-loader/compare/v1.0.0...v1.0.1) – 2017-09-03

* `Fixed`: loading `BatchLoader` by requiring `Set`.

#### [v1.0.0](https://github.com/exAspArk/batch-loader/compare/v0.3.0...v1.0.0) – 2017-08-21

* `Removed`: `BatchLoader.sync!` and `BatchLoader#sync`. Now syncing is done implicitly when you call any method on the lazy object.

```ruby
def load_user(user_id)
  BatchLoader.for(user_id).batch { ... }
end

# Before:
users = [load_user(1), load_user(2), load_user(3)]
puts BatchLoader.sync!(users) # or users.map!(&:sync)
```

```ruby
# After:
users = [load_user(1), load_user(2), load_user(3)]
puts users
```

* `Removed`: `BatchLoader#load`. Use `loader` lambda instead:

```ruby
# Before:
BatchLoader.for(user_id).batch do |user_ids, batch_loader|
  user_ids.each { |user_id| batch_loader.load(user_id, user_id) }
end
```

```ruby
# After:
BatchLoader.for(user_id).batch do |user_ids, loader|
  user_ids.each { |user_id| loader.call(user_id, user_id) }
end
```

* `Changed`: use `BatchLoader::GraphQL` in GraphQL schema:

```ruby
# Before:
Schema = GraphQL::Schema.define do
  # ...
  lazy_resolve BatchLoader, :sync
end
```

```ruby
# After:
Schema = GraphQL::Schema.define do
  # ...
  use BatchLoader::GraphQL
end
```

#### [v0.3.0](https://github.com/exAspArk/batch-loader/compare/v0.2.0...v0.3.0) – 2017-08-03

* `Added`: `BatchLoader::Executor.clear_current` to clear cache manually.
* `Added`: tests and description how to use with GraphQL.

#### [v0.2.0](https://github.com/exAspArk/batch-loader/compare/v0.1.0...v0.2.0) – 2017-08-02

* `Added`: `cache: false` option to disable caching for resolved values.
* `Added`: `BatchLoader::Middleware` to clear cache between Rack requests.
* `Added`: more docs and tests.

#### [v0.1.0](https://github.com/exAspArk/batch-loader/compare/ed32edb...v0.1.0) – 2017-07-31

* `Added`: initial functional version.