Skip to content
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
8 changes: 4 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Fragment auto update is removed as the feature seemed too brittle to use.
Instead I'm encouraging users do this by themselves on the front using standard
redux reducers. The fragment functionality has been changed to as a way to
optionally tag your nodes with information about the partial being used, the
path where the tag occured and the name you give to it. You can use this information to iterate across all your pages in your own reducer.:
path where the tag occurred and the name you give to it. You can use this information to iterate across all your pages in your own reducer.:

```
fragments: [
Expand Down Expand Up @@ -219,14 +219,14 @@ your rails initializer to call `Props.reset_encoder!`
- `render_collection` like behavior (single lookup for a partial) for `json.array!(partial: 'foobar)'`
- Explicit control over node traversal via search options e.g `json.foobar(search:'foobar.posts.id=1')`
- Renders `json` instead of `js`
- BreezyJS no longer uses Server Generated Javascript Responses. It uses JSON and is now easier to use your favorite JSON browser plugin to see the JSON version of your page, for example: `localhost:3000/posts.json`
- BreezyJS no longer uses Server Generated JavaScript Responses. It uses JSON and is now easier to use your favorite JSON browser plugin to see the JSON version of your page, for example: `localhost:3000/posts.json`
- Breezy Rails controller requirements is simplified, no macros needed just plain Rails, be sure to `rails generate scaffold post` or `rails breezy:install:web` to see what changed.

## v0.12.0

- Update tests for rails 6
- Remove support for rails 4
- Update gemspec, removed some unneeded dependancies
- Update gemspec, removed some unneeded dependencies
- Use JSON.dump instead of MultiJSON
- Remove dead comments and methods
- Drop pessimistic version constraint
Expand All @@ -244,7 +244,7 @@ BREAKING CHANGE: Rename `_bz` param to `bzq`
- BREAKING CHANGE: All keys `json.my_key_here` in BreezyTemplate will `key_format` to camelCase `{"myKeyHere": 'foobar'}`. This makes working with props received via `mapStateToProps` easier to work with.
- FIX: `remote` now merges joints on graft requests
- BREAKING CHANGE: `remote` will update all joints before fetching nodes when using deferment. The previous behavior was to update after all deferred fetches were finished, but this caused some issues and confusion around proper behavior. This will be the fix for now.
- NEW: Breezy now dispatches `@@breezy/GRAFTING_ERROR`. This is a listenable action that you can use to retry deferments that fail due to network errors. You will recieve the `pageKey`, the `url` that failed, and the `keyPath` to the missing node.
- NEW: Breezy now dispatches `@@breezy/GRAFTING_ERROR`. This is a listenable action that you can use to retry deferments that fail due to network errors. You will receive the `pageKey`, the `url` that failed, and the `keyPath` to the missing node.
- `remote` now has a fallback `pageKey` if one isn't provided.
- `ensureSingleVisit`, the function that powers `visit` is now exposed for use. Come in super handy when you want to create your own `visit` function. For example, instaclick functionality.
- BREAKING CHANGE: Remove immutable helpers. It doesn't seem like good practice to create immutable action creators, probably doing too much work for the user and makes testing more difficult. Instead recommend and document immmer usage and keep getIn (exported for traversing), and setIn (for internal use) around.
Expand Down
2 changes: 1 addition & 1 deletion docs/deferments.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ then immutably grafts that payload into the `/dashboard` page at the path
}
```

Your page component finally recieves the new props and rerenders. For more
Your page component finally receives the new props and rerenders. For more
control, you may provide a `success_action` or `fail_action`, and Superglue
will dispatch these actions when the promise resolves successfully or fails.

Expand Down
2 changes: 1 addition & 1 deletion docs/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ update(toFragmentRef('userCart'), (cartDraft) => {
})
```

In the example, you recieve an immer draft of the fragment and you can mutate it however you want.
In the example, you receive an immer draft of the fragment and you can mutate it however you want.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ And of course, batteries are included:
Turbo Streams [ported](./super-turbo-streams.md) for Superglue and React. Use `broadcast_append_to`
and more to easily update your UI.

- **Unobtrusive Javascript (UJS)**
- **Unobtrusive JavaScript (UJS)**

[Bringing back](ujs.md) a classic to make developing SPA features easy and familiar

Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/spa-pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ user, only the posts list changes, but the header stays the same.

!!! info
In effect, this achieves the same functionality as [Turbo Frames], but
Superglue leans more on Unobtrusive Javascript for better ergonomics.
Superglue leans more on Unobtrusive JavaScript for better ergonomics.

[Turbo Frames]: https://turbo.hotwired.dev/handbook/frames

Expand Down
2 changes: 1 addition & 1 deletion docs/redux-state-shape.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ both as `/posts`.
### `fragments`

[Fragments](./fragments.md) are rendered Rails partials with an identity. They're created when a
response is recieved. Superglue takes the payload and [denormalizes](./fragments.md#denormalization) it into
response is received. Superglue takes the payload and [denormalizes](./fragments.md#denormalization) it into
fragments and fragment refs.

```js
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ The root state for a Superglue application. It occupies
| Property | Type | Description | Defined in |
| ------------------------------------ | ----------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="superglue"></a> `superglue` | [`SuperglueState`](#supergluestate) | Contains readonly metadata about the current page | [types/index.ts:371](https://github.com/thoughtbot/superglue/blob/38ea0f22384ca668ffa28ead0054dc09a0f39366/superglue/lib/types/index.ts#L371) |
| <a id="pages"></a> `pages` | [`AllPages`](#allpages)\<`T`\> | Every [PageResponse](#pageresponse) that superglue recieves is stored here. | [types/index.ts:373](https://github.com/thoughtbot/superglue/blob/38ea0f22384ca668ffa28ead0054dc09a0f39366/superglue/lib/types/index.ts#L373) |
| <a id="pages"></a> `pages` | [`AllPages`](#allpages)\<`T`\> | Every [PageResponse](#pageresponse) that superglue receives is stored here. | [types/index.ts:373](https://github.com/thoughtbot/superglue/blob/38ea0f22384ca668ffa28ead0054dc09a0f39366/superglue/lib/types/index.ts#L373) |
| <a id="fragments-3"></a> `fragments` | [`AllFragments`](#allfragments) | - | [types/index.ts:374](https://github.com/thoughtbot/superglue/blob/38ea0f22384ca668ffa28ead0054dc09a0f39366/superglue/lib/types/index.ts#L374) |
| <a id="flash-3"></a> `flash` | [`FlashState`](#flashstate) | - | [types/index.ts:375](https://github.com/thoughtbot/superglue/blob/38ea0f22384ca668ffa28ead0054dc09a0f39366/superglue/lib/types/index.ts#L375) |

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/types.requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Defined in: [types/requests.ts:133](https://github.com/thoughtbot/superglue/blob

A callback that fires in between recieving a payload and saving a
payload. Use this callback to modify the payload before it gets saved. Its
useful for appending, prepending, shuffeling, etc. recieved data to
useful for appending, prepending, shuffeling, etc. received data to
existing data.

`prevPage` is `undefined` when there is no existing page in the store
Expand Down
2 changes: 1 addition & 1 deletion docs/requests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Requests

If you prefer to navigate using Javascript, or need more functionality than what UJS
If you prefer to navigate using JavaScript, or need more functionality than what UJS
offers, Superglue comes with two functions built around `fetch`, `visit` and
`remote`. These are wrapped with your own implementation in
[application_visit.js] and can be accessed via the [NavigationContext].
Expand Down
4 changes: 2 additions & 2 deletions docs/shaping.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ transform data, do it on the server side.

Superglue encourages you to shape UI state on the server because

1. Ruby combined with Rails view heleprs is just as good, if not better, than Javascript at shaping state for React components.
1. Ruby combined with Rails view heleprs is just as good, if not better, than JavaScript at shaping state for React components.

2. UI patterns are universal - headers, footers, a body with a list of items exist in every app. Business logic varies wildly, but these presentational structures remain constant. This creates immediate intuition; a developer can easily guess the shape of the store, and make close-to-correct assumptions on how to update the store without looking at any code.

Expand All @@ -78,7 +78,7 @@ Superglue encourages you to shape UI state on the server because
Conventional Rails wisdom discourages excessive view logic, but `.props` templates don't have the usual structural markup that you'd find with ERB templates. Its not uncommon to see more logic in your views.

!!! note
You can think of `.props` as a presentational layer for your React components. We keep most of the UI state on the server the simplify the amount of Javascript we need.
You can think of `.props` as a presentational layer for your React components. We keep most of the UI state on the server the simplify the amount of JavaScript we need.

```ruby
daily_events = @events
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,14 @@ Update `app/controllers/items_controller.rb` to handle toggle submissions

What we've built so far is a multi-page application backed by classic Rails
conventions with a touch of React. Lets progressively add SPA navigation to
forms and links by bringing back a Rails favorite: [Unobtrusive Javascript](ujs.md)
forms and links by bringing back a Rails favorite: [Unobtrusive JavaScript](ujs.md)

=== "`show.jsx`"
Update `app/views/shopping_lists/show.jsx`

!!! Note
Setting a HTTP method like `put` on a `<a>` tag is not supported with
Unobtrusive Javascript. This is by design. Instead, create a form that
Unobtrusive JavaScript. This is by design. Instead, create a form that
looks like a link. This is inspired by
[link_to](https://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to).

Expand Down Expand Up @@ -742,7 +742,7 @@ GET /shopping_list?props_at=data.totalCost
## Digging with `props_at`

The second step behind the scenes is called [digging](./digging.md). You can
use the same `props_at` pattern with [Unobtrusive Javascript](./ujs.md) via
use the same `props_at` pattern with [Unobtrusive JavaScript](./ujs.md) via
`data-sg-remote` or with [requests](./requests.md).

Here's how reloading a part of the screen would look like:
Expand Down Expand Up @@ -856,7 +856,7 @@ controller, go ahead and reload the page. Everything should still work.
if @item.save
- redirect_to root_path, notice: 'Item added successfully!'
+ respond_to do |format|
+ flash[:notice] = "Item added succesfully"
+ flash[:notice] = "Item added successfully"
+ format.html { redirect_to root_path }
+ format.json { render layout: "stream" }
+ end
Expand Down Expand Up @@ -1020,7 +1020,7 @@ And broadcast it from the controller.
+ )

respond_to do |format|
flash[:notice] = "Item added succesfully"
flash[:notice] = "Item added successfully"
format.html { redirect_to root_path }
format.json { render layout: "stream" }
end
Expand Down
2 changes: 1 addition & 1 deletion docs/ujs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The return of Rails UJS

Unobtrusive Javascript is an easy way to added single page app like features to
Unobtrusive JavaScript is an easy way to added single page app like features to
HTML links and form tags. Its taken a backseat since the introduction of Hotwire,
but Superglue puts UJS back in the forefront and packs it with functionality
that makes building SPA-like functionality easy and consistent.
Expand Down
Loading