Foundation-sites: jQuery 3 support request

Created on 24 May 2016  Â·  25Comments  Â·  Source: foundation/foundation-sites

This is not a bug, but a question / request.

Are there any plans in the near future to support jQuery 3 given that RC1 was just released recently? jQuery 3 has the same IE support (9+) as Foundation 6, so it would seem a good fit.

invalid feature request

Most helpful comment

At the very least, Foundation should stop using deprecated functions. We tested jQuery 3.0RC on our site but got errors in Foundation because it's still using .load() event handlers that have been deprecated since jQuery 1.8.

https://api.jquery.com/category/deprecated/

All 25 comments

+1

But I think this should be optional. For bigger projects it's not easy to move to jQuery 3.

At the very least, Foundation should stop using deprecated functions. We tested jQuery 3.0RC on our site but got errors in Foundation because it's still using .load() event handlers that have been deprecated since jQuery 1.8.

https://api.jquery.com/category/deprecated/

Made a PR (https://github.com/zurb/foundation-sites/pull/8923) to remove references to .load()

As an interim measure it should be possible to simply put jQuery Migrate 3.0 into the site to shim the deprecated functionality.

+1

Ran into this today. What is the status of this? As pointed out this is a function that has been deprecated for a very long time, so shouldn't be used regardless. It was deprecated I think even before JQuery 2

+1

+1

+1

+1

+1 It's been out for 3 months, would love official support for this.

+1

This is fixed in develop, will be released in 6.2.4 in the next few weeks.

@kball Does this mean Foundation's JS is compatible with jQuery 3, or does it mean that the version of jQuery that it ships with will be jQuery 3? For example in the node package, *node_modules\foundation-sites\vendor\jquery*

Great question @olthof - as of now we're packaging up 2 still, but 3.0 is supposed to be slimmer and faster, so seems like perhaps we should upgrade the default.

@colin-marshall @Owlbertz what are your thoughts?

+1

Why is jquery shiped together with foundation? I never used it and even didn't know it's done this why. I think it would be best to let the user choose the version. Every packagemanager will handle the dependencies and if somebody isn't using a packagemanager he must be aware of the fact, that he needs to resolve dependencies by himself.

JQuery is well known framework having a package manager will force Zurb to
handle all the differences between the versions which is itself a project
called version control. If Zurb adds this feature it will be a great deal
or rework on the optimization part.

On Sun, Oct 2, 2016, 09:25 Daniel Schuba [email protected] wrote:

Why is jquery shiped together with foundation? I never used it and even
didn't know it's done this why. I think it would be best to let the user
choose the version. Every packagemanager will handle the dependencies and
if somebody isn't using a packagemanager he must be aware of the fact, that
he needs to resolve dependencies by himself.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/zurb/foundation-sites/issues/8834#issuecomment-250959945,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVWGTDO75I5drae133xh7LiCGZOjaZj9ks5qv2pkgaJpZM4IlApC
.

@kball

What were you referencing here?

This is fixed in develop, will be released in 6.2.4 in the next few weeks.

6.2.4 is just recently bower-available, but an update still leaves us with jQuery 2x.

foundation-sites#6.2.4 bower_components/foundation-sites
├── jquery#2.2.4
└── what-input#2.0.1

Can we get to F6 + jQuery 3 (yet)?

This

https://github.com/zurb/foundation-sites/issues/8975#issuecomment-255409772

@kball commented a day ago

@Baedda It should be. I just update the release notes highlighting this for the PR in question that fixed it.

We decided not to change the default to jQuery 3 until the minor release, but projects using 3 should now work.

suggests that FS 6.3.4 _IS_ jQuery-ready, but at Bower update of Jquery

bower install jquery
    Unable to find a suitable version for jquery, please choose one by typing one of the numbers below:
        1) jquery#~2.2.0 which resolved to 2.2.4 and is required by foundation-sites#6.2.4
        2) jquery#^3.1.1 which resolved to 3.1.1

    Prefix the choice with ! to persist it to bower.json
-> !2

bower update
    Please note that,
        foundation-sites#6.2.4 depends on jquery#~2.2.0 which resolved to jquery#2.2.4
        pgnetwork-site depends on jquery#^3.1.1 which resolved to jquery#3.1.1
    Resort to using jquery#^3.1.1 which resolved to jquery#3.1.1
    Code incompatibilities may occur.

@SShrike committed

https://github.com/SShrike/website/commit/a1ac11f2e7bd5b92c83f350b0e2b6ac60386550f

Update foundation-sites to the latest version

Fixes compatibility with jQuery 3.x, so the jQuery migration script has
also been removed.

That commit was to the 6.2.4-rc. So is it supposed to be IN the 6.2.4 release already?

No problems on the npm side. Probably a misconfiguration in bower.json?

@tyteen4a03

here's what I've got currently:

cd <proj root>
cat bower.json
    {
      "name": "test-site",
      "description": "===",
      "main": "gulpfile.babel.js",
      "license": "ISC",
      "homepage": "",
      "ignore": [
        "**/.*",
        "node_modules",
        "bower_components",
        "test",
        "tests"
      ],
      "dependencies": {
        "foundation-sites": "^6.2.4",
        "jquery": "^3.1.1"
      },
      "private": true,
      "resolutions": {
        "jquery": "^3.1.1"
      }
    }

cat bower_components/foundation-sites/bower.json
    {
      "name": "foundation-sites",
      "version": "6.2.4",
      "license": "MIT",
      "main": [
        "scss/foundation.scss",
        "dist/foundation.js"
      ],
      "ignore": [
        "config",
        "docs",
        "gulp",
        "lib",
        "test",
        "composer.json",
        "CONTRIBUTING.md",
        "gulpfile.js",
        "meteor-README.md",
        "package.js",
        "package.json",
        "sache.json",
        ".editorconfig",
        ".npm",
        ".gitignore",
        ".npmignore",
        ".versions",
        ".babelrc"
      ],
      "dependencies": {
        "jquery": "~3.1.0",
        "what-input": "~2.0.0"
      }
    }

Have you tried deleting bower_components and reinstalling?

Also, resolutions shouldn't be needed.

@tyteen4a03

Have you tried deleting bower_components and reinstalling?

Multiple times, as well as complete clean installs. Reproducible as above

Also, resolutions shouldn't be needed.

Is that a comment to/for me? I certainly didn't add that ... manually anyway ...

Closing this out since we have been using jQuery 3+ for awhile now. Feel free to reopen if you feel I have done so in error.

Was this page helpful?
0 / 5 - 0 ratings