Skip to content

Commit

Permalink
implement reactive and non-reactive management of tasks to perform th…
Browse files Browse the repository at this point in the history
…e stress test
  • Loading branch information
nachocodoner committed Jul 22, 2024
1 parent 6d0b968 commit 3c0ad07
Show file tree
Hide file tree
Showing 25 changed files with 3,479 additions and 6,419 deletions.
1 change: 0 additions & 1 deletion apps/tasks-2.x/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ [email protected] # Enable TypeScript syntax in .ts and .tsx modules
[email protected] # Server-side component of the `meteor shell` command
[email protected] # Update client in development without reloading the page


[email protected] # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
tasks-common
1 change: 1 addition & 0 deletions apps/tasks-2.x/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Expand Down
5 changes: 4 additions & 1 deletion apps/tasks-2.x/client/main.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Meteor } from 'meteor/meteor';
import { App } from '/imports/ui/App';
import { initializeTaskCollection, registerTaskApi, App } from 'meteor/tasks-common';

Meteor.startup(() => {
initializeTaskCollection();
registerTaskApi();

const container = document.getElementById('react-target');
const root = createRoot(container);
root.render(<App />);
Expand Down
3 changes: 0 additions & 3 deletions apps/tasks-2.x/imports/api/links.js

This file was deleted.

11 changes: 0 additions & 11 deletions apps/tasks-2.x/imports/ui/App.jsx

This file was deleted.

16 changes: 0 additions & 16 deletions apps/tasks-2.x/imports/ui/Hello.jsx

This file was deleted.

23 changes: 0 additions & 23 deletions apps/tasks-2.x/imports/ui/Info.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/tasks-2.x/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 4 additions & 34 deletions apps/tasks-2.x/server/main.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { LinksCollection } from '/imports/api/links';
import { initializeTaskCollection, registerTaskApi } from 'meteor/tasks-common';

async function insertLink({ title, url }) {
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });
}

Meteor.startup(async () => {
// If the Links collection is empty, add some data.
if (await LinksCollection.find().countAsync() === 0) {
await insertLink({
title: 'Do the Tutorial',
url: 'https://react-tutorial.meteor.com/simple-todos/01-creating-app.html',
});

await insertLink({
title: 'Follow the Guide',
url: 'https://guide.meteor.com',
});

await insertLink({
title: 'Read the Docs',
url: 'https://docs.meteor.com',
});

await insertLink({
title: 'Discussions',
url: 'https://forums.meteor.com',
});
}

// We publish the entire Links collection to all clients.
// In order to be fetched in real-time to the clients
Meteor.publish("links", function () {
return LinksCollection.find();
});
Meteor.startup(() => {
initializeTaskCollection();
registerTaskApi();
});
3 changes: 1 addition & 2 deletions apps/tasks-3.x/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ [email protected] # Enable TypeScript syntax in .ts and .tsx modules
[email protected] # Server-side component of the `meteor shell` command
[email protected] # Update client in development without reloading the page


[email protected] # Define static page content in .html files
[email protected]-beta300.1 # React higher-order component for reactively tracking Meteor data
[email protected] # React higher-order component for reactively tracking Meteor data
tasks-common
1 change: 1 addition & 0 deletions apps/tasks-3.x/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Expand Down
5 changes: 4 additions & 1 deletion apps/tasks-3.x/client/main.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Meteor } from 'meteor/meteor';
import { App } from '/imports/ui/App';
import { initializeTaskCollection, registerTaskApi, App } from 'meteor/tasks-common';

Meteor.startup(() => {
initializeTaskCollection();
registerTaskApi();

const container = document.getElementById('react-target');
const root = createRoot(container);
root.render(<App />);
Expand Down
3 changes: 0 additions & 3 deletions apps/tasks-3.x/imports/api/links.js

This file was deleted.

11 changes: 0 additions & 11 deletions apps/tasks-3.x/imports/ui/App.jsx

This file was deleted.

16 changes: 0 additions & 16 deletions apps/tasks-3.x/imports/ui/Hello.jsx

This file was deleted.

23 changes: 0 additions & 23 deletions apps/tasks-3.x/imports/ui/Info.jsx

This file was deleted.

38 changes: 4 additions & 34 deletions apps/tasks-3.x/server/main.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { LinksCollection } from '/imports/api/links';
import { initializeTaskCollection, registerTaskApi } from 'meteor/tasks-common';

async function insertLink({ title, url }) {
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });
}

Meteor.startup(async () => {
// If the Links collection is empty, add some data.
if (await LinksCollection.find().countAsync() === 0) {
await insertLink({
title: 'Do the Tutorial',
url: 'https://react-tutorial.meteor.com/simple-todos/01-creating-app.html',
});

await insertLink({
title: 'Follow the Guide',
url: 'https://guide.meteor.com',
});

await insertLink({
title: 'Read the Docs',
url: 'https://docs.meteor.com',
});

await insertLink({
title: 'Discussions',
url: 'https://forums.meteor.com',
});
}

// We publish the entire Links collection to all clients.
// In order to be fetched in real-time to the clients
Meteor.publish("links", function () {
return LinksCollection.find();
});
Meteor.startup(() => {
initializeTaskCollection();
registerTaskApi();
});
Loading

0 comments on commit 3c0ad07

Please sign in to comment.