-
Notifications
You must be signed in to change notification settings - Fork 637
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
Rails 6.0 and CMS 2.1 #865
Comments
Doesn't Rails still support Sprockets, even if using webpacker? |
I haven't really done any legwork yet. From what I understand, engine would manage assets with webpacker like any other app but package compiled pack into /public so it can be referenced when used from the parent app. This looks like something that makes sense: https://github.com/rails/webpacker/blob/master/docs/engines.md |
I've been playing around with Rails 6 -- it does use webpack by default, yeat images are still handled by sprockets. |
rails 6 rc2 still plays nice and leaves sprockets alone - even when running webpacker with a SPA framework
plays plenty nice with the currently published gem of CMS. I can also confirm this works deployed to a production environment - no oddball webpacker configuration or other adjustments. It just works(tm) - bootstrap 4 in CMS admin and the rest of the app is serviced by react, all as expected. edit: I dug in deeper and found something that doesn't work: file upload - continually creates/destroys/creates/destroys the ActiveStorage::Attachment until the stack gets too deep. I'll dig in to it and see if I can see what's going on edit2 - found the fix for file uploads #892 |
@tongboy thanks for that fix. We just upgraded our production site, which relies in part on CMS, to Rails 6. One thing that seems to have happened during the upgrade is a change in Active Storage image URLs, e.g. what was referenced at /rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBMUNiQmc9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--25aa53e5f0338980ba775f754d5877a1d9f703cb/SketchSteamboat1998.jpg became /rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBMUNiQmc9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--df14d446a48267a1bfe8bd9c23b3450e05d177f9/SketchSteamboat1998.jpg I'm not sure that this is specifically an Active Storage upgrade issue, a gem upgrade issue, or an unexpected side effect of something we tweaked in the app config for a gem upgrade, but the outcome was a bunch of broken image links because Redactor inserts the public URL rather than linking to the AS object. I understand why it works that way, but I wanted to add this as a caution for testing (we missed it, as we don't mirror all of our image assets into our dev environments regularly and only some of our site pages have CMS wysiwyg content with images in the body). Images we had added to CMS templates with cms:file didn't break, presumably because they're referenced via their AS objects and not directly via URL. (edited to fix bad copy-and-paste of URLs) |
@kbroderick those two URLs look identical - maybe a bad copy/paste? |
@tongboy indeed, bad copy paste. The portion of the URL immediately before the filename--between the --== and the /Steamboat--changed: |
where I can buy couple of beers to someone who will be able to move this awesome gem to rails 6 ? 🙏 |
Here is what I ended up doing in Thredded to support both Webpacker and Sprockets: https://github.com/thredded/thredded#add-thredded-javascripts-webpack |
@GBH Thanks for the recent merge and for saying you'd try to get a new release out around the end of the month! I know you mentioned in this issue that you're not currently maintaining any sites that use CMS, do you hope to continue managing the project & merging community fixes long term? |
I'm slowly working towards a release. So far I updated form builder for Rails 6 (support for ActiveText rich_text input field). Updated demo app to Rails 6 so I can actually test integration properly. It's been slow as I'm very busy with my day job (that doesn't involve CMS) and I'm kinda burned out most of the time. I'm hoping that I'll make some progress over the holidays. At the very least I want to release stable version that sorta works with Rails 6 (basically what we have in master branch right now). Then I want to cleanup the front-end nonsense, drop rails 5 support and finally integrate newest Redactor. I definitely going to continue to maintain this project. It's only tough when Rails gets a major release and things change and/or break. |
@GBH "CMS 2.1 will only support Rails 6.0+ " Shouldn't it be version 3.x then? According to semantic versioning breaking changes should update the major version number. |
@JohnSmall Yes. I think it's going to have a lot of breaking changes so 3.0 is probably a good idea |
Hey guys, I think I got master branch ready to go. It will be a maintenance release ( One thing that I immediately noticed that asset compilation won't really work if you have Sprockets 4.0. Not entirely sure what can be done about this as 3 and 4 are radically different for some reason. In CMS3 I'll drop support for Sprockets 3 so I'll need to figure out only one way to serve assets. |
Thanks for taking some time during the holidays to test & make updates, @GBH! I'll try to get these changes tested in our Rails 6 environment ASAP (we're still on Sprockets 3 for the same reasons.) |
@GBH Attachment upload works in pages, but attempting to visit the Files admin page results in an |
@morgant Thanks. I think it's the rack 2.0.8 thing. I'll fix it up. |
@GBH Thanks, seems like we're still on rack 2.0.7 in our environment. |
@morgant Ok, should not explode with rack below 2.0.8. Let me know and I'll cut the gem. |
Looking into how package assets going forward and it's hurting my soul. This is what I think I want:
So it seems that I cannot use Webpacker here. Maybe I need to have a Rollup workflow to accomplish this. |
@GBH Your latest commit for rack 2.0.8 fixes the files admin section under 2.0.7 for us. Thanks! |
Ok. 2.0.19 is released. |
With upcoming Rails 6.0 sometime in April it seems like a good time to do a version bump. Here are the things that need to happen:
CMS 2.1 will only support Rails 6.0+ as there are dependencies not found in Rails 5.2
Regarding the timeline. I don't currently maintain any sites that use this CMS, so it's not a priority for me. Any help would be appreciated to keep this project going.
The text was updated successfully, but these errors were encountered: