Skip to content

Commit

Permalink
Remove explicit support for Zepto
Browse files Browse the repository at this point in the history
Fixes #105
  • Loading branch information
elia committed Oct 13, 2021
1 parent fec13dc commit cbef2ae
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 36 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [0.5.0](https://github.com/opal/opal-jquery/compare/v0.4.6...HEAD) Unreleased

*see diff*
* Remove support for Zepto.
Zepto hasn't received substantial updates for several and is no longer under active development.
opal-jquery will still accept PRs targeting Zepto as long as they're compatible with jQuery.

## [0.4.6](https://github.com/opal/opal-jquery/compare/v0.4.5...v0.4.6) Unreleased

Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Build Status](http://img.shields.io/travis/opal/opal-jquery/master.svg)](http://travis-ci.org/opal/opal-jquery)

**opal-jquery** provides DOM access to opal by wrapping jQuery (or zepto)
**opal-jquery** provides DOM access to opal by wrapping jQuery
and providing a nice ruby syntax for dealing with jQuery instances.

<!-- See the Opal website for [documentation](http://opalrb.org/docs/jquery). -->
Expand Down Expand Up @@ -59,13 +59,9 @@ Run the tests inside a phantom.js runner:
$ bundle exec rake


### Zepto

opal-jquery also supports zepto. To run specs for zepto use the rake task:

$ bundle exec rake zepto

### About Zepto support

opal-jquery used to supports [Zepto](https://zeptojs.com), but the project is now semi abandoned and thus is not explicitly supported anymore. That being said, we still accept PRs and fixes targeted support for Zepto, as long as they also work for jQuery.


## Getting Started
Expand All @@ -89,7 +85,7 @@ alert "Hello from jquery + opal"
> You need to bring your own `jquery.js` file as the gem does not include one. If
> you are using the asset pipeline with rails, then this should be available
> already, otherwise download a copy and place it into `app/` or whichever directory
> you are compiling assets from. You can alternatively require a zepto instance.
> you are compiling assets from.
The `#alert` method is provided by `opal-jquery`. If the message displays, then
`jquery` support should be working.
Expand All @@ -102,10 +98,6 @@ bridged instances of jquery objects. Just like ruby arrays are just javascript
arrays, `Element` instances are just jquery objects. This makes interaction
with jquery plugins much easier.

Also, `Element` will try to bridge with Zepto if it cannot find jQuery loaded,
making it ideal for mobile applications as well.




## Interacting with the DOM
Expand Down
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ Opal::RSpec::RakeTask.new(:jquery3) do |server, task|
task.default_path = 'spec-opal'
end

Opal::RSpec::RakeTask.new(:zepto) do |server, task|
server.index_path = 'spec-opal/zepto/index.html.erb'
task.default_path = 'spec-opal'
end

desc "Build build/opal-jquery.js"
task :dist do
require 'fileutils'
Expand Down
8 changes: 2 additions & 6 deletions lib/opal/jquery/constants.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
require 'native'

unless defined?(JQUERY_CLASS)
case
when `!!Opal.global.jQuery`
if `!!Opal.global.jQuery`
JQUERY_CLASS = JQUERY_SELECTOR = `Opal.global.jQuery`
when `!!Opal.global.Zepto`
JQUERY_SELECTOR = `Opal.global.Zepto`
JQUERY_CLASS = `Opal.global.Zepto.zepto.Z`
else
raise NameError, "Can't find jQuery or Zepto. jQuery must be included before opal-jquery"
raise NameError, "Can't find jQuery. jQuery must be included before opal-jquery."
end
end
10 changes: 0 additions & 10 deletions spec-opal/zepto/index.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions spec-opal/zepto/zepto.js

This file was deleted.

0 comments on commit cbef2ae

Please sign in to comment.