Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research webpack (and possibly integrate it) #318

Closed
DmitryKey opened this issue Apr 11, 2021 · 14 comments
Closed

Research webpack (and possibly integrate it) #318

DmitryKey opened this issue Apr 11, 2021 · 14 comments
Labels
wontfix This will not be worked on

Comments

@DmitryKey
Copy link
Contributor

DmitryKey commented Apr 11, 2021

Research webpack integration: https://www.freecodecamp.org/news/how-to-configure-webpack-4-with-angular-7-a-complete-guide-9a23c879f471/

Also see this for debugging in Intellij IDEA: https://itnext.io/debugging-your-angular-application-in-intellij-idea-411a9b08759f

Precaution: this is completely unchartered waters for me!

@DmitryKey
Copy link
Contributor Author

rails/rails#33079

@epugh what do you think of upgrading to Rails 6?

@epugh
Copy link
Member

epugh commented Jun 12, 2021

I think this is definitly the pre-requisite... Otherwise we are creating a lot of our own tooling. So @ychaker feel like joining on a Quepid Qommunity Qoding hour some time to get us started?

@DmitryKey
Copy link
Contributor Author

Cool! I've played with a sample blogging app from rails/realities, it illustrates webpack, see video here: https://www.youtube.com/watch?v=HJZ9TnKrt7Q

Currently I'm looking at integrating this into quepid. First step done: in Gemfile:

gem 'rails', '= 6.1.3.2' # starting Rails 6 the webpack is included by default.
gem 'webpacker', '= 5.4.0'

@DmitryKey
Copy link
Contributor Author

It runs, however force_ssl method isn't reachable (probably dropped from Rails 6), so I had to comment it out for now. Otherwise UI loads, I can create cases.

@epugh
Copy link
Member

epugh commented Jun 13, 2021

Wow!!!!!!!!!!!!!!!!!!!!!!!!!!!

So, this is a useful tool for diffing default Rails apps, I used it to get to 5.2 from Rails 4.

https://railsdiff.org/5.2.4.6/6.1.3.1

This is pretty amazing that you did get this far so quickly! I was kind of dreading it, thinking it was going to be as hard as the initial jump to Rails 5, but this makes me think this might be easy?

DmitryKey pushed a commit to DmitryKey/quepid that referenced this issue Jun 13, 2021
… Still need to marry webpack with bin/setup_docker and bin/docker. But looks promising!
@DmitryKey
Copy link
Contributor Author

@epugh I've opened the PR ^. But! I need more wizard help from you or anybody who understands docker/rails/angular world.
The thing is, that in the demo blog app Webpacker got configured correctly. And for that I used rails/realties.

In the PR I've generated webpack config files using:

bin/rails webpacker:install

I've also disabled app preloading for now, assuming this stuff will be handled by webpack.
Also added new section ### Webpacker to the README.md.

If you have time, give it a spin.

DmitryKey pushed a commit to DmitryKey/quepid that referenced this issue Jun 13, 2021
@DmitryKey
Copy link
Contributor Author

Btw, thanks for the diff link, it looks really useful. We can upgrade Puma for instance.

Stashing a few relevant links:
https://github.com/preboot/angularjs-webpack/blob/master/webpack.config.js angular + webpack
https://www.nopio.com/blog/angularjs-rubyonrails-tutorial/ -- good tutorial for angularjs with RoR

https://medium.com/@zamarrowski/angular-1-x-component-based-application-with-webpack-and-es6-dfab450f2df4 a bit dated tutorial for webpack and angular, but might be still relevant.

epugh added a commit that referenced this issue Jul 31, 2021
* #318 upgraded Rails to 6.1.3.2, which carries webpack by default. Still need to marry webpack with bin/setup_docker and bin/docker. But looks promising!

* #318 disabled more ssl checks. TODO: figure out on Qoding.

* some bumps from looking at https://railsdiff.org/5.2.4.6/6.1.3.2

* more from https://railsdiff.org/5.2.4.6/6.1.3.2

* ssl support to set via your .env file

* start tracking the todos

* Deal with the module Analtyics::GA being in all caps freaking Zeitwerk up.

https://stackoverflow.com/questions/28990466/rails-autoloading-fully-capitalized-name-like-api#28990943

