Giter VIP home page Giter VIP logo

Comments (10)

vitkarpov avatar vitkarpov commented on August 11, 2024

Maybe different wrappers (react, polymer, angular component) should be in separate repos? Likely is an independent vanillajs library.

from likely.

iamakulov avatar iamakulov commented on August 11, 2024

Maybe different wrappers (react, polymer, angular component) should be in separate repos?

@vitkarpov, do you have any ideas about how this could be implemented? Likely is tightly coupled with the real DOM, and I believe making it wrapper-agnostic is a complex task.

from likely.

iamakulov avatar iamakulov commented on August 11, 2024

Generally, I like the idea, but I’m afraid it could be a bit complex to implement.

from likely.

vitkarpov avatar vitkarpov commented on August 11, 2024

Likely is tightly coupled with the real DOM

if we speak about React I think it could be like this:

const likely = require('ilyabirman-likely');

React.createClass('Likely', {
  componentDidMount() {
     this.update();
  },

  /**
   * Public method to update the component
   */
  update() {
    likely(this.node);
  },

  /**
   * Likely knows how to change itself,
   * React can't do anything useful
   */
  shouldComponentUpdate: () => false,

  render() {
    return <div ref={(node) => this.node = node;}>
        <div class="facebook">Share</div>
        <div class="twitter">Tweet</div>
        <div class="gplus">+1</div>
        <div class="vkontakte">Share</div>
        <div class="pinterest">Pin</div>
        <div class="odnoklassniki">Like</div>
        <div class="telegram">Send</div>
    </div>;
  }
})

But there's a problem: likely autoinitializes itself on document loaded and with React it doesn't work as expected.

from likely.

vitkarpov avatar vitkarpov commented on August 11, 2024

Anyway I think in such case we need Likely organization with different repos:

  • likely-core (Button constructor is here)
  • likely-vanilla (autoinitialization on document load here)
  • likely-react (React component here)
  • ...

from likely.

ilyabirman avatar ilyabirman commented on August 11, 2024

(I’m frightened)

from likely.

iamakulov avatar iamakulov commented on August 11, 2024

I’ll write about this a bit later. (I tend to close this currently.)

from likely.

vitkarpov avatar vitkarpov commented on August 11, 2024

I tend to close this currently

+1 — seems very complicated right now.

from likely.

iamakulov avatar iamakulov commented on August 11, 2024

if we speak about React I think it could be like this:

Wow, an interesting approach. I’ve never worked on itegrating React with 3rd-party libraries before, and it seems this is a standard solution for integration. Both weird and beautiful at the same time.

from likely.

iamakulov avatar iamakulov commented on August 11, 2024

I tend to close this currently.

Well, this task is really complex and expensive. As there’re no more requests for this functionaly, I’m closing this now. I’d be glad to reopen this if we see more requests for React support though.

from likely.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.