Skip to content

Commit 7032370

Browse files
Merge #1821
1821: [Playground] Replace Parcel by Vite r=flevi29 a=Strift # Pull Request ## Related issue Fixes #1820 ## What does this PR do? - Update the playground to use a modern bundler, Vite (which is also in line with upcoming changes in #1740) ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Strift <[email protected]>
2 parents 35f9767 + 0b622da commit 7032370

File tree

6 files changed

+378
-5388
lines changed

6 files changed

+378
-5388
lines changed

playgrounds/javascript/.gitignore

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
110
node_modules
2-
.DS_Store
311
dist
412
dist-ssr
5-
*.local
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

playgrounds/javascript/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# Javascript Playground
1+
# Meilisearch JavaScript playground
22

3-
## Project setup
4-
```
5-
yarn install
6-
```
3+
This is an example vanilla JavaScript project using [Vite](https://vite.dev) and the [Yarn](https://classic.yarnpkg.com/en/docs/install) package manager.
74

8-
### Compiles and hot-reloads for development
9-
```
10-
yarn start
11-
```
5+
## Development
126

13-
### Compiles and minifies for production
7+
Install the dependencies:
8+
9+
```bash
10+
yarn
1411
```
15-
yarn build
12+
13+
Run the app in development:
14+
15+
```bash
16+
yarn dev
1617
```

playgrounds/javascript/index.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
8+
/>
9+
<meta name="theme-color" content="#000000" />
10+
<title>Meilisearch + Vite</title>
11+
</head>
12+
<body>
13+
<h1>Meilisearch + Vite</h1>
14+
<h2 class="errors_title">Errors:</h2>
15+
<div class="errors"></div>
316

4-
<head>
5-
<meta charset="utf-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7-
<meta name="theme-color" content="#000000" />
8-
</head>
9-
10-
<body>
11-
12-
13-
<h2 class="errors_title">Errors:</h2>
14-
<div class="errors"></div>
15-
16-
<h2>Movies index:</h2>
17-
<div class="indexes"></div>
18-
<h2>Search response:</h2>
19-
<div class="hits"></div>
20-
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4"></script>
21-
<script src="/src/app.js"></script>
22-
</body>
23-
17+
<h2>Movies index:</h2>
18+
<div class="indexes"></div>
19+
<h2>Search response:</h2>
20+
<div class="hits"></div>
21+
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4"></script>
22+
<script type="module" src="/src/app.js"></script>
23+
</body>
2424
</html>
Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
{
2-
"name": "js-playground",
3-
"version": "0.1.0",
4-
"description": "Instant-meilisearch playground written with vanilla javascript",
5-
"main": "index.js",
2+
"name": "meilisearch-js-playground",
3+
"version": "0.2.0",
4+
"description": "Meilisearch playground written with Vite",
5+
"type": "module",
66
"scripts": {
7-
"start": "parcel serve index.html --open --port 2222",
8-
"build": "parcel build index.html"
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
910
},
1011
"devDependencies": {
11-
"@babel/core": "^7.13.1",
12-
"parcel-bundler": "^1.12.4"
13-
},
14-
"resolutions": {
15-
"node-forge": "^0.10.0"
16-
},
17-
"browserslist": [
18-
"last 3 and_chr versions",
19-
"last 3 chrome versions",
20-
"last 3 opera versions",
21-
"last 3 ios_saf versions",
22-
"last 3 safari versions"
23-
],
24-
"license": "MIT",
25-
"dependencies": {}
12+
"vite": "^6.0.5"
13+
}
2614
}

playgrounds/javascript/src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { MeiliSearch } from "../../../src";
1+
import { Meilisearch } from "../../../src";
22

33
const config = {
44
host: "http://127.0.0.1:7700",
55
apiKey: "masterKey",
66
};
77

8-
const client = new MeiliSearch(config);
8+
const client = new Meilisearch(config);
99
const indexUid = "movies";
1010

1111
const addDataset = async () => {

0 commit comments

Comments
 (0)