I migrated to 3.0 and it works

I have a in development app which is a little heavy.
I counted number of lines in /imports folder.

language files code comment blank total
TypeScript 263 31,741 1,105 3,133 35,979
TypeScript JSX 88 8,483 149 1,029 9,661
JSON 6 654 0 8 662
JavaScript JSX 2 125 13 19 157

Today I migrated to Meteor 3.0 beta.0 and it works.
I run my tests (meteor test), they work.
I tested main features of the app and they all work.

It looks like we’re very close to the official Meteor V3 release.

My Meteor packages:

# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.5.2-beta300.0             # Packages every Meteor app needs to have
mobile-experience@1.1.1-beta300.0       # Packages for a great mobile UX
mongo@2.0.0-beta300.0                   # The database Meteor supports right now
reactive-var@1.0.13-beta300.0            # Reactive variable for tracker

standard-minifier-css@1.9.3-beta300.0   # CSS minifier run for production mode
standard-minifier-js@3.0.0-beta300.0    # JS minifier run for production mode
es5-shim@4.8.1-beta300.0                # ECMAScript 5 compatibility for older browsers
ecmascript@0.16.8-beta300.0              # Enable ECMAScript2015+ syntax in app code
typescript@4.9.5-beta300.0              # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.6.0-beta300.0            # Server-side component of the `meteor shell` command
hot-module-replacement@0.5.4-beta300.0  # Update client in development without reloading the page

static-html@1.3.3-beta300.0             # Define static page content in .html files
accounts-base@3.0.0-beta300.0
accounts-password@3.0.0-beta300.0
server-render@0.4.2-beta300.0
react-meteor-data
minhna:connection-status-react
zodern:types
aldeed:collection2@4.0.0-beta.7
tmeasday:check-npm-versions
meteortesting:mocha@3.1.0-beta300.0

My npm packages:

  "dependencies": {
    "@apollo/client": "^3.7.8",
    "@babel/core": "^7.16.0",
    "@babel/runtime": "^7.16.3",
    "@emotion/react": "^11.7.1",
    "@emotion/server": "^11.4.0",
    "@emotion/styled": "^11.6.0",
    "@faker-js/faker": "^7.6.0",
    "@google-cloud/storage": "^5.18.1",
    "@graphql-tools/schema": "^8.3.1",
    "@mui/icons-material": "^5.6.1",
    "@mui/material": "^5.6.1",
    "@sendgrid/mail": "^7.7.0",
    "accesscontrol": "^2.2.1",
    "apollo-server-express": "^3.6.3",
    "command-exists": "^1.2.9",
    "compression": "^1.7.4",
    "csv-parse": "^5.5.0",
    "date-fns": "^2.30.0",
    "date-fns-tz": "^2.0.0",
    "debug": "^4.3.3",
    "ffprobe": "^1.1.2",
    "ffprobe-static": "^3.0.0",
    "file-saver": "^2.0.5",
    "file-type": "^16.5.4",
    "firebase-admin": "^10.0.2",
    "fs-extra": "^10.0.0",
    "graphql": "^16.8.1",
    "graphql-redis-subscriptions": "^2.6.0",
    "graphql-subscriptions": "^2.0.0",
    "graphql-ws": "^5.5.5",
    "i18next": "^23.5.1",
    "i18next-browser-languagedetector": "^7.1.0",
    "i18next-http-middleware": "^3.3.2",
    "luxon": "^3.3.0",
    "mailersend": "^2.2.0",
    "meteor-node-stubs": "^1.1.0",
    "mime": "^3.0.0",
    "moment": "^2.29.1",
    "multiparty": "^4.2.3",
    "node-forge": "^1.2.1",
    "notistack": "^3.0.1",
    "numeral": "^2.0.6",
    "pdf-thumbnail": "^1.0.6",
    "postmark": "^4.0.2",
    "react": "^18.0.0",
    "react-data-grid": "^7.0.0-beta.39",
    "react-dom": "^18.0.0",
    "react-error-boundary": "^4.0.11",
    "react-helmet": "^6.1.0",
    "react-i18next": "^13.2.2",
    "react-icons": "^4.11.0",
    "react-router-dom": "^6.3.0",
    "remove": "^0.1.5",
    "rosie": "^2.1.0",
    "sharp": "^0.30.1",
    "simpl-schema": "^1.13.1",
    "ts-access-control": "^0.1.20",
    "winston": "^3.3.3",
    "ws": "^8.5.0"
  },
  "meteor": {
    "mainModule": {
      "client": "client/main.tsx",
      "server": "server/main.ts"
    }
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.16.3",
    "@babel/preset-react": "^7.16.7",
    "@meteorjs/eslint-config-meteor": "^1.0.5",
    "@types/chai": "^4.3.4",
    "@types/command-exists": "^1.2.0",
    "@types/compression": "^1.7.2",
    "@types/debug": "^4.1.8",
    "@types/faker": "^5.5.9",
    "@types/ffprobe": "^1.1.3",
    "@types/ffprobe-static": "^2.0.1",
    "@types/file-saver": "^2.0.5",
    "@types/fs-extra": "^9.0.13",
    "@types/luxon": "^2.3.0",
    "@types/meteor": "^2.9.1",
    "@types/mime": "^3.0.3",
    "@types/mocha": "^10.0.1",
    "@types/mongodb": "^4.0.7",
    "@types/multiparty": "^0.0.33",
    "@types/node-forge": "^0.10.10",
    "@types/numeral": "^2.0.2",
    "@types/pdf-thumbnail": "^1.0.1",
    "@types/react-dom": "^18.0.0",
    "@types/rosie": "^0.0.40",
    "@types/sharp": "^0.29.5",
    "@types/simpl-schema": "^1.12.0",
    "@types/sinon": "^17.0.2",
    "@types/styled-components": "^5.1.25",
    "@types/ws": "^8.2.2",
    "chai": "^4.3.10",
    "eslint": "^8.3.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-import-resolver-meteor": "^0.4.0",
    "eslint-plugin-import": "^2.25.3",
    "eslint-plugin-jsx": "^0.1.0",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-meteor": "^7.3.0",
    "eslint-plugin-react": "^7.29.4",
    "express": "^4.18.2",
    "sinon": "^17.0.1"
  }
