aboutsummaryrefslogtreecommitdiff
path: root/node_modules/algoliasearch/src/browser/migration-layer/old-globals.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/algoliasearch/src/browser/migration-layer/old-globals.js')
-rw-r--r--node_modules/algoliasearch/src/browser/migration-layer/old-globals.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/algoliasearch/src/browser/migration-layer/old-globals.js b/node_modules/algoliasearch/src/browser/migration-layer/old-globals.js
new file mode 100644
index 00000000..1f40c0d2
--- /dev/null
+++ b/node_modules/algoliasearch/src/browser/migration-layer/old-globals.js
@@ -0,0 +1,26 @@
+'use strict';
+
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+module.exports = oldGlobals;
+
+// put old window.AlgoliaSearch.. into window. again so that
+// users upgrading to V3 without changing their code, will be warned
+function oldGlobals() {
+ var message = '-- AlgoliaSearch V2 => V3 error --\n' +
+ 'You are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\n' +
+ 'Please read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n' +
+ '-- /AlgoliaSearch V2 => V3 error --';
+
+ window.AlgoliaSearch = function() {
+ throw new Error(message);
+ };
+
+ window.AlgoliaSearchHelper = function() {
+ throw new Error(message);
+ };
+
+ window.AlgoliaExplainResults = function() {
+ throw new Error(message);
+ };
+}