Skip to content

Adoption #153

Description

@rektide

Adoption was removed in v2 with a note that it "will be out in another release." I'm totally fine with this, but it'd help me & perhaps others to have an issue to track for the status of this capability. I hope you don't mind me opening a ticket, to stay abreast of what the status is? If you'd prefer not, that's fine, close away.

Thanks for the amazing work on domdiff & hyperhtml.

Activity

  1. WebReflection commented on Dec 7, 2017

    @WebReflection
    Owner

    I’m right on it ... basically it’s planned to be the next thing but I’ve just started adjusting viperHTML so it’s ok to keep this one open.

  2. WebReflection commented on Dec 12, 2017

    @WebReflection
    Owner

    FYI: adopting the right way is very complicated. This might take a while and I'll be off during xmas/nye time so apologies in advance for any inconvenience but I don't want to go out with a rushed solution.

  3. WebReflection commented on Dec 12, 2017

    @WebReflection
    Owner

    P.S. wires cannot adopt content yet but hyper.adopt(node) as opposite of hyper.bind(node) is already usable through this branch: https://github.com/WebReflection/hyperHTML/tree/adopt

    This is an HTML example, the HTML is basically what viperHTML would generate with .adoptable = true feature.

    <!doctype html>
    <html>
      <head>
        <script defer src="../index.js"></script>
      </head>
      <body>
        <div test="before">
          <!--�:4-->before<!--�:4-->
          <ul>
            <!--�:5--><li> lonely </li><!--�:5-->
          </ul>
          <!--�:6-->NO<!--�:6-->
          <hr>
          <input value="test">
        </div>
      </body>
      <script>
      setTimeout(function () {
        update(
          hyperHTML.adopt(document.body),
          {
            test: 'after',
            text: 'after',
            list: [
              {name: 'first'},
              {name: 'second'}
            ],
            inBetween: 'YES'
          }
        );
        function update(render, model) {
          render`
          <div test="${model.test}">
            ${model.text}
            <ul>
              ${model.list.map(item => `<li> ${item.name} </li>`)}
            </ul>
            ${model.inBetween}
            <hr>
            <input value=${'test'}>
          </div>
          `;
        }
      }, 2000);
      </script>
    </html>
  4. WebReflection commented on Feb 5, 2018

    @WebReflection
    Owner

    The PR is almost ready to land #185

  5. Scott-MacD commented on Dec 11, 2018

    @Scott-MacD

    I know this conversation is a year old now, just chiming in with a thought/question as I know this hasn't been merged into master yet.

    Is there a way to have hyperHTML.adopt() inherit existing content within the node generated by viperHTML if the value supplied by model is undefined? If so, I believe that would cover all the concerns and use cases outlined in #54, essentially allowing us to not have to send duplicate content twice over the network (once in the rendered HTML, secondly as state data), and instead only ship the templates and application logic aside from the initial page load.

  6. WebReflection commented on Sep 17, 2019

    @WebReflection
    Owner

    @Scott-MacD apologies for late reply. I think hydration with hyper/viperHTML might never land, while it's natural with heresy and heresy-ssr

  7. Scott-MacD commented on Sep 17, 2019

    @Scott-MacD

    Not a problem, I've yet to use it on a serious project, but I've been playing around with heresy for a while and it seems to work well for my needs.

  8. WebReflection commented on Feb 24, 2020

    @WebReflection
    Owner

    as mentioned in here, I am more than ever convinced this won't happen with hyperHTML, so I am closing this as won't fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions