Pārlūkot izejas kodu

Remove `-D embed_js`. Add compiler error that suggests the use of `haxe.macro.Compiler.includeFile`. (Close #4074)

Andy Li 9 gadi atpakaļ
vecāks
revīzija
0cb23bcc58

+ 2 - 0
extra/CHANGES.txt

@@ -43,6 +43,8 @@
 
 	all : added Lambda.flatten and Lambda.flatMap (#3553)
 	sys : proper quoting/escaping (can be opt-out) for Sys.command and sys.io.Process (#3603)
+	js : added position parameter to haxe.macro.Compiler.includeFile
+	js : removed -D embed-js (#4074)
 
 	Macro features and changes:
 

+ 1 - 2
std/js/JQuery.hx

@@ -400,8 +400,7 @@ extern class JQuery implements ArrayAccess<Element> {
 
 	private static function __init__() : Void untyped {
 		#if embed_js
-		if( untyped __js__("typeof($) == 'undefined'") )
-			haxe.macro.Compiler.includeFile("js/jquery-latest.min.js");
+		#error "Haxe no longer bundle third-party JS libraries. Please remove `-D embed-js`. You may download the JS files and use `haxe.macro.Compiler.includeFile`."
 		#end
 		var q : Dynamic = (untyped js.Browser.window).jQuery;
 		untyped __js__("var js = js || {}");

+ 1 - 1
std/js/SWFObject.hx

@@ -34,7 +34,7 @@ extern class SWFObject {
 
 	private static function __init__() : Void untyped {
 		#if embed_js
-		haxe.macro.Compiler.includeFile("js/swfobject-1.5.js");
+		#error "Haxe no longer bundle third-party JS libraries. Please remove `-D embed-js`. You may download the JS files and use `haxe.macro.Compiler.includeFile`."
 		#end
 		js.SWFObject = deconcept.SWFObject;
 	}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 1
std/js/jquery-latest.min.js


+ 0 - 9
std/js/jquery/Helper.hx

@@ -13,13 +13,4 @@ package js.jquery;
 		return new js.jquery.JQuery(js.Lib.nativeThis);
 	}
 	#end
-
-	@:allow(js.jquery.JQuery)
-	macro static function embed() {
-		return if (haxe.macro.Context.defined("embed_js")) {
-			macro haxe.macro.Compiler.includeFile("js/jquery/jquery-1.12.1.min.js");
-		} else {
-			macro {};
-		}
-	}
 }

+ 0 - 3
std/js/jquery/JQuery.hx

@@ -1041,7 +1041,4 @@ package js.jquery;
 	**/
 	@:runtime
 	inline public function elements():js.jquery.JqEltsIterator return new js.jquery.JqEltsIterator(this);
-	static function __init__():Void {
-		js.jquery.Helper.embed();
-	}
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 1
std/js/jquery/jquery-1.12.1.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 7
std/js/swfobject-1.5.js


+ 0 - 6
std/js/swfobject/SWFObject.hx

@@ -125,10 +125,4 @@ extern class SWFObject {
 		swfobject version
 	*/
 	static var version:String;
-
-	private static function __init__():Void {
-		#if embed_js
-		haxe.macro.Compiler.includeFile("js/swfobject/swfobject.js");
-		#end
-	}
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 3
std/js/swfobject/swfobject.js


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels