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

Drop codemirror-rails and coffee => Rails 6 + 7 support #3

Merged
merged 7 commits into from
May 16, 2022

Conversation

apepper
Copy link
Member

@apepper apepper commented May 13, 2022

https://github.com/fixlr/codemirror-rails is officially not supporting Rails 6 or Rails 7. But both rails versions still support the asset pipeline if needed.

This PR converts "coffee" to plain js to remove the coffee dependency.

It also inlines the "vendor/" part of codemirror-rails so that it can be directly used. So version CodeMirror 5.16.0 is now included in the package itself.

@apepper apepper requested a review from dcsaszar May 13, 2022 07:35
@apepper apepper changed the title Drop codemirror-rails and coffee Drop codemirror-rails and coffee => Rails 6 + 7 support May 13, 2022
Copy link
Collaborator

@dcsaszar dcsaszar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but one issue

Also:

  • Is the LGPL we currently use compatible with the included MIT? If unsure, we could switch to MIT.

@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.author = 'Scrivito'
s.description = 'Make CodeMirror available as a Scrivito editor'
s.email = '[email protected]'
s.files = Dir['READ*', 'LIC*', 'app/**/*', 'lib/**/*']
s.files = Dir['READ*', 'LIC*', 'app/**/*', 'lib/**/*', 'vendor/**/*']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The CodeMirror code looks like the addons rely on the main script to be loaded first. If I read this correctly, we should make the order explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how codemirror-rails defines its "files":

https://github.com/fixlr/codemirror-rails/blob/cb5e9eee1bac8b8b6933d330591a5f83100094d8/codemirror-rails.gemspec#L13

So I think we're ok with the current approach.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Ruby even turned to sorted at some point: https://bugs.ruby-lang.org/issues/8709

@dcsaszar dcsaszar self-assigned this May 13, 2022
@apepper
Copy link
Member Author

apepper commented May 16, 2022

Is the LGPL we currently use compatible with the included MIT? If unsure, we could switch to MIT.

Since codemirror is placed in vendor and its javascript files have the following headers:

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

I think mixing them is good enough. But since scrivito_codemirror_editor does not contain much code I simply switch to MIT to be on the safe side.

@apepper apepper requested a review from dcsaszar May 16, 2022 07:08
@dcsaszar dcsaszar merged commit 5b82d93 into master May 16, 2022
@dcsaszar dcsaszar deleted the no_codemirror-rails branch May 16, 2022 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants