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

Longterm: Decouple from jQuery #6

Open
mooeypoo opened this issue Aug 9, 2019 · 7 comments
Open

Longterm: Decouple from jQuery #6

mooeypoo opened this issue Aug 9, 2019 · 7 comments

Comments

@mooeypoo
Copy link
Owner

mooeypoo commented Aug 9, 2019

jQuery was mostly used as a relatively quick solution for the API and DOM manipulation, but there's no need for it, it clutters the library, creates unnecessary dependency, and prevents the library from being used with other platforms.

Krinkle added a commit to Krinkle/jquery.wikilookup that referenced this issue Apr 11, 2020
* This starts the decoupling process by separating the jQuery
  plugin from the standalone Wikilookup API. An alias is kept
  for compatibility (verified by unit tests which I intentionally
  left unmodified in this commit).

* Update ESLint config to only whitelist "jQuery", and not "$".
  This project uses file closures to map from one to the other,
  which is presumably to support WordPress themes that might
  have other legacy libraries occupying the $ global
  (e.g. via jQuery.noConflict etc). Enforce this to avoid mistakes
  from slipping in by only whitelisting the one we want to use
  globally.

  No violations were found by ESLint :)

* Update some of the public-facing titles to refer to the
  library as Wikilookup instead of jQuery.wikilookup,
  jQuery.Wikilookup or $.wikilookup.

Ref mooeypoo#6.
@Krinkle
Copy link
Contributor

Krinkle commented Apr 11, 2020

@mooeypoo You may want to rename this repository as well, e.g. as mooeypoo/wikilookup.

If you're interested in and that worried about redirects:

  • GitHub will maintain redirects for all HTTP urls (readme, commit links, issues etc.).
  • … as well as for all Git interactions (e.g. any clone you or other have can still push/pull the same).
  • I don't know off-hand whether the URL https://mooeypoo.github.io/jquery.wikilookup/ will become a redirect. It probably will, but if not, it can also be redirected manually, by creating https://mooeypoo.github.io/ (via a repo called mooeypoo.github.io, see https://pages.github.com/) and adding the jquery.wikilookup/index.html file with redirect Jekyll-style, like so:
<!DOCTYPE html>
<link rel="canonical" href="https://mooeypoo.github.io/wikilookup/">
<meta http-equiv="refresh" content="0; url=https://mooeypoo.github.io/wikilookup/">
<script>location.href="https://mooeypoo.github.io/wikilookup/"</script>

mooeypoo pushed a commit that referenced this issue Apr 11, 2020
* This starts the decoupling process by separating the jQuery
  plugin from the standalone Wikilookup API. An alias is kept
  for compatibility (verified by unit tests which I intentionally
  left unmodified in this commit).

* Update ESLint config to only whitelist "jQuery", and not "$".
  This project uses file closures to map from one to the other,
  which is presumably to support WordPress themes that might
  have other legacy libraries occupying the $ global
  (e.g. via jQuery.noConflict etc). Enforce this to avoid mistakes
  from slipping in by only whitelisting the one we want to use
  globally.

  No violations were found by ESLint :)

* Update some of the public-facing titles to refer to the
  library as Wikilookup instead of jQuery.wikilookup,
  jQuery.Wikilookup or $.wikilookup.

Ref #6.
@mooeypoo
Copy link
Owner Author

I'm giving this a try now; renaming the repo.

@Krinkle
Copy link
Contributor

Krinkle commented Apr 11, 2020

So... looks like everything is redirected except the site. Wanna give the workaround a try?

@mooeypoo
Copy link
Owner Author

Okay, the repo name change worked and I updated the link to the demos from the README.

I'm working on the workaround now.

@mooeypoo
Copy link
Owner Author

hm, doesn't seem to be working,but I think it's because of the folder. https://github.com/mooeypoo/mooeypoo.github.io

@Krinkle
Copy link
Contributor

Krinkle commented Apr 11, 2020

It's working for me :)

https://mooeypoo.github.io/jquery.wikilookup/ (with and without trailing slash) both now redirect to https://mooeypoo.github.io/wikilookup/

@mooeypoo
Copy link
Owner Author

It's working now! Maybe a caching issue :) Thanks!!

Krinkle added a commit to Krinkle/jquery.wikilookup that referenced this issue Apr 11, 2020
* Update tests to use the Wikilook global directly instead.

* Minor doc fixes.

* Remove redundant "$()" wrapping in wikilookup.js jQuery adapter.
  The "this" object must be a jQuery object already.

Ref mooeypoo#6.
@Krinkle Krinkle mentioned this issue Apr 11, 2020
mooeypoo pushed a commit that referenced this issue Oct 5, 2020
* Decoupling clean ups and minor improvements

* Update tests to use the Wikilook global directly instead.

* Minor doc fixes.

* Remove redundant "$()" wrapping in wikilookup.js jQuery adapter.
  The "this" object must be a jQuery object already.

Ref #6.

* jquery: Make $.fn.wikilookup() a chainable method

Enables things like:

```
$('foo')
	.some()
	.wikilookup()
	.thing()
```
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

No branches or pull requests

2 participants