Skip to content

Commit

Permalink
remove older unused packages and resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Dec 29, 2024
1 parent db2914c commit 3fb801c
Show file tree
Hide file tree
Showing 86 changed files with 737 additions and 809 deletions.
3 changes: 1 addition & 2 deletions babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ module.exports = function(api) {

const plugins = compact([
(!isProd && !isTest) && 'react-refresh/babel',
!isProd && '@babel/plugin-transform-class-properties',
]);

return { presets, plugins };
return {presets, plugins};
};
6 changes: 3 additions & 3 deletions cypress/e2e/big_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ it('Big list basic example', () => {
cy.contains('button', 'Increase!').click();

expect(console.group).to.be.calledWithMatches([
{ match: 'BigList', times: 1 },
{ match: /props.*style\W/, times: 1 },
{match: 'BigList', times: 1},
{match: /props.*style\W/, times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because of props changes'], times: 1 },
{match: [() => true, 'Re-rendered because of props changes'], times: 1},
]);
});
});
6 changes: 3 additions & 3 deletions cypress/e2e/child-of-pure-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ it('Child of Pure Component', () => {
cy.contains('button', 'clicks:').should('contain', '2');

expect(console.group).to.be.calledWithMatches([
{ match: 'PureFather', times: 2 },
{ match: /props.*children\W/, times: 2 },
{match: 'PureFather', times: 2},
{match: /props.*children\W/, times: 2},
]);

expect(console.log).to.be.calledWithMatches([
{ match: 'syntax always produces a *NEW* immutable React element', times: 2 },
{match: 'syntax always produces a *NEW* immutable React element', times: 2},
]);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/clone-element.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
it('Creating react element using React.cloneElement', () => {
cy.visitAndSpyConsole('/#cloneElement', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'TestComponent', times: 1 },
{match: 'TestComponent', times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1},
]);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/create-factory.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
it('Creating react element using React.createFactory', () => {
cy.visitAndSpyConsole('/#createFactory', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'TestComponent', times: 1 },
{match: 'TestComponent', times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1},
]);
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/hooks-use-context.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
it('Hooks - useContext', () => {
cy.visitAndSpyConsole('/#useContext', console => {
expect(console.group).to.be.calledWithMatches([
{ match: /ComponentWithContextHook$/, times: 2 },
{ match: 'Rendered by Main', times: 1 },
{ match: 'ComponentWithContextHookInsideMemoizedParent', times: 1 },
{ match: '[hook useState result]', times: 1 },
{ match: '[hook useContext result]', times: 2 },
{match: /ComponentWithContextHook$/, times: 2},
{match: 'Rendered by Main', times: 1},
{match: 'ComponentWithContextHookInsideMemoizedParent', times: 1},
{match: '[hook useState result]', times: 1},
{match: '[hook useContext result]', times: 2},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1 },
{ match: [() => true, 'Re-rendered because of hook changes'], times: 3 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1},
{match: [() => true, 'Re-rendered because of hook changes'], times: 3},
]);
});
});
8 changes: 4 additions & 4 deletions cypress/e2e/hooks-use-memo-and-callback-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ it('Hooks - useMemo and useCallback Child', () => {
cy.contains('button', 'count: 0').click();

expect(console.group).to.be.calledWithMatches([
{ match: 'Comp', times: 2 },
{ match: /useMemoFn/, times: 2 },
{ match: /useCallbackFn/, times: 2 },
{ match: /props.*\..*count/, times: 1 },
{match: 'Comp', times: 2},
{match: /useMemoFn/, times: 2},
{match: /useCallbackFn/, times: 2},
{match: /props.*\..*count/, times: 1},
]);
});
});
6 changes: 3 additions & 3 deletions cypress/e2e/hooks-use-reducer.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
it('Hooks - useReducer', () => {
const checkConsole = (console, times) => {
expect(console.group).to.be.calledWithMatches([
{ match: 'Main', times },
{ match: '[hook useReducer result]', times },
{match: 'Main', times},
{match: '[hook useReducer result]', times},
]);

expect(console.log).to.be.calledWithMatches([
{ match: 'different objects that are equal by value.', times },
{match: 'different objects that are equal by value.', times},
]);
};

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/hooks-use-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ it('Hooks - useState', () => {
});

expect(console.group).to.be.calledWithMatches([
{ match: 'BrokenHooksPureComponent', times: 2 },
{ match: '[hook useState result]', times: 2 },
{match: 'BrokenHooksPureComponent', times: 2},
{match: '[hook useState result]', times: 2},
]);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/hot-reload.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
it('React Hot Reload Of Tracked Component', () => {
cy.visitAndSpyConsole('/#hotReload', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'HotExportedDemoComponent', times: 1 },
{match: 'HotExportedDemoComponent', times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1},
]);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/no-change.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
it('No Changes', () => {
cy.visitAndSpyConsole('/#noChanges', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ClassDemo', times: 1 },
{match: 'ClassDemo', times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered although props and state objects are the same.'], times: 1 },
{match: [() => true, 'Re-rendered although props and state objects are the same.'], times: 1},
]);
});
});
22 changes: 11 additions & 11 deletions cypress/e2e/owner-reasons.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
it('Log Owner Reasons', () => {
cy.visitAndSpyConsole('/#logOwnerReasons', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'Child', times: 3 },
{ match: 'Rendered by Owner', times: 1 },
{ match: 'Rendered by ClassOwner', times: 1 },
{ match: 'Rendered by HooksOwner', times: 1 },
{ match: /props.*a\W/, times: 1 },
{ match: '[hook useState result]', times: 2 },
{match: 'Child', times: 3},
{match: 'Rendered by Owner', times: 1},
{match: 'Rendered by ClassOwner', times: 1},
{match: 'Rendered by HooksOwner', times: 1},
{match: /props.*a\W/, times: 1},
{match: '[hook useState result]', times: 2},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal'], times: 3 },
{ match: [() => true, 'Re-rendered because of props changes'], times: 1 },
{ match: [() => true, 'Re-rendered because of state changes'], times: 1 },
{ match: [() => true, 'Re-rendered because of hook changes'], times: 2 },
{ match: 'different objects.', times: 4 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal'], times: 3},
{match: [() => true, 'Re-rendered because of props changes'], times: 1},
{match: [() => true, 'Re-rendered because of state changes'], times: 1},
{match: [() => true, 'Re-rendered because of hook changes'], times: 2},
{match: 'different objects.', times: 4},
]);
});
});
8 changes: 4 additions & 4 deletions cypress/e2e/props-and-state-change.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
it('Props And State Changes', () => {
cy.visitAndSpyConsole('/#bothChanges', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ClassDemo', times: 1 },
{ match: /props.*a\W/, times: 1 },
{ match: /state.*c\W/, times: 1 },
{match: 'ClassDemo', times: 1},
{match: /props.*a\W/, times: 1},
{match: /state.*c\W/, times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: 'different objects that are equal by value.', times: 2 },
{match: 'different objects that are equal by value.', times: 2},
]);
});
});
8 changes: 4 additions & 4 deletions cypress/e2e/props-changes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
it('props changes', () => {
cy.visitAndSpyConsole('/#propsChanges', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ClassDemo', times: 5 },
{ match: 'Rendered by Main', times: 5 },
{ match: /props.*a\W/, times: 4 },
{ match: /props.*containerProps\W/, times: 4 },
{match: 'ClassDemo', times: 5},
{match: 'Rendered by Main', times: 5},
{match: /props.*a\W/, times: 4},
{match: /props.*containerProps\W/, times: 4},
]);
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/react-redux.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ describe('react-redux', () => {
it('React Redux', () => {
const checkConsole = (console, times) => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ConnectedSimpleComponent', times },
{ match: '[hook useSelector result]', times },
{match: 'ConnectedSimpleComponent', times},
{match: '[hook useSelector result]', times},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because of hook changes'], times },
{match: [() => true, 'Re-rendered because of hook changes'], times},
]);
};

Expand All @@ -33,13 +33,13 @@ describe('react-redux', () => {
it('React Redux HOC', () => {
const checkConsole = (console, times) => {
expect(console.group).to.be.calledWithMatches([
{ match: 'SimpleComponent', times: times * 2 },
{ match: /props.*a\W/, times },
{match: 'SimpleComponent', times: times * 2},
{match: /props.*a\W/, times},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because of props changes'], times },
{ match: 'different objects that are equal by value', times },
{match: [() => true, 'Re-rendered because of props changes'], times},
{match: 'different objects that are equal by value', times},
]);
};

Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/special-changes.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
it('Special Changes', () => {
cy.visitAndSpyConsole('/#specialChanges', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ClassDemo', times: 1 },
{match: 'ClassDemo', times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: 'different regular expressions with the same value.', times: 1 },
{ match: 'different functions with the same name.', times: 1 },
{ match: 'different date objects with the same value.', times: 1 },
{ match: 'different React elements (remember that the <jsx/> syntax always produces a *NEW* immutable React element', times: 1 },
{match: 'different regular expressions with the same value.', times: 1},
{match: 'different functions with the same name.', times: 1},
{match: 'different date objects with the same value.', times: 1},
{match: 'different React elements (remember that the <jsx/> syntax always produces a *NEW* immutable React element', times: 1},
]);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ it('Server Side (hydrate)', () => {
cy.contains('hydrated hi');

expect(console.group).to.be.calledWithMatches([
{ match: 'DemoComponent', times: 1 },
{match: 'DemoComponent', times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 1},
]);
});
});
6 changes: 3 additions & 3 deletions cypress/e2e/state-changes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
it('state changes', () => {
cy.visitAndSpyConsole('/#stateChanges', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ClassDemo', times: 2 },
{ match: /state.*objectKey\W/, times: 1 },
{match: 'ClassDemo', times: 2},
{match: /state.*objectKey\W/, times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the state object itself changed but its values are all equal'], times: 1 },
{match: [() => true, 'Re-rendered because the state object itself changed but its values are all equal'], times: 1},
]);
});
});
10 changes: 5 additions & 5 deletions cypress/e2e/strict-mode.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
it('Strict mode', () => {
cy.visitAndSpyConsole('/#strict', console => {
expect(console.group).to.be.calledWithMatches([
{ match: 'ClassDemo', times: 3 },
{ match: 'Rendered by Main', times: 3 },
{ match: /props.*a\W/, times: 4 },
{match: 'ClassDemo', times: 3},
{match: 'Rendered by Main', times: 3},
{match: /props.*a\W/, times: 4},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 2 },
{ match: 'different objects that are equal by value', times: 4 },
{match: [() => true, 'Re-rendered because the props object itself changed but its values are all equal.'], times: 2},
{match: 'different objects that are equal by value', times: 4},
]);
});
});
8 changes: 4 additions & 4 deletions cypress/e2e/styled-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ it('styled-components', () => {
.should('have.css', 'background-color', 'rgb(255, 150, 174)');

expect(console.group).to.be.calledWithMatches([
{ match: 'Styled(SimpleComponent)', times: 1 },
{ match: /props.*a\W/, times: 1 },
{match: 'Styled(SimpleComponent)', times: 1},
{match: /props.*a\W/, times: 1},
]);

expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because of props changes'], times: 1 },
{ match: 'different objects that are equal by value', times: 1 },
{match: [() => true, 'Re-rendered because of props changes'], times: 1},
{match: 'different objects that are equal by value', times: 1},
]);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/test_console_assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ it('Test console testing throws on wrong console appearance amounts', () => {

expect(
() => expect(console.group).to.be.calledWithMatches([
{ match: 'BigList', times: 0 },
{match: 'BigList', times: 0},
])
).to.throw();

expect(
() => expect(console.log).to.be.calledWithMatches([
{ match: [() => true, 'Re-rendered because of props changes'], times: 0 },
{match: [() => true, 'Re-rendered because of props changes'], times: 0},
])
).to.throw();
});
Expand Down
6 changes: 3 additions & 3 deletions demo/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const app = express();

app.get('/ssrComponent', (req, res) => {
const stream = ReactDomServer.renderToNodeStream(
React.createElement(DemoComponent, { text: 'hydrated hi' })
React.createElement(DemoComponent, {text: 'hydrated hi'})
);
stream.pipe(res, { end: false });
stream.pipe(res, {end: false});
stream.on('end', () => res.end());
});

Expand All @@ -32,7 +32,7 @@ app.use(nollupDevServer(app, config, {

app.use(express.static('demo/public'));

app.use(fallback('index.html', { root: 'demo/public' }));
app.use(fallback('index.html', {root: 'demo/public'}));

server.listen(port, () => {
// eslint-disable-next-line no-console
Expand Down
Loading

0 comments on commit 3fb801c

Please sign in to comment.