chore: disable dart for HTTP package
BREAKING CHANGE Stop supporting http module in Dart. This is because Dart has a well developed http package which should be used by Dart customers instead.
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
library http.sfx;
|
||||
|
||||
// empty as we don't have a version for Dart
|
@ -1,3 +0,0 @@
|
||||
library http.index;
|
||||
|
||||
//no dart implementation
|
@ -1,19 +0,0 @@
|
||||
name: http
|
||||
version: <%= packageJson.version %>
|
||||
authors:
|
||||
<%= Object.keys(packageJson.contributors).map(function(name) {
|
||||
return '- '+name+' <'+packageJson.contributors[name]+'>';
|
||||
}).join('\n') %>
|
||||
description: Angular 2 Http Module
|
||||
homepage: <%= packageJson.homepage %>
|
||||
environment:
|
||||
sdk: '>=1.10.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: '^<%= packageJson.version %>'
|
||||
dev_dependencies:
|
||||
guinness: '^0.1.17'
|
||||
dependency_overrides:
|
||||
angular2:
|
||||
path: ../angular2
|
||||
transformers:
|
||||
- angular2
|
@ -1,62 +0,0 @@
|
||||
library angular2_http.src.backends.browser_jsonp;
|
||||
|
||||
import 'package:angular2/di.dart';
|
||||
import 'dart:html' show document;
|
||||
import 'dart:js' show context, JsObject, JsArray;
|
||||
|
||||
int _nextRequestId = 0;
|
||||
const JSONP_HOME = '__ng_jsonp__';
|
||||
|
||||
var _jsonpConnections = null;
|
||||
|
||||
JsObject _getJsonpConnections() {
|
||||
if (_jsonpConnections == null) {
|
||||
_jsonpConnections = context[JSONP_HOME] = new JsObject(context['Object']);
|
||||
}
|
||||
return _jsonpConnections;
|
||||
}
|
||||
|
||||
// Make sure not to evaluate this in a non-browser environment!
|
||||
@Injectable()
|
||||
class BrowserJsonp {
|
||||
// Construct a <script> element with the specified URL
|
||||
dynamic build(String url) {
|
||||
var node = document.createElement('script');
|
||||
node.src = url;
|
||||
return node;
|
||||
}
|
||||
|
||||
nextRequestID() {
|
||||
return "__req${_nextRequestId++}";
|
||||
}
|
||||
|
||||
requestCallback(String id) {
|
||||
return """${JSONP_HOME}.${id}.finished""";
|
||||
}
|
||||
|
||||
exposeConnection(String id, dynamic connection) {
|
||||
var connections = _getJsonpConnections();
|
||||
var wrapper = new JsObject(context['Object']);
|
||||
|
||||
wrapper['_id'] = id;
|
||||
wrapper['__dart__'] = connection;
|
||||
wrapper['finished'] = ([dynamic data]) => connection.finished(data);
|
||||
|
||||
connections[id] = wrapper;
|
||||
}
|
||||
|
||||
removeConnection(String id) {
|
||||
var connections = _getJsonpConnections();
|
||||
connections[id] = null;
|
||||
}
|
||||
|
||||
// Attach the <script> element to the DOM
|
||||
send(dynamic node) {
|
||||
document.body.append(node);
|
||||
}
|
||||
|
||||
// Remove <script> element from the DOM
|
||||
cleanup(dynamic node) {
|
||||
node.remove();
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
library angular2_http.src.backends.browser_xhr;
|
||||
|
||||
import 'dart:html' show HttpRequest;
|
||||
import 'package:angular2/di.dart';
|
||||
|
||||
@Injectable()
|
||||
class BrowserXhr {
|
||||
HttpRequest build() {
|
||||
return new HttpRequest();
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
library angular2_http.src.http_utils;
|
||||
|
||||
import 'dart:js' show JsObject;
|
||||
import 'dart:collection' show LinkedHashMap, LinkedHashSet;
|
||||
|
||||
bool isJsObject(o) {
|
||||
return o is JsObject || o is LinkedHashMap || o is LinkedHashSet;
|
||||
}
|
Reference in New Issue
Block a user