Skip to content

The jquery.factory.js bundle is missing in the npm package in the 4.0.0-beta release #5411

@gdsw

Description

@gdsw

Congratulations on the release, the changes look good!

Description

According to the npm package description, in order to use jQuery with JSDOM, you can now use a Factory:

const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
const { jQueryFactory } = require( "jquery/factory" );
const $ = jQueryFactory( window );

When the library is installed through npm:

npm install [email protected]

The following files are available:

image

According to the package.json, there should be a factory in the dist and dist-module folders:

image

Link to test case

This is an issue with the bundle itself, rather than some particular jQuery functionality, but the test is rather simple:

  1. Install the package via NPM.
  2. Create a simple test.js file with the following contents:
const { JSDOM } = require("jsdom");
const { window } = new JSDOM();
const { jQueryFactory } = require("jquery/factory");
const $ = jQuery = jQueryFactory( window );

console.log("success");
  1. And run it:
    node test.js

image

I am guessing that the following array is the culprit:

https://github.com/jquery/jquery/blob/main/build/release/dist.js#L15

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions