Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jan Biedermann
@janbiedermann
Guillaume Grossetie
@Mogztter
as far as I know they are using load to provide "live reload" in development (when you make changes to the codebase)
Guillaume Grossetie
@Mogztter
load means the library is reloadable in testing, which is really important for the lexer development flow. is it causing problems?
I'm not a Ruby expert, does it makes sense to use load in "production" code to make the library reloadable in testing?
Is there a strong argument to not do that?
I think they should use require but I don't want to sound like it's a personal preference
Elia Schito
@elia
We should make load behave properly
The behavior for the two methods is different and they have a good case for using load
Guillaume Grossetie
@Mogztter
Alright :+1:
Did you see my comment about codeclimate on opal/opal#2061 I don't understand the report :pensive:
Elia Schito
@elia
@Mogztter thanks for the patience, I marked them as invalid, the report was just a false positive
@Mogztter can you also please update the commit message to just describe the change (without the resolve)?
Guillaume Grossetie
@Mogztter
@elia cool thanks, and done :)
I was wondering if the "2 spaces before ### titles" helps with conflicts in the changelog?
I've added a changelog on Asciidoctor.js but dealing with conflicts on almost every single pull request is really annoying
Elia Schito
@elia
it's possible, but tbh, was just my pet peeve about reading markdown without rendering and getting a feel of the hierarchy

I've added a changelog on Asciidoctor.js but dealing with conflicts on almost every single pull request is really annoying

completely agree, in fact lately I'm adding to the UNRELEASED after each PR merge, I do that from the web, it ends up in more commits but except from that works fine

Guillaume Grossetie
@Mogztter
I see, thanks for your input
Our initial, boring solution to the problem was to begin adding empty placeholder entries at the beginning of each monthly release cycle. The changelog for the upcoming unreleased version might look like this:
:laughing:
that's actually pretty cool, and when there's no slot available then it's time to release to avoid conflicts
Elia Schito
@elia
yeah, already tried, and bumped in the same problemā€¦ additionally doing the changelog entry after the merge relieves the contributors from yet another chore
Guillaume Grossetie
@Mogztter
I think I will do the same
the yaml solution by GitLab is a bit too much
Elia Schito
@elia
@Mogztter agree, anyway if you find any trick to improve this process let me know please, it's still a pain in the neck
Guillaume Grossetie
@Mogztter
Pretty cool
Guillaume Grossetie
@Mogztter
@elia I was about to suggest merge=union but you are already using it. Did you notice a big improvement?
Elia Schito
@elia
@Mogztter unfortunately it's not supported within GitHub so it's pretty pointless unless you always do the merging locally (sorry for the late response)
Guillaume Grossetie
@Mogztter
:disappointed:
no worries, I didn't approve/review your latest pull requests because I'm not familiar with the methods
Forrest Chang
@fkchang
With this, DHH should be more into opal, IMO https://twitter.com/dhh/status/1223081808503328768
Elia Schito
@elia

šŸ“£ @/all I opened a slack workspace to enable github pull-request reminders and also because of the feature set (vs. gitter looking kinda dead), everyone is welcome to join with this link :link:
https://join.slack.com/t/opalrb/shared_invite/enQtOTQ5NzEyMDEyOTE5LTRhMDk1YmEwMGNhYzhiOGMwNWQ3MjFiZGFjYmM0ZTU0Mjc5NzdkMjkxMmYxMzk2Y2ZjMDU3MGRjMDM0NWRiMDE

The Slack address is https://opalrb.slack.com

I'll still watch gitter notifications if anyone still prefers it, but it's very likely that if everything goes well slack it's gonna be the official chat for Opal

jjgh
@jjgh
Hi everyone, a quick question about Opal. Is it possible from JS to require a Ruby stdlib like for example CSV? Something like this: Opal.$require("csv") ?
If not, what's the recommended way to require a lib so that it can be loaded at the start in the browser along with the "opal.js" src script?
jjgh
@jjgh
so that the browser loads opal.js + the lib I need
Elia Schito
@elia
@jjgh the supported portions of the stdlib are listed here https://opalrb.com/docs/api/v1.0.3/stdlib/index.html (or in the repo under the stdlib dir).
About CSV you can try to compile the MRI version, the documentation has a number of examples on how to compile Ruby files (and requires) to JS.
jjgh
@jjgh
thanks @elia, I'll take a look at it
jjgh
@jjgh
@elia I tried compiling a ruby file with just a "require 'csv'" line, but I'm getting the following error: "can't find file: "csv" in: (Opal::Builder::MissingRequire)"
What does it mean? How can I fix it? (thanks!)
jjgh
@jjgh
also in the documentation I did not find any examples on how to compile / use gems (for when NOT in rails)
jjgh
@jjgh
so in the end what I did is, I created one ruby file with just a " require 'csv' " line, and then I compiled it with this line:
opal --compile ruby-csv-lib.rb > ruby-csv-lib.js --no-opal --include "D:\dev\ruby\Ruby27-x64\lib\ruby\2.7.0\"
then I loaded the resulting js in a html <script> tag.
Now in the js console I'm trying to do something like
Opal.CSV.$new()
but I'm getting this:
Uncaught TypeError: Cannot read property '$new' of undefined
Do you have any clues?
Elia Schito
@elia
This looks odd: opal --compile ruby-csv-lib.rb > ruby-csv-lib.js --no-opal --include "D:\dev\ruby\Ruby27-x64\lib\ruby\2.7.0\"
Should probably be opal --compile ruby-csv-lib.rb --no-opal --include "D:\dev\ruby\Ruby27-x64\lib\ruby\2.7.0\ > ruby-csv-lib.js"
@jjgh also consider that the CSV library is quite extensive and made of many filesā€¦
image.png
I expect it will require some work for it to run, but that probably depends on how you plan to use it
jjgh
@jjgh
Ok @elia I ran your version of the command line and it produced a slightly smaller JS file (just a few kb less). Not sure why, but anyway I think the compilation went ok.
I still have the same problem though: if I do Opal.CSV.$new() from a webpage where I required opal.js and csv.js libs, I still get "Uncaught TypeError: Cannot read property '$new' of undefined".
Why do you think this happens? All other opal classes and methods are there and execute without any problem. It's kinda like as the csv.js is not compiled in a way that can be used.
In the JS console I also tried Opal.require("csv"); and it outputs "false". Do you have any ideas?
Elia Schito
@elia
@jjgh can you put the code somewhere I can try it, a github repo would be great for example
jjgh
@jjgh
@elia sure, I'll get back to this when I have some free time and I'll let you know, thanks!