xjpro / react-in-angularjs

A super simple way to render React components in AngularJS
The Unlicense
23 stars 13 forks source link

could you please provide a bundle file with umd module type? #6

Closed jueinin closed 3 years ago

jueinin commented 3 years ago

our obsolete project is using requirejs to manage module. the commonjs module is not compatiable with requirejs.

I am trying to rewrite it to requirejs

jueinin commented 3 years ago

emmm... it's a project with angularjs v1.3.x version. without the module.component API. too awkward!

xjpro commented 3 years ago

There’s a directive version of angularize, would that work? https://github.com/xjpro/react-in-angularjs#directives

jueinin commented 3 years ago

I have not tried the directive version yet. because of the lack of module.component api and life cycle hooks in angularjs v1.3. I have tried the polyfill . It works, but the change of $scope won't sync to react component. i guess the reason may be that the polyfill do not implement $doCheck api. Do you have any ideas to use React in augularjs v1.3.x project?

xjpro commented 3 years ago

Here's the function in question, perhaps you could take only this function for use in your older project?

https://github.com/xjpro/react-in-angularjs/blob/e5c2cc10f74ba05a07057e389aef8e996f92a968/src/index.js#L46

I made this project public domain so feel free to just snip what you need.

jueinin commented 3 years ago

it works by using angularizeDirective function, thanks! what do you think frontend microservice? it seems a better solution. I really do not want to write angularjs code....

xjpro commented 3 years ago

I'd recommend React, Vue, or Angular (the new one, not AngularJS). React is my choice but they all have their merits. react-in-angularjs is not meant to be used forever, it's for migrating older AngularJS apps to React apps using the strangler pattern.