-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1062: Make umd build compatible in a node environment r=bidoubiwa a=bidoubiwa the `umd` build of this package was missing the polyfill of `fetch`. Resulting in the following being thrown ``` XMLHttpRequest is not defined ``` As the package tries to use the browser `fetch` API. Fixes: #1061 Co-authored-by: Charlotte Vermandel <charlottevermandel@gmail.com>
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@meilisearch/instant-meilisearch": minor | ||
--- | ||
|
||
Makes the umd build work in a nodeJs environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { instantMeiliSearch } = require('@meilisearch/instant-meilisearch') | ||
const { MeiliSearch } = require('meilisearch') | ||
|
||
|
||
const client = instantMeiliSearch('http://localhost:7700', 'masterKey', {}) | ||
const msClient = new MeiliSearch({ host: 'http://localhost:7700', apiKey: 'masterKey'}) | ||
|
||
;(async() => { | ||
try { | ||
const task1 = await msClient.index('node_test').addDocuments([]) | ||
await msClient.waitForTask(task1.taskUid) | ||
await client.search([ | ||
{ | ||
indexName: 'node_test', | ||
params: { | ||
query: '', | ||
}, | ||
} | ||
]) | ||
|
||
const task2 = await msClient.index('node_test').delete() | ||
await msClient.waitForTask(task2.taskUid) | ||
process.exit(0) | ||
} catch(e) { | ||
console.error('Could not run the `umd` build in a node environment') | ||
process.exit(1) | ||
} | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@meilisearch/node-playground", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "Instant-meilisearch playground written in node", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "node index.js" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-meilisearch": "*" | ||
}, | ||
"browserslist": [ | ||
"defaults" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"@meilisearch/instant-meilisearch": "*" | ||
} | ||
} |