* Revert "ssl support to set via your .env file"

This reverts commit b71b5b7.

* we have a environment variable that instead of being set at the controller layer, instead needs to be set at the config layer

* deal with deprecation warning DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated: api/v1/export/ratings/show.rre

* fix test

* reduce warnings in building the front end.

* turns out the associate :teams_scorers doesn't exist, and it was picked up in the Rails 6 migration!

* rubocop lint

* more lint

* rubocop doesn't like env scatettered about!

* unused method at this point...    hopefully!

* much messing around with GA versus ga versus google_analytics to get Zeitwerk happy

* turns out we need to be in HTTP mode on Quepid to call solrs on HTTP

* lint!

* testing out this

* new lint warnings

* trying to deal with https to http redirect for home controller

* turns out staging environments use production setting

* track todos

* one moretry

* going back to old approach

* Revert "going back to old approach"

This reverts commit f10fec9.

* lets try a different path to see if we can get exclude to work.

* needed this setting to turn it on

* this is what we want, just will it owrk?

* maybe, just maybe the redirect is due to lack of cookies from https to http being sent, so change that?

* not sure about the repetition, but this seems ot be the magic

* remove debugging

* progress!

* OPTIONS checks for api end points need passing through.

* banging my head

* work aorund

* maybe a general upgrade works?

* tests are blowing up loacally, but pass on CircleCI, lets try it.

* lint

* bumping versions using a report of what is out of date.  Didn't update the d3-rails artifact as newer one doesn't work.

* debug logging

* argh

* lets see if we can exclude the redirect on the api calls.

* Update production.rb

* one more try

* does this help?

* maybe?

* maybe/

* maybe?

* extra debuggng not needed

* move parameter to better place?

* need foreman in prod too!

* lint!

* more stuff done!

* remove debugging output

* advice to pin webpacker

* back out change!

* lots of upgrades  from the RailsDiff website to look more like a default Rails 6 app.

* LINT

* see what happens

* argh

* Update yarn.lock

* bump to latest ruby

* bump

* bump gemflile.lock

* some updates

* bit o' extra debugging we dont need

* final cleanups, realized we don't need bootstrap 4 ;-(

* jump to bootstrap 5

* and our changes!

Co-authored-by: dmitrykan <[email protected]>
Co-authored-by: [email protected] <>
Co-authored-by: Eric Pugh <[email protected]>
@stale
Copy link

stale bot commented Sep 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please do advocate for this issue and ideally submit a patch to get the attention of the maintainers!

@stale stale bot added the wontfix This will not be worked on label Sep 14, 2021
@DmitryKey
Copy link
Contributor Author

Update: we have upgraded Quepid to Rails 6, which supports webpack out of the box. But we need Frontend developer wizardry to help us roll out webpack.
The impact of using webpack is speeding up the UI development. Currently it takes 30 seconds to reflect a change in the frontend code, which is annoying.
If you are a frontend engineer and would like learn / contribute to open source, we have regular Community meetings online to brainstorm and do pair programming.

@stale stale bot removed the wontfix This will not be worked on label Sep 18, 2021
@stale
Copy link

stale bot commented Dec 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please do advocate for this issue and ideally submit a patch to get the attention of the maintainers!

@stale stale bot added the wontfix This will not be worked on label Dec 21, 2021
@epugh
Copy link
Member

epugh commented Dec 21, 2021

FYI, in Rails 7, there is a lot of work to remove the entire need for Node, and this may become OBE...

@stale stale bot removed the wontfix This will not be worked on label Dec 21, 2021
@stale
Copy link

stale bot commented Mar 27, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please do advocate for this issue and ideally submit a patch to get the attention of the maintainers!

@stale stale bot added the wontfix This will not be worked on label Mar 27, 2022
@stale stale bot closed this as completed Apr 27, 2022
@epugh
Copy link
Member

epugh commented Apr 27, 2022

Rails 7 has a JavaScript packaging approach, so I am thinking that we keep existing js tooling for the core angularjs app, but any future js app will follow the rails 7 approach.

Of course we have to update to 7!!!

@DmitryKey
Copy link
Contributor Author

yip-yip :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants