Using react_on_rails how can I remount components similar to ReactRailsUJS.mountComponents - react-rails

In a react rails project I have converted over from react-rails gem to react_on_rails. Some of the components which are shown in an infinite scroll are re-mounted when they scroll in with ReactRailsUJS.mountComponents. How can I remount the components in this way using react_on_rails

I found the answer to this issue and have closed the issue
ReactOnRails.reactOnRailsPageLoaded() can be called to remount components on the page manually after async loading.

Related

Disable Liquibase execution at startup using Jetty + Spring (not Spring boot!)

I'm working in an application developed with Spring5 (not Spring boot!) that runs on Jetty. This application has module that uses the plugin liquibase-maven-plugin.
We generate a image from a dockerfile (base image jetty:9-jre8), where we add the application (war file) in the jetty application directory.
In some specific environments, where I deploy the application, I want to be able to disable that execution.
Is it possible to do so?
I've seen on spring boot documentation, that it's possible to do so by defining the property spring.liquibase.enabled (or liquibase.enabled on Spring4) to false, but that seems that doesn't work:
I've tried to define them at the properties file, define them as env properties and also as java options (-Dspring.liquibase.enabled=false).
This has the same behavior when I deploy the container, or when I execute locally the maven command: mvn jetty:run
Do you have any ideas or hints how to do this?
Thank you in advance
Well I just discovered that it's possible to disable the execution of liquibase by adding the JAVA_OPTION
-Dliquibase.shouldRun=false
For more details see here
I will keep this quesion anyway, in case someone has the same problem I did.

When i try to do a gcloud components update from my local machine, the process seems to hang. How do i update google cloud sdk?

I tried installing a new version, however that also takes me the components update route.
The component update route seems to be forever "creating update staging area"
i just waited and it took ~15 minutes. maybe take a break and come back. good luck.
If you run 'gcloud components update' while any of files is in use,
update would not be finished and gcloud would never end the update.
make sure you don't have more windows open.
Try to turn off the docker off for the duration of the update.

XCode 8 Create Framework with Pods

Anyone tried to achieved on how to create a framework that has a pods dependent?
I already create a workspace for the framework with pods and it will build successfully. But when I add the framework to another project it will have an error No such module(Pod framework)
No Such Module happened for me a lot of time when I added Pods to my project, and that's because the Pods was not created with the current Swift syntax and it was automatically converted to it, but that should not stop the project from building, so, after multiple Clean and Build the project ran with me.

Hibernate spatial is offline - anyone got more information

Since a few days hibernatespatial.org is offline, along with the mailing lists and Maven repositories. Has anyone got news on that?
It's online now, and pointing interested parties at Hibernate's own site since the project is being brought into the Hibernate fold.
I ran into this same issue (hibernatespatial.org has been offline for days). I was able to resolve it by uploading the artifacts to our internal repo and then setting hibernate to timeout almost immediately Maven dependency timeout settings.
The ideal solution would be to upgrade to a 5.0.x version that is on maven central https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial.

Image processing on a web server

I want to run image processing algos on server which can interact easily with web apps. The image processing algos are compute heavy and wont be available in custom built libraries. Currently I am using Ruby on Rails on Heroku for my website.
What would be the best architecture to achieve this? take images from website - run image processing algo on it - display back on website
Most of my image processing code is on C/C++.
Can i call C/C++ code from Ruby on Rails directly? Is this possible on Heroku?
Or should I design a system where C/C++ code expose some APIs which can be called by Ruby on Rails server?
Heroku typically uses small virtual machine instances, so depending on just how heavy your processing is, it may not be the best choice of architecture. However, if you do use it I would do this:
Use a background task gem to do your processing. Have this running on a separate process (called a worker rather than a dyno in Heroku terminology). Delayed Job is a tried and tested solution for background tasks with a wealth of online information relating to integrating it into Heroku, but there are newer ones like Sidekiq which use the new threading system in modern versions of Ruby. They would allow everything to be done in the dyno, but I would say that it would be useful to keep all background processing away from the webserver dynos, so Delayed Job (or similar) would be fine.
As for integrating C/C++, I haven't needed to do this as yet. However, I know it is possible to create gems that integrate C or C++ code and compile natively. As long as you're using ruby rather than JRuby, I don't think Heroku should have a problem with them. There are other ways of accomplishing this, look at SO questions specifically about this topic, such as
How can I call C++ functions from within ruby
It seems that you need to create an extension, then create a gem to contain it. These links may or may not help.
http://www.rubyinside.com/how-to-create-a-ruby-extension-in-c-in-under-5-minutes-100.html
http://guides.rubygems.org/gems-with-extensions/
I recommend making a gem as I think it may be difficult to otherwise get libraries or executables on to a Heroku instance. You can store the gem in your vendor directory if you don't want to make it public.
Overall I would have the webserver upload to S3 or wherever you're storing the images (this can be done directly in the browser without using the webserver as a stepping stone with the AWS JS API. Have a look for gems to help.)
Then the webserver can request a background task to process the image.
If you're not storing them, things become a little more interesting... You'll need a database if you're using background tasks, so you could pass the image data over to the worker as a blob in the database perhaps.
I really wouldn't do all the processing just in the webserver dyno, unless you're really only hitting this thing very occasionally. With multiple users you'd hit a bottleneck very quickly.
The background process can set a flag on the image table row so the webserver can let the user know when processing is complete. (You can poll for information using JS on the upload complete screen using AJAX)
Of course, there are many other ways of accomplishing this, depending on a number of factors.
Apologies that the answer is vague, but the question is quite open-ended.
Good luck.