Code Monkey home page Code Monkey logo

Comments (4)

rbclark avatar rbclark commented on June 9, 2024

In the process of investigating this, I am also looking into integrating the ability to load basic Vue components into the application in order to replace all of the existing javascript components. So far I investigated the https://github.com/vueonrails/vueonrails and found it to be completely undocumented. It turns out it is completely unnecessary to use a gem for this anyway, since webpacker supports doing Vue out of the box. Gitlab actually provides some nice documentation on how to integrate Vue with rails: https://docs.gitlab.com/ee/development/fe_guide/vue.html.

In order to test this so far I have taken the following steps:

  • rails new vulcan-vue --webpack=vue --skip-sprockets -d postgresql
  • rails g controller IndexController index
  • Uncommented the third block in the automatically generated hello_vue.js
  • Added the following HTML to app/views/hello/index.html.erb
<div id='hello'>
  <app></app>
</div>
  • Created the following Procfile.dev and ran gem install foreman:
web: bundle exec rails s
webpacker: ./bin/webpack-dev-server

And thats pretty much it, at this point when you run foreman start -f Procfile.dev, webpacker starts compiling assets automatically and the rails server starts up. Changes to the Vue code are even automatically performed without reloading the browser.

Steps I still need to take:

  • Convert to haml (all the Gitlab Vue docs examples use haml, and I'm more used to haml at this point anyway)
  • Setup dynamic way to add different javascript_pack_tag declarations depending on which page I'm on, using content_for.
  • Figure out a better structure for components. I don't want to jam all the components into the top level packs directory. Gitlab seems to have a structure for this, should probably just take their structure, the only potential caveat to this is they don't actually use webpacker, they use their own custom thing.
  • Include Vuetify
  • Include icons somehow with yarn.
  • Stick the app in docker in order to ensure it works in production mode.
  • Actually integrate a complex component that does something we need in the application.

from vulcan.

rbclark avatar rbclark commented on June 9, 2024

Messing with Vuetify has so far shown that it doesn't integrate as well with the rails side of things as bootstrap does. So far have the ability to pass information from Rails to Vue and render vue components inline.

from vulcan.

rbclark avatar rbclark commented on June 9, 2024

This will be fully fixed in the updated version of vulcan that integrates some vue components.

from vulcan.

rbclark avatar rbclark commented on June 9, 2024

This is solved in https://github.com/mitre/vulcan/tree/vulcan-next

from vulcan.

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.