13 Likes

I’m happy to hear that! Thanks for sharing @minhna! :tada:

Could you also share what your main challenges were during the migration?

2 Likes

Yes, but not many challenges, which is awesome.

First I run the command to upgrade meteor:

meteor update --release 3.0-beta.0

It said one package was not supported, which is swydo:graphql.
I checked that I don’t use that package, so I remove it and run the command again. This time it works.

I run the app. There was an error:

TypeError: Cannot read properties of null (reading 'type')
at packages/aldeed_simple-schema.js:1657:23

The package is: aldeed:collection2 2.2.0*
I went to github Meteor community packages: GitHub - Meteor-Community-Packages/meteor-collection2: A Meteor package that extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.
I found that @harry97 created new version of this package which is aldeed:collection2@4.0.0-beta.7.
I install that one, add import 'meteor/aldeed:collection2/static'; to startup file and BOOM. the app works.

I tried to run my tests (not many of them) I they didn’t work. the error was:

TypeError: Settings.attachSchema is not a function

So I tried to fix that by adding the aldeed package import statement to one of my test file (which is weird solution).

And that’s all problem I got when I migrated my app.

2 Likes

No wonder you migrated your app. Aside from the core packages you’re using very very few community packages:

minhna:connection-status-react
zodern:types
aldeed:collection2@4.0.0-beta.7
tmeasday:check-npm-versions
meteortesting:mocha@3.1.0-beta300.0

And I reckon you’re not using methods that much given your graphql libraries.

Hopefully things go even smoother in long run. Congratz bud.

2 Likes

BTW, My app doesn’t have many front-end (React components) because its main purpose is back-end of a react-native mobile app.
But I use both method and pub/sub in my components and it works.

Well it’s not true. I use graphql but every graphql query and mutation calls a Meteor method. Which mean I have all Meteor methods available for web version. Of-course I can use graphql for my web version.

Yes, that’s true. From the beginning, I tried to use less additional packages as possible.

Yes, that’s true. From the beginning, I tried to use less additional packages as possible.

Which eventually paid off :sweat_smile:

Hey, did you build for production / deploy to server?!

Which pkg did you import? import 'meteor/aldeed:collection2' ?

My app relies on swydo:graphql. Will it be compatible with an upcoming beta of Meteor 3?

You now need to import it statically, likely in each file where you are using attachSchema, if you want the same behaviour as in pre-3.0:

import 'meteor/aldeed:collection2/static';

You can also import it dynamically.

More info here: GitHub - Meteor-Community-Packages/meteor-collection2 at meteor-3

1 Like

Not yet, I’ve just run it in development only.

I need to put this import statement to the test file which reported error: import 'meteor/aldeed:collection2/static';. Only one file and other tests run without problem.

You will need a new version of swydo:graphql package which works with Meteor 3. Sometime it’s pretty simple upgrading a package to use async/await API.

Okay, I’ll ask on their GitHub issues and see what they say.

Hi any clarity
on what is needed here: (Vue Problems?) - thanks

% meteor update --release 3.0-beta.0
=> Errors while initializing project:                                              
                                              
While selecting package versions:
error: Conflict: Constraint caching-compiler@1.0.5 is not satisfied by caching-compiler 2.0.0-beta300.0.
Constraints on package "caching-compiler":
* caching-compiler@~2.0.0-beta300.0 <- top level
* caching-compiler@2.0.0-alpha300.17 <- caching-html-compiler 2.0.0-alpha300.17 <- static-html 1.3.3-beta300.0
* caching-compiler@1.0.5 <- akryum:vue-component 0.3.5

Conflict: Constraint babel-compiler@6.8.0 is not satisfied by babel-compiler 7.11.0-beta300.0.
Constraints on package "babel-compiler":
* babel-compiler@~7.11.0-beta300.0 <- top level
* babel-compiler@7.11.0-beta300.0 <- ecmascript 0.16.8-beta300.0
* babel-compiler@7.11.0-beta300.0 <- typescript 4.9.5-beta300.0 <- logging 1.3.3-beta300.0 <- mongo 2.0.0-beta300.0
* babel-compiler@7.11.0-beta300.0 <- minifier-js 3.0.0-beta300.0 <- standard-minifier-js 3.0.0-beta300.0
* babel-compiler@7.11.0-beta300.0 <- shell-server 0.6.0-beta300.0
* babel-compiler@6.8.0 <- akryum:vue-component 0.3.5
* babel-compiler@7.3.4 <- coffeescript-compiler 2.4.1 <- akryum:vue-coffee 0.4.2

akryum:vue-component 0.3.5 must be updated

@minhna, congrats.

I have a checklist of major things required for migrating to Meteor 3.0, but some of this seems irrelevant to your project. But there is no harm in asking.

  1. Did you convert to async MongoDB functions before upgrading (which is possible in the latest Meteor 2.x)
  2. Do you use client stubs?
  3. Do you have DB calls in the client? Do you have DB code shared between the client and server?
  4. Do you implement SSR?

Yes. I did it before when I upgraded my app to 2.8

No, I don’t

Do you mean minimongo? I use pub/sub in the client (react)

Not yet, I will try but it’s not critical in this project.

1 Like