You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, Rails has Strada, a cordova-ish solution that brings the web to mobile by using web views and a JS bridge to native functionality. Superglue can offer a better alternative. Imagine being able to use standard Rails helpers (the flash, form helpers) and your boring Rails workflow to build React Native applications, all while having 100% Native UI controls and access to react-native libraries.
In other words, while Strada tries to bring the Web to native, Superglue tries to bring just Rails to native.
Thoughts
The movement towards "pages"
expo and other JS frameworks are making their way towards page based development. Since Superglue is about page state over the wire. Is there some compatibility here that is worth investigating?
Known quirks of React Native
ReactNative is not the web. Specifically
ReactNative fetch is NOT the web fetch, and there are known issues with redirects losing cookies
Polyfill to the webview’s fetch. Its possible to create an instance of the Webview, and using injected javascript, create a polyfill fetch (fork something like https://github.com/developit/unfetch ) that proxys to the Webview.
Embrace the known Quirks. React native isn’t quite the web, so create helpers in superglue_rails that give Rails more superpowers. For example, we can embrace that React has an issue with redirect by never redirecting, instead we can render a payload for the app to navigate to somewhere else.
class PostsController < ApplicationController
def create
... do stuff
navigate_to_screen :home_screen
end
end
There might be new helpers to think about, for example: navigate_back. link helpersURL helpers.
Embracing React Native also means that some features of superglue would need to be disabled while on native. For example, UJS helpers. We may also need to reshape the redux state shape to accommodate the new navigation helpers.
Next Steps
Of the solutions, I am leaning towards embracing React Native’s quirks. While I don’t have a thought out comparison, I think that because React Native isn’t quite web, its simpler to embrace to quirkiness then to add a layered solution. I believe that Rails itself can be a “Be productive anywhere” solution, even without the web.
The text was updated successfully, but these errors were encountered:
Today, Rails has Strada, a cordova-ish solution that brings the web to mobile by using web views and a JS bridge to native functionality. Superglue can offer a better alternative. Imagine being able to use standard Rails helpers (the flash, form helpers) and your boring Rails workflow to build React Native applications, all while having 100% Native UI controls and access to react-native libraries.
In other words, while Strada tries to bring the Web to native, Superglue tries to bring just Rails to native.
Thoughts
The movement towards "pages"
expo and other JS frameworks are making their way towards page based development. Since Superglue is about page state over the wire. Is there some compatibility here that is worth investigating?
Known quirks of React Native
ReactNative is not the web. Specifically
Possible solutions:
superglue_rails
that give Rails more superpowers. For example, we can embrace that React has an issue with redirect by never redirecting, instead we can render a payload for the app to navigate to somewhere else.
There might be new helpers to think about, for example:
navigate_back
. linkhelpers
URL helpers.Embracing React Native also means that some features of superglue would need to be disabled while on native. For example, UJS helpers. We may also need to reshape the redux state shape to accommodate the new navigation helpers.
Next Steps
Of the solutions, I am leaning towards embracing React Native’s quirks. While I don’t have a thought out comparison, I think that because React Native isn’t quite web, its simpler to embrace to quirkiness then to add a layered solution. I believe that Rails itself can be a “Be productive anywhere” solution, even without the web.
The text was updated successfully, but these errors were encountered: