Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp docs, provide better composition utilities #936

Merged
merged 59 commits into from
Jul 9, 2023

Conversation

NullVoxPopuli
Copy link
Owner

@NullVoxPopuli NullVoxPopuli commented Jul 3, 2023

Docs

Quick links to rendered versions

  1. Introduction
  2. Resources
  3. In Ember

TODOs

  • what is a cell?
    • can resources be used without cells?
      (yes, any reactive state can be used within, around, and passed to a resource, but ember has not had a good enough primitive -- so that's where cell steps in -- tracked could be thought of as a wrapper around a cell)
  • why does cleanup matter?
  • Frame as primitive
    • when learning a reactive system / library resources are about the third primitive you'd learn values, functions, and then functions with cleanup.
  • have a README.md in the docs folder, which is the highest level overview of reactivity
    • what are ember-octane's reactive primitives?
    • how can we reframe reactive-primitives to be more portable?
      why do we care about them being more portable?
    • how does starbeam fit in?
    • (link to resource.md)
  • on the ember.md page, show the "anatomy" of a few resources, pointing out the "reactive function", "reactive state", etc

Some TypeScript sins for reference

@stackblitz
Copy link

stackblitz bot commented Jul 3, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@changeset-bot
Copy link

changeset-bot bot commented Jul 3, 2023

🦋 Changeset detected

Latest commit: 64ae254

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ember-resources Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

Estimated impact to a consuming app, depending on which bundle is imported

js min min + gzip min + brotli
/index.js 23.15 kB 4.13 kB 1.61 kB 1.41 kB
├── core/class-based/index.js 8.38 kB 1.88 kB 929 B 798 B
├── core/function-based/index.js 8.94 kB 982 B 397 B 345 B
└── core/use.js 4.61 kB 415 B 256 B 203 B
/link.js 2.67 kB 380 B 234 B 186 B
/service.js 14.15 kB 2.71 kB 1.1 kB 935 B
/util/cell.js 3.64 kB 1.38 kB 621 B 527 B
/util/debounce.js 3.08 kB 865 B 436 B 357 B
/util/ember-concurrency.js 5.07 kB 1.59 kB 754 B 644 B
/util/fps.js 3.15 kB 904 B 469 B 375 B
/util/function.js 7.99 kB 2.71 kB 991 B 854 B
/util/helper.js 2.12 kB 303 B 218 B 177 B
/util/keep-latest.js 2.08 kB 512 B 296 B 235 B
/util/map.js 6 kB 2.5 kB 1.11 kB 935 B
/util/remote-data.js 7.97 kB 2.38 kB 798 B 697 B

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

Copy link
Contributor

@wagenet wagenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation looks good other than the issues I called out.

});
```

To see this code in action, [checkout the live demo](https://limber.glimdown.com/edit?c=MQAggiDKAuD2AOB3AhtAxgCwFBbbAJgKYgBmhAdmsdMgOYDOIay5IARsQK72H4hwh8ASwBOhNNAA2ATxBjyREU1gBbeLHIVo9ADRZkjRIUmSQBuRUX8MxPERD1yQ%2BPELRrxSUIButgn5VCRhIRVQA6HAB5eGghDXoALhwAWhAAAy9fNJBUgH15RUYhVnhJZCpcrFSMn2J4MW8hQkRs-MtCESKSsqodEFLy4toPB1hOESozEmgOkcziAo7K6vn%2BhqbEdmNYFpA2hQ6u-p7CPoG0IbnaiwOlDkkdkfoxicJKrDTP2gArRnmsIRqWAidwAbwsz3GvSYxlMAF9SKEVCAAOSEFQcETJMSQ170FEAbhwhAAHuoQcpyPR3AA5R4AXghLyoAAoWeCNCA4QBKED0gB8IFBWBAlOpIHIDJhJhZABFUIQwpLECzudyiSARWL3LFAkpGTxoABJcgzETeZCSNm8gVCrWi5VhQ1yhVKnaq9VankarUaMJoSSEFiceDWvmC4Wi0UBoMiE1mi1W3UdT2i71arViaDjVjKonpnAAHhmajKM35WqN7iEiRAxcBhH5oNBdMQcLhhYA9MmK12SwNyx9PkA&format=glimdown).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This demo doesn't work:

image

Also, it's unclear to me what the "options" it is talking about are.

Copy link
Owner Author

@NullVoxPopuli NullVoxPopuli Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

demo will work when the PR is merged 😅 -- because it implements the needed feature where Cells are directly renderable (via the smallest helper manager ever 🎉 ) (( and when the limber repl is updated as well ))

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it's unclear to me what the "options" it is talking about are.

hm, yeah, it's a little orthogonal -- but it's how to use code fences on https://limber.glimdown.com -- maybe that should be removed and extracted to a separate set of docs

docs/docs/resources.md Outdated Show resolved Hide resolved
docs/docs/resources.md Outdated Show resolved Hide resolved
docs/docs/resources.md Outdated Show resolved Hide resolved
docs/docs/resources.md Outdated Show resolved Hide resolved
});
```

To see this code in action, [checkout the live demo](https://limber.glimdown.com/edit?c=MQAggiDKAuD2AOB3AhtAxgCwFBbbAJgKYgBmhAdmsdMgOYDOIay5IARsQK72H4hwh8ASwBOhNNAA2ATxBjyREU1gBbeLHIVo9ADRZkjRIUmSQBuRUX8MxPERD1yQ%2BPELRrxSUIButgn5VCRhIRVQA6HAB5eGghDXoALhwAWhAAAy9fNJBUgH15RUYhVnhJZCpcrFSMn2J4MW8hQkRs-MtCESKSsqodEFLy4toPB1hOESozEmgOkcziAo7K6vn%2BhqbEdmNYFpA2hQ6u-p7CPoG0IbnaiwOlDkkdkfoxicJKrDTP2gArRnmsIRqWAidwAbwsz3GvSYxlMAF9SKEVCAAOSEFQcETJMSQ170FEAbhweHI9HcJGBKlQMyUAF4QJpNgBJchSMIAEVQhAAKoDCAAxSmoAAUACIKMkAKqQUV9UFYEAgDAvBIgUXkTiBERCNCyhUgFTFTgzVXqzUdHV6xU8En4U0arWWvSK5XjACMACZVSRkJIeHo4QBKIm4eLuGAIFDoDAgek4l5UYXC8EaEBB2MAPhA8sVJLJ-D5sZhJmFjJAnJmwsDwf1efcxRp3l9RZ40BZjd9ScDmYLgTCaHG8nc9LLFcIVb6boADDOa-qNP3JIQWJx4F2e2gl8gRO2Ok3JMKG3vfdWQ4qxNBxqwqz2c4rlKT3ORHvTYn2ByIh2f7xer6QhdANJhBSIhUtApY7DWipwlgQYhgAPDMahlDMGb6ky9aJCAiF8hmoKghGSCoJgcJwvBAD0b6EGhFFIQMqEfJ8QA&format=glimdown).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one works, but I still don't understand the options.


Resources can do more than represent data like a ticking clock. You can use a resource with any long-running process, as long as you can represent it meaningfully as a "current value".

<details><summany>Compared to other systems: Destiny of Unused Values</summary>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting seems off here.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in what way?

docs/docs/resources.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants