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

Add the possibility of updating html through morphs #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathan-s
Copy link
Owner

@jonathan-s jonathan-s commented Nov 22, 2020

Description

With morphs we can make make updates to html without necessarily re-rendering any html if we know the selector. Which means that the update will take less time.

If a morph is executed we will not make a re-rendering of the template which would normally happen with a reflex.

Fixes #27

Why should this be added

It'll give us a faster way to update the page, because we don't need any re-rendering of the template.

Checklist

  • Tests are passing
  • Documentation has been added or amended for this feature / update

@jonathan-s jonathan-s added the enhancement New feature or request label Nov 22, 2020
Repository owner deleted a comment from codecov-io Dec 1, 2020
@jonathan-s jonathan-s added this to the 0.5.0 milestone Jan 6, 2021
@Danilodum
Copy link

What is the state of this PR, can I help?

@Danilodum
Copy link

I forked this and merged with master, seems to work great! 👍

@jonathan-s
Copy link
Owner Author

@Danilodum Is there anything in the documentation that is unclear to you? Is there anything that you'd like to add there?


```ruby
yelling = element.value.upcase
morph "#foo", ApplicationController.render(partial: "path/to/foo", locals: {message: yelling})

Choose a reason for hiding this comment

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

Seems liks there's some ruby related mumbo jumbo dangling around

@Danilodum
Copy link

@Danilodum Is there anything that you'd like to add there?

A template/context example would be a good addition

@jonathan-s jonathan-s modified the milestones: 0.5.0, 0.7.0 Jul 18, 2021
@jonathan-s jonathan-s force-pushed the morph-feature branch 8 times, most recently from f0de34b to 1313e45 Compare July 18, 2021 14:15
With morphs we more easily modify specific parts of the DOM directly
in the reflex. We also got access to a broadcaster which means that
we can use that to surgically alter certain DOM elements to our liking.

In this commit we also drop the commitment to maintain Channels 2.4.
Channels 2.4 should still work, but the CI showed weird issues and this
added to a maintainence headache which wasn't worth it
(unless explicitly asked for and paid by someone).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement morph mechanism + docs
2 participants