Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Marko Kauzlaric
@MarkoKauzlaric
With do you think about Opal and building Client side with it? And what do you recommend.
likemike
@likemik60537659_twitter
I think Opal missed the momentum.
Mitch VanDuyn
@catmando
@MarkoKauzlaric as noted directly above its great. Rock solid, and increases developer productivity in several ways. 1) Ruby is simply easier to read, and more expressive. In general we find it take about 4 times as much JS code to achieve the same functionality. 2) If you are using Ruby server side, the not having to context switch saves more brain power than people think. 3) It allows my developers to think about the whole system (i.e. how does the whole function work from user experience, to server side issues) rather isolate programmers into backend and frontend.
Adrian Madrid
@aemadrid
@MarkoKauzlaric you should definitely check out https://hyperstack.org/
there are a lot of other opal frameworks out there but I don’t believe any is as actively developed as HS
matrixbot
@matrixbot
ryanprior I used Opal for a project where I already had a software library in Ruby, and wanted to create a web app to make it easier to consume directly. It would not have been a huge effort to reimplement the library in Javascript, or to put up a Ruby backend server and have the front-end written in Javascript to consume it, but completing the project with Opal and the Inesita framework only took a couple days, including learning time having never used either before (but lots of Ruby otherwise.) If I were in a similar situation again, I would not hesitate to give Inesita another crack.
ryanprior The completed web app in question is here: https://cyberark.github.io/conjur-policy-generator/
The source code for the web app is here: https://github.com/cyberark/conjur-policy-generator/blob/master/web
I chose Inesita in particular because it's lightweight, includes its own tools, doesn't assume you're using Rails, and has nice approachable documentation.
Forrest Chang
@fkchang
@MarkoKauzlaric the apps we have in production with opal use opal-jquery, and lissio - I've played around a lot with previous versions of hyperstack, just no production apps, so next big opal app I'll write I'll use that --- if not for the huge brain/code share behind react, I'd probably use @jgaskins 's clearwater
for similar reasons to @matrixbot in that it's lean and doesn't require rails and I respect @jgaskins tech approaches that project (and in general)
Mitch VanDuyn
@catmando
@fkchang - Can you help me with your rails comment? It is true that our top priority for hyperloop is to disengage from rails (which should not be a big issue) BUT that said, I am so curious. What is the big reason for not using rails?
Forrest Chang
@fkchang
@catmando don't get me wrong, I love rails and will use it for whenever it's appropriate, I was just saying that I not being bound to rails is a perk, react.rb was much more bound to rails than the current hyperstack. But that said, given all the mindshare behind React, it'd be silly to not use hyperstack, I don't want to have to write my own widgets as much as possible, which would be the big drawback of clearwater for me
Mitch VanDuyn
@catmando
@fkchang no but I am trying to understand the general use case where rails is perhaps NOT appropriate. Don't get me wrong intuitively we all agree decoupling from rails (i.e. just make it a rack middle ware) is the right approach if only from a maintenance perspective, but at the moment its "intuition" so that doesn't always lead to the best design choices.
so I am looking for the underlying reason somebody might want hyperstack but no rails...
well apart from the case that you have an existing API, and you are using hyperstack just on the client side. Kind of Hypstk
Forrest Chang
@fkchang
@catmando in general, if I'm mucking around I'll probably default to rails unless indicated elsewise, simply because whenever I've had, for example, a sinatra app that lasted any amount of time, I've ended up re implementing parts of rails - unless it's pure API. That said, there times where I want lighter, or faster or less bloated websocket support, I think in a number of cases I'd lean towards roda - though it's been a while and I probably forgot how to develop roda. And as always, I'd like consider a hyperstack/crystal app as appropriate for somethings (like speedy websocket support that doesn't require another process to push)
but otherwise, I've reimplemented too many parts of rails to not use rails unless indicated I shouldn't, in general
Mitch VanDuyn
@catmando
yes those are good points. In particular its motivation for getting hyperstack directly implemented on Rack so its as fast as possible. BTW what would u use for websocket support outside of rails? Currently Hyperstack support rails action-cable, pusher.com and simple polling. Is there some other standard packages we should think of having direct support for?
Forrest Chang
@fkchang
IIRC Roda supports websockets via Faye, i don't recall what additional requirements are needed except a suitable webserver - in my mind I envision something that has the same developer experience that kemal does w/websockets, i.e. you just setup a ws route and it works.
Jamie Gaskins
@jgaskins
Check out power_strip for WebSockets
@fkchang @catmando ^^
Mitch VanDuyn
@catmando
@jgaskins that looks great!
Forrest Chang
@fkchang
2jga
@jgaskins just stumbled on that the other day, btw, good job
Mitch VanDuyn
@catmando
.
Bernhard Weichel
@bwl21
@Mogztter i came to know that asciidoctor is using Prawn. I tried to compile Prawn with Opal but failed. How do you handle Prawn in asciidoctor.js
Guillaume Grossetie
@Mogztter
@bwl21 Same here, I did try to compile Prawn with Opal but there's still some missing implementations: opal/opal#1697
With a lot of hacks Prawn was running in JavaScript but did not work as expected
Since we are now using web technologies to generate PDF, I stopped working on it
Bernhard Weichel
@bwl21
@Mogztter Thanks. As of now I am using jsPDF with good results for drawings and textannotations. But I would like to support more such as paragraphs, lists etc.
Guillaume Grossetie
@Mogztter
You should give Puppeteer a try to generate PDF using HTML and CSS
Might not work for you if you want a client-side (in the browser) solution
Mitch VanDuyn
@catmando
@bwl21 we are very heavy users of the old wkhtmltopdf but are now beta testing using puppeteer. It seems very stable and well supported. We do a lot with it. If u need any help let me know and I will put u in touch with one of developers
For example custom designs that are rendered using a combination of svg, html 5 and lots of opal and js like this one here https://hyperloop.catprint.com/drafts/new/doodle/1/1261/personalize?category=Holidays&per_page=12
Are then rendered to a print ready PDF Using puppeteer
Guillaume Grossetie
@Mogztter
That's really nice, when you say "print ready" you mean with crops marks and bleeds ? I was looking at a solution to generate them because I want to offer an Illustrator alternative :wink:
Guillaume Grossetie
@Mogztter
(I was checking your Instagram, how many cats do you have ?! 🙀😸😻)
Mitch VanDuyn
@catmando
The customer service department takes in cats that need to find homes. They stay a few weeks or a few months. I don’t know how many we have taken care of over the years maybe 30? They are not allowed in the factory cause they would get hurt, and they could damage the machinery.
Yes we also add all crop marks, bar codes, and other details by layering PDF images that are generated from html / svg. It all goes through wkhmtltopdf ( soon puppeteer)
It’s a Separate Sinatra app that runs on a cloud hosted scalable server farm
The main site is a Hyperstack app
Guillaume Grossetie
@Mogztter
so basically you generate a pdf file then you add layer on this pdf using ?
I really want to know more about this part. Currently I'm generating a A5 flyer (the pdf size is A5) but in order to add crop marks, bar codes, colors etc.. the pdf size should be bigger but I don't really know how to add layers on an existing pdf and if I want to add these details in the source HTML I will need to use a lot of absolute positioning :pensive:
Mitch VanDuyn
@catmando
@/all we are investigating a very strange problem. I am wondering if anybody has ever seen anything like this. I doubt at this point its even anything to do with Opal.
the problem is we have a method like this:
def foo(arg1, arg2, arg3, arg4 = SOME_CONST)
    ...
    puts "arg4 is true" if arg4
    puts "!arg4 is false" unless !arg4  # <---INTERMITTENTLY this line will not print when the line above and below prints!
    puts "!!arg4 is true" if !!arg4
    ...
end
yes its that bizarre
we see
Mitch VanDuyn
@catmando
arg4 is true
!!arg4 is true
however we can't reproduce it in a simple example, we are seeing this in a method used a lot in Hyperstack, and only on safari, and only when the app is minified