Skip to content

Commit fce310f

Browse files
author
Aymeric Giraudet
committed
Revert "feat(chat): include in UMD build (#6793)"
This reverts commit 0ab30cd.
1 parent fe55cfe commit fce310f

7 files changed

Lines changed: 11 additions & 152 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
"rollup-plugin-node-resolve": "5.2.0",
137137
"rollup-plugin-replace": "2.2.0",
138138
"rollup-plugin-uglify": "6.0.4",
139-
"rollup-plugin-alias": "2.2.0",
140139
"shelljs": "0.8.5",
141140
"shipjs": "0.26.0",
142141
"ts-jest": "27",

packages/instantsearch.js/.storybook/decorators/withHits.ts

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,24 @@ import {
44
liteClient as namedConstructor,
55
default as defaultConstructor,
66
} from 'algoliasearch/lite';
7-
import instantsearch from '../../src/index.es';
7+
import instantsearch from '../../src';
88
import defaultPlayground from '../playgrounds/default';
99
import {
1010
InstantSearch,
1111
InstantSearchOptions,
1212
SearchClient,
1313
} from '../../src/types';
14-
import * as widgets from '../../src/widgets/index.umd';
15-
import * as connectors from '../../src/connectors/index.umd';
16-
import { createInsightsMiddleware } from '../../src/middlewares';
17-
import { reverseSnippet } from '../../src/helpers';
1814

1915
const algoliasearch = (namedConstructor || defaultConstructor) as unknown as (
2016
appId: string,
2117
apiKey: string
2218
) => SearchClient;
2319

20+
type InstantSearchUMDModule = typeof instantsearch;
21+
2422
export type Playground = (options: {
2523
search: InstantSearch;
26-
instantsearch: {
27-
widgets: typeof widgets;
28-
middlewares: { createInsightsMiddleware: typeof createInsightsMiddleware };
29-
};
24+
instantsearch: InstantSearchUMDModule;
3025
leftPanel: HTMLDivElement;
3126
rightPanel: HTMLDivElement;
3227
}) => void;
@@ -51,11 +46,7 @@ export const withHits =
5146
search,
5247
}: {
5348
container: HTMLElement;
54-
instantsearch: {
55-
widgets: typeof widgets;
56-
connectors: typeof connectors;
57-
reverseSnippet: typeof reverseSnippet;
58-
};
49+
instantsearch: InstantSearchUMDModule;
5950
search: InstantSearch;
6051
}) => void,
6152
searchOptions?: SearchOptions
@@ -90,7 +81,7 @@ export const withHits =
9081
});
9182

9283
search.addWidgets([
93-
widgets.configure({
84+
instantsearch.widgets.configure({
9485
hitsPerPage: 4,
9586
attributesToSnippet: ['description:15'],
9687
snippetEllipsisText: '[…]',
@@ -119,18 +110,14 @@ export const withHits =
119110

120111
playground({
121112
search,
122-
instantsearch: { widgets, middlewares: { createInsightsMiddleware } },
113+
instantsearch,
123114
leftPanel: leftPanelPlaygroundElement,
124115
rightPanel: rightPanelPlaygroundElement,
125116
});
126117

127118
storyFn({
128119
container: previewElement,
129-
instantsearch: {
130-
widgets,
131-
connectors,
132-
reverseSnippet,
133-
},
120+
instantsearch,
134121
search,
135122
});
136123

packages/instantsearch.js/scripts/rollup/emptyModule.js

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

packages/instantsearch.js/scripts/rollup/rollup.config.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import path from 'path';
2-
3-
import alias from 'rollup-plugin-alias';
41
import babel from 'rollup-plugin-babel';
52
import commonjs from 'rollup-plugin-commonjs';
63
import filesize from 'rollup-plugin-filesize';
@@ -19,25 +16,6 @@ const link = 'https://github.com/algolia/instantsearch';
1916
const license = `/*! InstantSearch.js ${version} | ${algolia} | ${link} */`;
2017

2118
const plugins = [
22-
alias({
23-
entries: [
24-
{
25-
find: /^zod.*/,
26-
replacement: path.join(__dirname, './emptyModule.js'),
27-
},
28-
{
29-
find: /^react.*/,
30-
replacement: path.join(__dirname, './emptyModule.js'),
31-
},
32-
{
33-
find: 'eventsource-parser/stream',
34-
replacement: path.join(
35-
__dirname,
36-
'../../../../node_modules/eventsource-parser/dist/stream.js'
37-
),
38-
},
39-
],
40-
}),
4119
resolve({
4220
browser: true,
4321
preferBuiltins: false,

packages/instantsearch.js/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as connectors from './connectors/index';
1+
import * as connectors from './connectors/index.umd';
22
import * as helpers from './helpers/index';
33
import { createInfiniteHitsSessionStorageCache } from './lib/infiniteHitsCache/index';
44
import InstantSearch from './lib/InstantSearch';
@@ -7,7 +7,7 @@ import * as stateMappings from './lib/stateMappings/index';
77
import version from './lib/version';
88
import * as middlewares from './middlewares/index';
99
import * as templates from './templates/index';
10-
import * as widgets from './widgets/index';
10+
import * as widgets from './widgets/index.umd';
1111

1212
import type { InstantSearchOptions } from './lib/InstantSearch';
1313
import type { Expand, UiState } from './types';

tests/umd.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('UMD bundle', () => {
1414
name: 'instantsearch.js',
1515
bundle: 'dist/instantsearch.production.min.js',
1616
globalName: 'instantsearch',
17+
unavailable: ['connectors.connectChat', 'widgets.chat'],
1718
},
1819
{
1920
name: 'react-instantsearch-core',
@@ -123,8 +124,6 @@ async function createEnvironment(
123124
resources: 'usable',
124125
});
125126

126-
window.TransformStream = TransformStream;
127-
128127
const error = jest.fn();
129128
window.addEventListener('error', error);
130129

yarn.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28343,13 +28343,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
2834328343
hash-base "^2.0.0"
2834428344
inherits "^2.0.1"
2834528345

28346-
rollup-plugin-alias@2.2.0:
28347-
version "2.2.0"
28348-
resolved "https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-2.2.0.tgz#5004a2bc542a2eebb45b5a0fff8c6f540439decc"
28349-
integrity sha512-9ZK410qeFed4gGrHoojBpxLsHF74vPgsheGg9JRW5RbALAxqdvJbd357mSqWBqUrBfRVnZnNUXTZdYLxxQEA5A==
28350-
dependencies:
28351-
slash "^3.0.0"
28352-
2835328346
rollup-plugin-babel@4.3.3:
2835428347
version "4.3.3"
2835528348
resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz#7eb5ac16d9b5831c3fd5d97e8df77ba25c72a2aa"

0 commit comments

Comments
 (0)