Skip to content

Commit ce9e74c

Browse files
committed
Merge branch 'main' into feat/timeouts-per-specs
2 parents 61bca9d + f780851 commit ce9e74c

File tree

64 files changed

+1114
-4720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1114
-4720
lines changed

.github/workflows/check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ jobs:
224224
- name: Build the playground
225225
run: yarn cli build playground javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
226226

227+
- name: Build the browser playground
228+
run: yarn workspace javascript-playground-browser build
229+
227230
- name: Run common and requester tests
228231
run: cd clients/algoliasearch-client-javascript && yarn test ${{ !contains(fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun, 'algoliasearch') && '--ignore algoliasearch' || '' }}
229232

docs/guides/csharp/src/pushSetup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PushSetup
1010
{
1111
public static async Task Main(string[] args)
1212
{
13-
string jsonContent = File.ReadAllText("/my-raw-records.json");
13+
string jsonContent = File.ReadAllText("records.json");
1414

1515
var records = JsonSerializer.Deserialize<List<PushTaskRecords>>(jsonContent);
1616

docs/guides/go/src/pushSetup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func push() {
1616
panic(err)
1717
}
1818

19-
content, err := os.ReadFile("/my-raw-records.json")
19+
content, err := os.ReadFile("records.json")
2020
if err != nil {
2121
panic(err)
2222
}

docs/guides/java/src/test/java/com/algolia/pushSetup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
public class pushSetup {
99

1010
public static void main(String[] args) throws Exception {
11-
JsonNode content = new ObjectMapper().readTree(new File("/my-raw-records.json"));
11+
JsonNode content = new ObjectMapper().readTree(new File("records.json"));
1212
List<PushTaskRecords> records = new ObjectMapper().readerForListOf(Map.class).readValue(content);
1313

1414
// use the region matching your applicationID

docs/guides/javascript/src/pushSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initIn
88

99
try {
1010
// read local JSON file containing array of records
11-
const records = JSON.parse(fs.readFileSync('/my-raw-records.json', 'utf8')) as PushTaskRecords[];
11+
const records = JSON.parse(fs.readFileSync('records.json', 'utf8')) as PushTaskRecords[];
1212

1313
// push records to the API
1414
const run = await client.pushTask({

docs/guides/kotlin/src/main/kotlin/com/algolia/snippets/pushSetup.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import kotlinx.serialization.json.Json
88
import java.io.File
99

1010
suspend fun main() {
11-
val json = File("/my-raw-records.json").readText()
11+
val json = File("records.json").readText()
1212
val records: List<PushTaskRecords> = Json.decodeFromString(ListSerializer(PushTaskRecords.serializer()), json)
1313

1414
// use the region matching your applicationID

docs/guides/php/src/pushSetup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require __DIR__.'/vendor/autoload.php';
44
use Algolia\AlgoliaSearch\Api\IngestionClient;
55

6-
$records = json_decode(file_get_contents('/my-raw-records.json'), true);
6+
$records = json_decode(file_get_contents('records.json'), true);
77

88
// use the region matching your applicationID
99
$client = IngestionClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');

docs/guides/python/pushSetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async def main():
99
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
1010
)
1111

12-
with open("/my-raw-records.json") as f:
12+
with open("records.json") as f:
1313
records = json.load(f)
1414

1515
run = _client.push_task(

docs/guides/ruby/pushSetup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "json"
22
require "algolia"
33

4-
records = JSON.parse(File.read("/my-raw-records.json"))
4+
records = JSON.parse(File.read("records.json"))
55

66
# use the region matching your applicationID
77
client = Algolia::IngestionClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")

docs/guides/scala/src/main/scala/pushSetup.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object PushSetup {
1515
implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global
1616
implicit val formats: org.json4s.Formats = org.json4s.DefaultFormats
1717

18-
val result = Source.fromFile("/my-raw-records.json").getLines().mkString
18+
val result = Source.fromFile("records.json").getLines().mkString
1919
val records = JsonMethods.parse(result).extract[Seq[algoliasearch.ingestion.PushTaskRecords]]
2020

2121
// use the region matching your applicationID

docs/guides/swift/Sources/pushSetup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Ingestion
99
func pushSetup() async throws {
1010
do {
1111
let path = URL(string: #file)!.deletingLastPathComponent()
12-
.appendingPathComponent("/my-raw-records.json")
12+
.appendingPathComponent("records.json")
1313
let data = try Data(contentsOf: URL(fileURLWithPath: path.absoluteString))
1414
let records = try JSONDecoder().decode([PushTaskRecords].self, from: data)
1515

playground/javascript/browser/.yarn/releases/yarn-4.5.3.cjs

Lines changed: 0 additions & 934 deletions
This file was deleted.

playground/javascript/browser/.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

playground/javascript/browser/app.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

playground/javascript/browser/app.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)
-1.1 KB
Binary file not shown.
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
<!doctype html>
22
<html lang="en">
33
<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-
10-
<link rel="shortcut icon" href="favicon.png" />
11-
12-
<title>React InstantSearch — Getting started</title>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
138
</head>
14-
159
<body>
16-
<noscript> You need to enable JavaScript to run this app. </noscript>
17-
1810
<div id="root"></div>
19-
20-
<script type="module" src="src/index.tsx"></script>
11+
<script type="module" src="/src/main.tsx"></script>
2112
</body>
2213
</html>
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
{
2-
"name": "javascript-browser-playground",
3-
"version": "0.0.0",
2+
"name": "javascript-playground-browser",
43
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
56
"scripts": {
6-
"build": "yarn clean && BABEL_ENV=parcel parcel build index.html products.html",
7-
"clean": "rm -rf .parcel-cache node_modules dist || true && yarn",
8-
"start": "yarn clean && BABEL_ENV=parcel parcel index.html products.html --port 3001"
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
911
},
1012
"dependencies": {
1113
"algoliasearch": "link:../../../clients/algoliasearch-client-javascript/packages/algoliasearch",
12-
"instantsearch.css": "8.5.1",
13-
"instantsearch.js": "4.75.5",
14-
"react": "18.3.1",
15-
"react-dom": "18.3.1",
16-
"react-instantsearch": "7.13.8"
14+
"instantsearch.css": "^8.5.1",
15+
"react": "^18.3.1",
16+
"react-dom": "^18.3.1",
17+
"react-instantsearch": "^7.13.8"
1718
},
1819
"devDependencies": {
19-
"@parcel/core": "2.13.2",
20-
"@parcel/packager-raw-url": "2.13.2",
21-
"@parcel/transformer-webmanifest": "2.13.2",
22-
"@types/react": "^18.0.9",
23-
"https-browserify": "^1.0.0",
24-
"parcel": "2.13.2",
25-
"stream-http": "^3.1.0",
20+
"@eslint/js": "9.15.0",
21+
"@types/react": "18.3.12",
22+
"@types/react-dom": "18.3.1",
23+
"@vitejs/plugin-react-swc": "3.5.0",
24+
"eslint": "9.15.0",
25+
"eslint-plugin-react-hooks": "5.0.0",
26+
"eslint-plugin-react-refresh": "0.4.14",
27+
"globals": "15.12.0",
2628
"typescript": "5.7.2",
27-
"url": "^0.11.0"
28-
},
29-
"@parcel/resolver-default": {
30-
"packageExports": true
29+
"typescript-eslint": "8.15.0",
30+
"vite": "6.0.1"
3131
},
3232
"packageManager": "[email protected]"
3333
}

playground/javascript/browser/products.html

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
:root {
2+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3+
line-height: 1.5;
4+
font-weight: 400;
5+
6+
color-scheme: light dark;
7+
color: rgba(255, 255, 255, 0.87);
8+
background-color: #242424;
9+
10+
font-synthesis: none;
11+
text-rendering: optimizeLegibility;
12+
-webkit-font-smoothing: antialiased;
13+
-moz-osx-font-smoothing: grayscale;
14+
}
15+
16+
a {
17+
font-weight: 500;
18+
color: #646cff;
19+
text-decoration: inherit;
20+
}
21+
a:hover {
22+
color: #535bf2;
23+
}
24+
25+
body {
26+
margin: 0;
27+
display: flex;
28+
place-items: center;
29+
min-width: 320px;
30+
min-height: 100vh;
31+
}
32+
33+
h1 {
34+
font-size: 3.2em;
35+
line-height: 1.1;
36+
}
37+
38+
button {
39+
border-radius: 8px;
40+
border: 1px solid transparent;
41+
padding: 0.6em 1.2em;
42+
font-size: 1em;
43+
font-weight: 500;
44+
font-family: inherit;
45+
background-color: #1a1a1a;
46+
cursor: pointer;
47+
transition: border-color 0.25s;
48+
}
49+
button:hover {
50+
border-color: #646cff;
51+
}
52+
button:focus,
53+
button:focus-visible {
54+
outline: 4px auto -webkit-focus-ring-color;
55+
}
56+
57+
@media (prefers-color-scheme: light) {
58+
:root {
59+
color: #213547;
60+
background-color: #ffffff;
61+
}
62+
a:hover {
63+
color: #747bff;
64+
}
65+
button {
66+
background-color: #f9f9f9;
67+
}
68+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { StrictMode } from 'react'
2+
import { createRoot } from 'react-dom/client'
3+
import './index.css'
4+
import {App} from './App.tsx'
5+
6+
createRoot(document.getElementById('root')!).render(
7+
<StrictMode>
8+
<App />
9+
</StrictMode>,
10+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

0 commit comments

Comments
 (0)