Skip to content

[WIP] Update/meteor v3.0 #484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

bhunjadi
Copy link
Contributor

@bhunjadi bhunjadi commented Feb 19, 2024

I started working on Meteor 3.0 and managed to make some progress on the server-side. I started with links and also started adding types and use them in JS files which might help with this migration.

I managed to get the 4 tests in linker.tests.js working and will update progress here as I continue the work.

I'm replacing all calls to their *Async equivalents so I had to bump the minimal Meteor version to 2.8.1.

Tests todos:

  • Links
  • Exposures
  • Queries
  • Named queries
  • Reactive counts
  • GraphQL
  • Client tests

3rd party deps:

Other:

  • Update types
  • Setup lint
  • API changes docs

Compatibility with Meteor v2

  • getLink, add, set, etc functions in links should get Async suffix, client should stay the same

How to test

# v3
meteor create --release 3.0-beta.0 --bare test
cd test 
meteor npm i --save [email protected] [email protected] [email protected] chai

# then we also need to add packages that are not published yet
mkdir packages
cd packages

# mongo-collection-instances
git clone -b migration/3.0 https://github.com/Meteor-Community-Packages/mongo-collection-instances.git

# meteortesting:mocha
git clone -b migrate/3.0 https://github.com/Meteor-Community-Packages/meteor-mocha.git meteor-mocha-repo
# copy package into packages
cp -R ./meteor-mocha-repo/package ./meteor-mocha

Package.json in test (see scripts for convenience methods)

{
  "name": "test",
  "private": true,
  "scripts": {
    "start": "meteor run",
    "test": "MONGO_URL= METEOR_PACKAGE_DIRS=\"../:packages\" TEST_BROWSER_DRIVER=chrome meteor test-packages --driver-package meteortesting:mocha --once  --port 3010 ../",
    "test:server": "TEST_CLIENT=0 MONGO_URL= METEOR_PACKAGE_DIRS=\"../:packages\" TEST_BROWSER_DRIVER=chrome meteor test-packages --driver-package meteortesting:mocha --once  --port 3010 ../",
    "test:server:watch": "TEST_CLIENT=0 MONGO_URL= METEOR_PACKAGE_DIRS=\"../:packages\" TEST_BROWSER_DRIVER=chrome meteor test-packages --driver-package meteortesting:mocha  --port 3010 ../"
  },
  "dependencies": {
    "@babel/runtime": "^7.23.5",
    "chai": "^5.1.0",
    "chromedriver": "^2.36.0",
    "meteor-node-stubs": "^1.2.7",
    "selenium-webdriver": "^3.6.0",
    "simpl-schema": "^1.13.1"
  }
}

@StorytellerCZ
Copy link
Collaborator

This is most likely going to be a major version update, so minimum version of Meteor 2.8.1 is fine.

@StorytellerCZ StorytellerCZ linked an issue Feb 20, 2024 that may be closed by this pull request
@StorytellerCZ
Copy link
Collaborator

I'm going to release v1.5 in the coming days, most likely (pester me if I don't). After that the only releases I will do on the 1.x branch will be dependencies updates.

@StorytellerCZ StorytellerCZ added this to the V2.0 milestone Feb 28, 2024
@harryadel
Copy link

We're currently using the beta, I shall report back if we face any problems but so far so good. Thank you @bhunjadi @StorytellerCZ

@BastienRodz
Copy link

BastienRodz commented Mar 12, 2025

Hello !
The fetchOneAsync namedQuery was not defined in namedQuery.server.js. I made a PR to @bhunjadi to fix it, if you could merge it please : bhunjadi#2

This make sure we can do query.clone().fetchOneAsync() on server-side.

- fix: undefined server fetchOneAsync named query
@bhunjadi
Copy link
Contributor Author

Yikes! Thanks for the PR, I merged it.

@harryadel
Copy link

A question out of sheer curiosity but is Grapher working well with the latest version of collection-hooks?

@bhunjadi
Copy link
Contributor Author

It should be, yes. Grapher is using 2.0.0. and this appears to be the latest version.

My issue is that we're still couple of months from switch to Meteor 3.0 so I cannot test this properly with our app.

@StorytellerCZ
Copy link
Collaborator

@bhunjadi how are you feeling about this? I think we should move to release this week.

@harryadel
Copy link

@StorytellerCZ Shouldn't this PR be updated with the latest denormalize?

@StorytellerCZ
Copy link
Collaborator

@harryadel it will be once we make the rounds. denormalize 0.7 will be released soon.

@StorytellerCZ StorytellerCZ modified the milestone: V2.0 Apr 1, 2025
publish-composite and denormalize updated to their latest versions.
@StorytellerCZ
Copy link
Collaborator

Updated dependencies for denormalize and publish-composite.

@StorytellerCZ
Copy link
Collaborator

If the tests pass I will release another beta. I think we could probably move to rc at this point. Thoughts? @bhunjadi @harryadel

@harryadel
Copy link

@StorytellerCZ Thank you for continuously pushing this. Yes, a new beta would be nice for sure.

@bhunjadi
Copy link
Contributor Author

bhunjadi commented Apr 1, 2025

@StorytellerCZ Yes, let's go with RC. @harryadel reported that beta is working ok

@StorytellerCZ
Copy link
Collaborator

Published cultofcoders:[email protected].
Updated versionsFrom to also include Meteor 3.1.2 and 3.2.
Minor update to dev dependencies.
Started CHANGELOG for v2 <= we need to make a migration guide @bhunjadi @harryadel

Copy link

@harryadel harryadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read the migration. Can't believe the amount of work that went into it. Truly inspirational. Thank you @bhunjadi for this amazing gift. I've forked this endeavor and tried to make some changes, I'll ping you guys once I'm done.

@boomfly
Copy link

boomfly commented May 9, 2025

async code not work in reduce func.

Users.addReducers({
  roles: {
    body: {
      _id: 1,
    }
    reduce: async (object) => {
      result = await Roles.getRolesForUserAsync(object._id)
      console.log('roles reducer', result)
      return result
    }
  },
})

This query:

Users.createQuery({
    $filters: query,
    $options: options,
    roles: 1
})

return in roles = {}

@boomfly
Copy link

boomfly commented May 9, 2025

Add PR for async reducers bhunjadi#3

@harryadel
Copy link

bhunjadi#4

Bero and others added 2 commits May 12, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grapher 2.0 to support Meteor 3.0
8 participants