14 Commits

Author SHA1 Message Date
Misha Golenkov
f9778c849d MDL-78379 js: Add missing newline character 2023-07-06 15:55:31 +10:00
Andrew Nicols
9b174fd3cc
MDL-78157 js: Be more careful about inserting missing module names
It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.

Unfortunately our requirejs.php wrapper is dumb and does not understand
this.

In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.

In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
2023-05-22 14:40:41 +08:00
Andrew Nicols
dde8111811 MDL-77559 js: Revert "MDL-75012 js: Drop support for modules built pre-babel"
This reverts commit 84c650489ab097771b50e6c63d26ffdd001db037.
2023-03-09 08:20:53 +08:00
Andrew Nicols
84c650489a MDL-75012 js: Drop support for modules built pre-babel
We now include more polyfills than we have ever done, and some of these
cause false-positives on our code to address modules which do not have a
name.

We started adding module names to modules in Moodle 3.8 at _build_ time
and kept support for modules which were not transpiled using Babel
before that point.

We no longer need to support this as all pre-3.8 Moodle versions are
long out of support. The most recent to go out of support was Moodle
3.5, which went completely out of support in May 2021.

We should not support code written and minified without a transpilation
phase from this time any longer.
2023-03-02 11:55:31 +08:00
Andrew Nicols
5d66721655 MDL-73183 js: Stop supporting debug mode for amd
This option was used to return the source files, but we do not support
this any more because we use source maps instead and require babel
transformation to support ES2015.

It does not make sense to support this code path any longer.
2022-02-08 12:05:31 +08:00
Andrew Nicols
5fc84028e9 MDL-67327 js: Make requirejs.php more fault tolerant 2019-12-12 15:58:19 +08:00
Andrew Nicols
9ea892d216 MDL-66192 javascript: Allow subdirs in AMD module names 2019-07-26 07:04:08 +08:00
Andrew Nicols
73d3dfecc6 MDL-62497 javascript: lazy load js modules when cachejs is disabled 2019-07-19 14:12:49 +08:00
Ryan Wyllie
c53f86d408 MDL-62497 javascript: add babel transpiling to Grunt for ES6 support 2019-07-19 14:12:48 +08:00
Andrew Nicols
0d8ad3b500 MDL-59431 requirejs: Prioritise errors 2017-07-12 10:05:59 +08:00
Andrew Nicols
d45a6d4fe3 MDL-59431 requirejs: Correct failed JS check 2017-07-12 09:45:45 +08:00
Tim Hunt
39c40adad1 MDL-59431 requirejs: better reporting if a JS file cannot be loaded 2017-06-30 17:17:26 +01:00
Mark Nielsen
d900d61798 MDL-55453 core_lib: Fix usage of js_send_uncached 2016-08-03 10:18:41 -07:00
Damyon Wiese
adeb96d28f MDL-49046 javascript: Add support for AMD modules and jquery.
Grunt is the build tool.
2015-02-23 16:23:10 +08:00