Giter VIP home page Giter VIP logo

Comments (5)

Lucifier129 avatar Lucifier129 commented on June 16, 2024

I think react-lite can't work with react-worker-dom.

from react-lite.

azizzaeny avatar azizzaeny commented on June 16, 2024

Ok... would it have some issue... if i just use react-dom from react to render react-lite...?
react-dom only contain with :

(function(React) {
  return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
});

React API support React.render only until 0.14.. can we make best practices for others to use react-dom ... instead aliases, React 0.15 above will show deprecated warning...

because its consisten..., preserving others API such as clojurescript Reagent OM...

till now i still doesn't know why react separating two global js like that...
but people follow it, and it become future culture... and accepted

from react-lite.

Lucifier129 avatar Lucifier129 commented on June 16, 2024

Once react-lite can use react-dom directly without alias by React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, but react-dom changed its npm package, it would require react/lib/ReactDOM.

from react-lite.

azizzaeny avatar azizzaeny commented on June 16, 2024

i think i can make it... using cdn version:

(function(f) {
  // CommonJS
  if (typeof exports === "object" && typeof module !== "undefined") {
    module.exports = f(require('react'));

  // RequireJS
  } else if (typeof define === "function" && define.amd) {
    define(['react'], f);

  // <script>
  } else {
    var g;
    if (typeof window !== "undefined") {
      g = window;
    } else if (typeof global !== "undefined") {
      g = global;
    } else if (typeof self !== "undefined") {
      g = self;
    } else {
      // works providing we're not in "use strict";
      // needed for Java 8 Nashorn
      // see https://github.com/facebook/react/issues/3037
      g = this;
    }
    g.ReactDOM = f(g.React);
  }

})(function(React) {
  return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
});

use aliases can also work with clojurescript:

; before rendering
(set! js/ReactDOM js/React)

Overall thanks.....,
I just figure how to implement virtual-dom rendering and patching in web-worker...
then i came across your react-lite because its small size really fit in web-worker to bundle...

Unfortunetly to make it work... we need some heavy work to implement separation context between main thread and worker thread.... because worker env doesnt allow us to write DOM...

check this out

from react-lite.

Lucifier129 avatar Lucifier129 commented on June 16, 2024

They look interesting~

from react-lite.

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.