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

Attempt jQuery removal #18

Open
jondot opened this issue Jun 27, 2017 · 2 comments
Open

Attempt jQuery removal #18

jondot opened this issue Jun 27, 2017 · 2 comments

Comments

@jondot
Copy link
Owner

jondot commented Jun 27, 2017

Goal is to provide a more lightweight bundle size, one less dependency, and to use Velocity's built-in capability instead of jQuery's.

Challenge is to find and separate dependencies from tweene and tweene-velocity which treat jQuery as a global dependency and relies on jQuery plugin system.

This is motivated by #17, #16, #11

@jondot
Copy link
Owner Author

jondot commented Jul 1, 2017

Updates:

Who's depending on jQuery:

  • velocity
  • tweene-velocity

What's been attempted:

  • Complete removal, swapping basic jQuery functions with vanilla ones and shims from Velocity. Result: jQuery queues, data are still needed.
  • Swapping jQuery with a custom build of Zepto. Result: jQuery queues are still needed

Current options:

  • UPDATE: make tweene a module that takes a jquery module at run time, so that we can require it and internalize jQuery
  • Continue on Zepto direction
  • Build a minimal jQuery from jQuery itself, and inject it in once no jQuery has been detected.

I've also learned that due to nature of velocity/tweene it is discouraging to actually modify their code to remove jQuery completely (or in Velocity's case, jQuery shims).

@jondot
Copy link
Owner Author

jondot commented Jul 1, 2017

Updates:

This task is now done in the jquery-sectomy branch. You don't have to explicitly have jQuery in your project any more.

You can try it right now by doing:

$ yarn add react-flight@next

Or by using any of the updated samples.

Implementation notes:
With that said, I opted not to really remove jQuery (see analysis above), but to make sure all dependencies are good citizens and can use an internally required jQuery version. We're also using jquery-slim, for what its worth.

I'll be waiting for feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant