-
Notifications
You must be signed in to change notification settings - Fork 188
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
The Opal runtime dependency problem with Asciidoctor.js and other plugins #187
Comments
While we are in breaking changes mode, I'll put this in our next release as well. I'll also plug the fact that |
At first, I started with a loose requirement on asciidoctor.js version but got this stack trace:
I think this is due to a mismatch between the code generated by Ruby Opal versus what Asciidoctor.js Opal runtime is. Investigating more. |
Put an explicit version dep in asciidoctor-reveal.js's
It worked but without the So what is the use of the peerDep if it can't put a proper restriction, I'm confused here. It implies we will need to adjust the README everytime we adjust our opal or asciidoctor.js dependency. Also, someone seeing our README (from master) might get confused if we bumped our dependency for development but the last packaged version dependency requires an older version. Am I too old school here and seeing issues that don't exist? |
Meaning that Asciidoctor.js 1.5.7 is not compatible with Asciidoctor Reveal.js (master).
Yes, most likely 😞 It's really hard to predict when a new version of Opal will break "compile" compatibility. But it looks like Asciidoctor.js 1.5.6 is compatible with Opal 0.11.1 and Asciidoctor.js 1.5.7 is only compatible with Opal master (unreleased). I think you don't even have a warning when you install asciidoctor.js 1.5.7 (ie. when you provide the peer dependency) because it's a patch version. So npm assumes that version 1.5.6 and 1.5.7 should work the same... Can we use an unreleased version as a Gem dependency ? https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/asciidoctor-revealjs.gemspec#L46 |
Ok, it worked with the pinned Gem but I'm wondering if the cure isn't worse than the disease... Let me explain: I'm a user, I don't care about what version of asciidoctor-revealjs or asciidoctor.js I run. All I care is that my slides convert properly. Now, we build our node package with a specific opal, and we need the matching runtime opal, which is out of this project's dependency list. So two different projects need to sync: asciidoctor.js' latest release, will require me to do a release with matching opal. More work for me. Requests for releases when I might not be able to deliver them due to other personal constraints. Plus we are saying: asciidoctor.js is a peer dependency, so more work for the user (one more line to type, to be specific). All this for the use-case that someone might re-use the same asciidoctor.js across presentations (and thus would save a little disk space and install time). I might be wrong, or there's some advantage I might not see. Right now, all I'm thinking is confused colleagues saying:
I propose that, given the current [Opal] constraints, asciidoctor.js is currently a direct upstream dependency of asciidoctor-reveal.js, and, as such, we cannot promote it to a peer dependency. Otherwise this is going to be harder on users and on this project (tracking opal revs, forced releases after asciidoctor.js releases). Am I mistaken here? Because I definitely could. But, as Tron taught me, I fight for the users! |
You raise valid concerns, and I love that you fight for the users. I just want to clarify one point for the discussion:
I don't think that's the objective of a peer dependency. The reason for a peer dependency is to allow the user to choose which version of the library they want to use, and have control over installing it within the project. It's used in cases when it's only a loose dependency (hence peer). While it's true that asciidoctor-reveal.js needs to use Asciidoctor/Asciidoctor.js, it doesn't need any specific one (once we get things stabilized). And thus we give the user that flexibility. In short, a converter uses asciidoctor.js, but it's not responsible on bringing it (because there could be other plugins/extensions that use asciidoctor.js too). |
Dan is right but until we use semantic versioning I think it's better to use a direct dependency. |
Sounds like a plan. |
Sounds good. Targeting this move to a peerDependency for later. As a reminder for myself later. Even under semantic versioning, we will need to be careful with Asciidoctor.js' opal-runtime requirement and this project's opal build-time dependency. They will need to be compatible. Hopefully Opal will have stabilized then. Another note to self: the code is here: https://github.com/obilodeau/asciidoctor-reveal.js/tree/asciidoctorjs-peer-dependency, build failed because I forgot to add the asciidoctor.js installation in travis |
@Mogztter I was thinking of closing this due to the way we now specify the However, are we really handling the problem of Opal versions mismatch? If, in the future, you release I gave this some thought and since this would satisfy mixing plugins (like diagram and reveal.js) it would be nice to handle this cleanly for 3.0. Until Opal stabilizes (or figures how to mix generated code from different versions), I don't see a long term solution besides making So I thought of an alternate satisfactory solution: we should specify the version in the
But I would like to see that agreement of not breaking things somewhere in the |
That's true but I will release a breaking/major version of Asciidoctor.js when a new version of Opal is not binary compatible.
I think that's a good idea. We could also add a compatibility matrix table:
Asciidoctor.js now adheres to semantic versioning and binary-incompatibility is a breaking change. |
…ctor#187) Looks like this could work to address the Opal dependency problem.
I don't think think this project should have a direct dependency on asciidoctor.js. Instead, we should only declare asciidoctor.js as a peer dependency.
We'll need to document the minimum version of asciidoctor.js a given Asciidoctor Reveal.js release supports. We could do that through the peer dependency, or we can simply document it in the README.
We'll also need to update the install instructions and the development instructions since we will need to manually install the
asciidoctor.js
dependency.We are also making this change in the CLI: https://github.com/asciidoctor/asciidoctor-cli.js
The text was updated successfully, but these errors were encountered: