Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Sep 3, 2024
1 parent a556d1f commit e2b8f41
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ export default defineConfig({
themeConfig: {
nav: [
{ text: "Home", link: "/" },
{ text: "Community", link: "/community" },
{ text: "Community", link: "project/community" },
{ text: "Guide", link: "/guide" },
],
sidebar: [
{
text: "Project",
collapsed: false,
items: [{ text: "Community", link: "/project/community" }],
},
{
text: "Guide",
collapsed: false,
Expand All @@ -18,6 +23,7 @@ export default defineConfig({
{ text: "Setup", link: "/guide/setup" },
{ text: "Your first component", link: "/guide/first-component" },
{ text: "Under the hood", link: "/guide/under-the-hood" },
{ text: "Attributes deep-dive", link: "/guide/attributes" },
],
},
{
Expand All @@ -32,8 +38,9 @@ export default defineConfig({
text: "Rails",
collapsed: false,
items: [
{ text: "Streaming", link: "/reference/rails/streaming" },
{ text: "Helpers", link: "/reference/rails/helpers" },
{ text: "Generators", link: "/reference/rails/generators" },
{ text: "Streaming", link: "/reference/rails/streaming" },
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion design/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The most expensive (performance-wise) process in Phlex is building attributes, w

Phlex supports all kinds of attributes including deeply-nested hashes, arrays, sets, strings, symbols, boolean values and even custom objects. It even has special handling for `class` and `style` attributes.

Attributes need to be calculated thousands of times per render. One advantage we have is attributes are always calculated the same way. The same Hash will always produce the same String of HTML.
Attributes need to be calculated thousands of times per render. One advantage we have is attributes are always calculated the same way. The same hash will always produce the same string of HTML.

This problem lends itself well to caching. If we store the result of the first calculation, we can then resuse it the next time we get the same set of attributes.

Expand Down
19 changes: 19 additions & 0 deletions guide/attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Attributes deep dive

You’ve just rebuilt 90% of Phlex so you know a thing or two about rendering attributes.

## `String` and `Symbol` keys

## `String` and `Symbol` values

## `Array` and `Set` attributes

## Nested `Hash` attributes

## The `style` attribute

## The `class` attribute

## Custom objects as attribute values

## Boolean attributes
File renamed without changes.

0 comments on commit e2b8f41

Please sign in to comment.