Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd0ce00c

Browse files
authored
Core: Migrate from AMD to ES modules 🎉
Migrate all source AMD modules to ECMAScript modules. The final bundleis compiled by a custom build process that uses Rollup under the hood.Test files themselves are still loaded via RequireJS as that has to work inIE 11.Tests can now be run in "Load as modules" mode which replaces the previous"Load with AMD" option. That option of running tests doesn't work in IEand Edge as it requires support for dynamic imports.Some of the changes required by the migration:* check `typeof` of `noGlobal` instead of using the variable directly as it's not available when modules are used* change the nonce module to be an object as ECMASscript module exports are immutable* remove some unused exports* import `./core/parseHTML.js` directly in `jquery.js` so that it's not being cut out when the `ajax` module is excluded in a custom compilationClosesgh-4541
1 parenta612733 commitd0ce00c

File tree

124 files changed

+801
-1324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+801
-1324
lines changed

‎.eslintrc-browser.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
"env": {},
1616

1717
"globals": {
18-
"window":true,
19-
"define":true,
20-
"module":true
18+
"window":true
2119
},
2220

2321
"rules": {

‎.eslintrc-node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"extends":"jquery",
55

66
"parserOptions": {
7-
"ecmaVersion":2017
7+
"ecmaVersion":2018
88
},
99

1010
"env": {

‎.eslintrc.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"root":true,
33

4-
"extends":"./.eslintrc-node.json"
4+
"extends":"./.eslintrc-node.json",
5+
6+
"overrides": [
7+
{
8+
"files":"rollup.config.js",
9+
"parserOptions": {
10+
"sourceType":"module"
11+
}
12+
}
13+
]
514
}

‎CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ Rather than rebuilding jQuery with `grunt` every time you make a change, you can
129129
$ grunt watch
130130
```
131131

132-
Alternatively, you can**load testsin AMD** to avoid the need for rebuilding altogether.
132+
Alternatively, you can**load testsas ECMAScript modules** to avoid the need for rebuilding altogether.
133133

134-
Click "Loadwith AMD" after loading the test page.
134+
Click "Loadas modules" after loading the test page.
135135

136136

137137
###Repo organization
138138

139-
The jQuery source is organized withAMD modules and thenconcatenated and compiled at build time.
139+
The jQuery source is organized withECMAScript modules and thencompiled into one file at build time.
140140

141141
jQuery also contains some special modules we call "var modules", which are placed in folders named "var". At build time, these small modules are compiled to simple var statements. This makes it easy for us to share variables across modules. Browse the "src" folder for examples.
142142

‎Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ module.exports = function( grunt ) {
177177
"test/unit/ready.js",
178178

179179
{pattern:"dist/jquery.*",included:false,served:true},
180-
{pattern:"src/**",included:false,served:true},
180+
{pattern:"src/**",type:"module",included:false,served:true},
181181
{pattern:"node_modules/**",included:false,served:true},
182182
{
183183
pattern:"test/**/*.@(js|css|jpg|html|xml|svg)",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp