I am creating a single page (web application). I am very impressed with Rails v5.0, especially its built-in API capabilities.
In the past, I used JavaScript interfaces, using Vue.js, usually with templates provided Vue-CLI project. This allows you to deploy static sites Vue component-basedmainly anywhere. It's great.
Vue.js
Vue-CLI project
Vue component-based
Now Rails 5.1has built-in Webpack and Yarn features that also look pretty attractive. I am not sure how to continue working with my new application.
Rails 5.1
My questions:
What are the advantages / disadvantages of integrating Webpack and Vue into Rails using the Webpacker extensions available in Rails v5.1? I intend to deploy to Heroka.On the other hand, what are the pros and cons of using the Rails API-only mode for the backend and supporting the Vue / Webpack interface in your own directory? I would save everything in the same repository, backend deployment via Heroku and interface using a static host like Netlify.Which approach will have more cognitive service or technical challenges?
Over the past few days, I looked around, and I did not find much brief information on the Internet about this. People seem to be interested in the automatic reload features of the Rails development environment, but I get this for free already with Vue-CLI.
As far as I can tell, these are the reasons for their separate:
Deploying the interface is very easy anywhere.Webpacker Rails , , . - , .
:
, , , ."Rails-" Rails.JS Frontend .CORS (?)
?
, -, , "". , . Webpacker ( node) , . .
vue cdn. :
. haml, ruby2js, javascript . , , ruby, ruby , js, .
, - "vue annoted". . . x-template.
, : to_json, . . , . to_json , rabl, , .
, . vue-rails, . ( , )
Source: https://habr.com/ru/post/1691240/More articles:Xcode is not supported for iOS 11.2.1 on Xcode 9.1, 9.2 is required - iosHow to change a class before loading it? - javaDeprecated C ++ code does not contain std :: prefix - c ++AngularJS directive that sets a tag name to a specific string - angularjsHow to find the optimal number of cars for n people? - algorithmBootstrap 4: не удается закрыть модальности при использовании нескольких - javascriptHow to create a function to accept a parameter and increment it when called? - javascriptHold button to repeat commands - c #Язык - это Lua, а слово "embedded" - luaСоздание писем из цикла Excel - vbaAll Articles