🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7993682
Core: Migrate all source AMD modules to ECMAScript modules
mgol Oct 23, 2019
11bc60a
Core: Use explicit extensions for imports so that they work natively
mgol Oct 23, 2019
8cd544d
Core: Make noGlobal handling in global.js work in ES modules mode
mgol Oct 23, 2019
c90d8a1
Ajax: Workaround nonce being immutable as an ES module
mgol Oct 23, 2019
fa6878b
Build: Add a basic Rollup config
mgol Oct 23, 2019
a72e591
Build: Remove an export from src/queue/delay.js
mgol Oct 24, 2019
82cb929
Build: Make sure the jQuery global isn't set when ES modules are used
mgol Oct 24, 2019
d68ad3c
Tests: Convert test setup to work with source ES modules
mgol Oct 24, 2019
e0e5bff
Build: A basic fully working Rollup build (`grunt` & `npm test` both …
mgol Oct 28, 2019
9dc310e
Build: Normalize srcFolder, fix rollupHypotheticalOptions usage
mgol Nov 14, 2019
7fe6f83
Core: disable the max-len rule for the version variable
mgol Nov 14, 2019
c6b75df
Build: Add back support for custom compilation
mgol Nov 14, 2019
1065fa3
Core: Import "./core/parseHTML.js" directly in jquery.js
mgol Nov 14, 2019
a4250b2
Core: Minor comments tweaks
mgol Nov 14, 2019
afeb0eb
Build: rename jsmodules to esmodules
mgol Nov 15, 2019
3b21968
Build: Use more of Rollup API, simplify logic
mgol Nov 17, 2019
f6f0545
Build: Simplify ESLint exclusions & globals, revert globalJQuery to n…
mgol Nov 17, 2019
910d815
Build: Move the parseHTML import to save size
mgol Nov 18, 2019
c2d5407
Build: Compress ajax/var/nonce.js
mgol Nov 18, 2019
eba151a
Build: ESLint tweaks
mgol Nov 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ajax: Workaround nonce being immutable as an ES module
ES modules bindings are immutable and we relied on the `ajax/var/nonce.js`
variable being mutable. Workaround it by creating a wrapper object.

We might try to compress it somehow in the future.
  • Loading branch information
mgol committed Oct 28, 2019
commit c90d8a10734e7d32a6d2c818d86ecbbe7e5d1adf
3 changes: 2 additions & 1 deletion src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ jQuery.extend( {
// Add or update anti-cache param if needed
if ( s.cache === false ) {
cacheURL = cacheURL.replace( rantiCache, "$1" );
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" +
( nonce.nonce++ ) + uncached;
}

// Put hash and anti-cache on the URL that will be requested (gh-1732)
Expand Down
2 changes: 1 addition & 1 deletion src/ajax/jsonp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var oldCallbacks = [],
jQuery.ajaxSetup( {
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.nonce++ ) );
this[ callback ] = true;
return callback;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ajax/var/nonce.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default Date.now();
export default { nonce: Date.now() };