jquery/test
Michał Gołębiowski-Owczarek 46f6e3da79
Core: Move the factory to separate exports
Since versions 1.11.0/2.1.0, jQuery has used a module wrapper with one strange
addition - in CommonJS environments, if a global `window` with a `document` was
not present, jQuery exported a factory accepting a `window` implementation and
returning jQuery.

This approach created a number of problems:
1. Properly typing jQuery would be a nightmare as the exported value depends on
   the environment. In practice, typing definitions ignored the factory case.
2. Since we now use named exports for the jQuery module version, it felt weird
   to have `jQuery` and `$` pointing to the factory instead of real jQuery.

Instead, for jQuery 4.0 we leverage the just added `exports` field in
`package.json` to expose completely separate factory entry points: one for the
full build, one for the slim one.

Exports definitions for `./factory` & `./factory-slim` are simpler than for `.`
and `./slim` - this is because it's a new entry point, we only expose a named
export and so there's no issue with just pointing Node.js to the CommonJS
version (we cannot use the module version for `import` from Node.js to avoid
double package hazard). The factory entry points are also not meant for the Web
browser which always has a proper `window` - and they'd be unfit for an
inclusion in a regular script tag anyway. Because of that, we also don't
generate minified versions of these entry points.

The factory files are not pushed to the CDN since they are mostly aimed
at Node.js.

Closes gh-5293
2023-09-19 18:58:24 +02:00
..
data Build: migrate most grunt tasks off of grunt 2023-09-18 12:39:00 -04:00
integration Event: Fix delegated radio events when arrow keys are used 2015-10-18 13:06:37 -04:00
node_smoke_tests Core: Move the factory to separate exports 2023-09-19 18:58:24 +02:00
promises_aplus_adapters Core: Move the factory to separate exports 2023-09-19 18:58:24 +02:00
unit Build: migrate most grunt tasks off of grunt 2023-09-18 12:39:00 -04:00
delegatetest.html Tests: Change quotes according to style guidelines 2015-10-18 13:17:23 -04:00
hovertest.html Ref #13316: Sync all documents on full vs. minified source. Close gh-1147. 2013-02-07 15:16:28 -05:00
index.html Build: Drop individual AMD modules 2023-06-27 18:23:58 +02:00
jquery.js Core: Use named exports in src/ 2023-09-12 02:27:19 +02:00
karma.context.html Build: Drop individual AMD modules 2023-06-27 18:23:58 +02:00
karma.debug.html Build: Drop individual AMD modules 2023-06-27 18:23:58 +02:00
localfile.html Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:49:29 +01:00
middleware-mockserver.cjs Build: migrate most grunt tasks off of grunt 2023-09-18 12:39:00 -04:00
networkerror.html Docs: Replace #NUMBER Trac issue references with trac-NUMBER 2022-01-04 16:27:18 +01:00
server.js Build: migrate most grunt tasks off of grunt 2023-09-18 12:39:00 -04:00
xhtml.php Added a way to run the test suite as an XHTML page. 2009-01-19 18:14:51 +00:00