From 88bbd641598a787eca4a8c18e993a43f272214ca Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Wed, 20 Dec 2023 13:35:16 +0100 Subject: [PATCH 1/9] Update node.js in CI to v20 where possible Since Meteor 3 is going to be running on Node.js 20 instead of 18, I'm updating the CI machines to run on Node 20 as well. --- .circleci/config.yml | 2 +- .github/workflows/check-code-style.yml | 4 ++-- .github/workflows/check-syntax.yml | 6 +++--- .github/workflows/docs.yml | 2 +- .github/workflows/guide.yml | 2 +- .github/workflows/npm-eslint-plugin-meteor.yml | 4 ++-- .github/workflows/npm-meteor-babel.yml | 4 ++-- .github/workflows/npm-meteor-promise.yml | 4 ++-- .travis.yml | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 646dbbd508..1f939362ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -178,7 +178,7 @@ jobs: command: | eval $PRE_TEST_COMMANDS; cd dev_bundle/lib - ../../meteor npm install @types/node@18.11.9 --save-dev + ../../meteor npm install @types/node@20.10.5 --save-dev # Ensure that meteor/tools has no TypeScript errors. ../../meteor npm install -g typescript cd ../../ diff --git a/.github/workflows/check-code-style.yml b/.github/workflows/check-code-style.yml index 0a136db59a..5b7dbbac4c 100644 --- a/.github/workflows/check-code-style.yml +++ b/.github/workflows/check-code-style.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 14.x + node-version: 20.x - run: npm ci - name: Run ESLint@8 run: npx eslint@8 "./npm-packages/meteor-installer/**/*.js" diff --git a/.github/workflows/check-syntax.yml b/.github/workflows/check-syntax.yml index 91051b2789..1f9f151c94 100644 --- a/.github/workflows/check-syntax.yml +++ b/.github/workflows/check-syntax.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x - run: cd scripts/admin/check-legacy-syntax && npm ci - name: Check syntax - run: cd scripts/admin/check-legacy-syntax && node check-syntax.js + run: cd scripts/admin/check-legacy-syntax && node check-syntax.js diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3c7f7d5ec9..0b03766fce 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: working-directory: docs/ steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 12.x - name: Build the Docs diff --git a/.github/workflows/guide.yml b/.github/workflows/guide.yml index bbc5bbd023..4cb09a3b97 100644 --- a/.github/workflows/guide.yml +++ b/.github/workflows/guide.yml @@ -11,7 +11,7 @@ jobs: working-directory: guide/ steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 12.x - name: Build the Guide diff --git a/.github/workflows/npm-eslint-plugin-meteor.yml b/.github/workflows/npm-eslint-plugin-meteor.yml index 4361b5a788..f94c4786d9 100644 --- a/.github/workflows/npm-eslint-plugin-meteor.yml +++ b/.github/workflows/npm-eslint-plugin-meteor.yml @@ -18,11 +18,11 @@ jobs: working-directory: npm-packages/eslint-plugin-meteor strategy: matrix: - node-version: [16.x, 18.x] + node-version: 20.x steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/npm-meteor-babel.yml b/.github/workflows/npm-meteor-babel.yml index f9dc6f3a5f..b1b9220002 100644 --- a/.github/workflows/npm-meteor-babel.yml +++ b/.github/workflows/npm-meteor-babel.yml @@ -18,11 +18,11 @@ jobs: working-directory: npm-packages/meteor-babel strategy: matrix: - node-version: [16.x, 18.x] + node-version: 20.x steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/npm-meteor-promise.yml b/.github/workflows/npm-meteor-promise.yml index 4ad4f6df7c..fe25249075 100644 --- a/.github/workflows/npm-meteor-promise.yml +++ b/.github/workflows/npm-meteor-promise.yml @@ -18,11 +18,11 @@ jobs: working-directory: npm-packages/meteor-promise strategy: matrix: - node-version: [12.x, 14.x] + node-version: [14.x, 20.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.travis.yml b/.travis.yml index 860714f517..339caa097b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ dist: jammy sudo: required services: xvfb node_js: - - "18.16.0" + - "20.10.0" cache: directories: - ".meteor" From 74fbc2da5726354d70dbfe348fe7c12066cca9f2 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Fri, 9 Feb 2024 11:46:22 +0100 Subject: [PATCH 2/9] Quick fix in underscore 1.6 for #13001 --- packages/underscore/package.js | 2 +- packages/underscore/underscore.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/underscore/package.js b/packages/underscore/package.js index 84f8474611..d93e0bb600 100644 --- a/packages/underscore/package.js +++ b/packages/underscore/package.js @@ -1,7 +1,7 @@ Package.describe({ summary: "Collection of small helpers: _.map, _.each, ...", - version: '1.6.0', + version: '1.6.1', }); Npm.depends({ diff --git a/packages/underscore/underscore.js b/packages/underscore/underscore.js index b7788b3a4b..6a9e39fe09 100644 --- a/packages/underscore/underscore.js +++ b/packages/underscore/underscore.js @@ -529,7 +529,7 @@ var rest = slice.call(arguments, 1); return _.filter(_.uniq(array), function(item) { return _.every(rest, function(other) { - return _.contains(other, item) >= 0; + return _.contains(other, item); }); }); }; From 2ad99fd0922ded5ea488956cc3bc5959a25ffe64 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:14:53 -0300 Subject: [PATCH 3/9] update beta.0 references --- guide/source/3.0-migration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guide/source/3.0-migration.md b/guide/source/3.0-migration.md index 7591356327..5b89e65545 100644 --- a/guide/source/3.0-migration.md +++ b/guide/source/3.0-migration.md @@ -7,10 +7,10 @@ description: How to migrate your application to Meteor 3.0. ## What's the status of version 3.0? -**Latest version:** `3.0-beta.0`
+**Latest version:** `3.0-beta.4`
**Node.js version:** `20.9.0 LTS` -Meteor 3.0 is in alpha and not recommended for production. You can check the "[Release 3.0 Pull Request](https://github.com/meteor/meteor/pull/12359)" to see what is being changed. +Meteor 3.0 is in beta and not recommended for production. You can check the "[Release 3.0 Pull Request](https://github.com/meteor/meteor/pull/12359)" to see what is being changed. ## How to prepare for version 3.0? @@ -112,7 +112,7 @@ findOne is not available on the server. Please use findOneAsync instead. You can create a new Meteor 3.0 project by running the command below: ```bash -meteor create my-new-project --release 3.0-beta.0 +meteor create my-new-project --release 3.0-beta.4 ``` ### How to update from version 2? @@ -120,7 +120,7 @@ meteor create my-new-project --release 3.0-beta.0 You can update your Meteor 2.x project by running the command below inside your project folder: ```bash -meteor update --release 3.0-beta.0 +meteor update --release 3.0-beta.4 ``` ### How to follow the progress on version 3? From feddb545ad2c305721b988a05dffbf8bd219685f Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:24:15 -0300 Subject: [PATCH 4/9] Updating the FAQ for 3.0 migration --- guide/source/3.0-migration.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/guide/source/3.0-migration.md b/guide/source/3.0-migration.md index 5b89e65545..40c3dc044b 100644 --- a/guide/source/3.0-migration.md +++ b/guide/source/3.0-migration.md @@ -3,7 +3,10 @@ title: Migrating to Meteor 3.0 description: How to migrate your application to Meteor 3.0. --- -> **This guide will be created as we get closer to the Meteor 3.0 beta release.** We are also evaluating new documentation platforms to improve our users' experience. +> This guide will be created as we approach the Meteor 3.0 release. +> We're in the process of moving our documentation to Vitepress, +> and updating the Meteor API docs for version 3.0. For the latest updates, +> visit https://v3-docs.meteor.com/. ## What's the status of version 3.0? @@ -16,6 +19,10 @@ Meteor 3.0 is in beta and not recommended for production. You can check the "[Re You can follow the guide "[How to migrate to Meteor Async in Meteor 2.x](/prepare-meteor-3.0.html)" to help you prepare your application for the new version by starting to use async methods. +## How to follow the progress on version 3? + +The best way to follow the progress is by checking the "[What's left until an official Meteor 3.0?](https://github.com/meteor/meteor/discussions/12865)" discussion. We have also been sharing constant updates on [this topic](https://forums.meteor.com/t/fibers-public-roadmap-and-meteor-3-0/59627/84) in our forum. + ## Frequently Asked Questions ### What is Fibers? @@ -123,10 +130,6 @@ You can update your Meteor 2.x project by running the command below inside your meteor update --release 3.0-beta.4 ``` -### How to follow the progress on version 3? - -The best way to follow the progress is by checking the "[What's left until an official Meteor 3.0?](https://github.com/meteor/meteor/discussions/12865)" discussion. We have also been sharing constant updates on [this topic](https://forums.meteor.com/t/fibers-public-roadmap-and-meteor-3-0/59627/84) in our forum. - ### When will Meteor 3.0 be ready? We plan to release the beta version by the end of Q4 2023. An official version will depend a lot on user feedback, but we aim to release it by the end of Q1 2024. From a754fcc086d6eb7e2113613ac9fee3533fed6853 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:35:01 -0300 Subject: [PATCH 5/9] docs: updating beta reference to .6 --- guide/source/3.0-migration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guide/source/3.0-migration.md b/guide/source/3.0-migration.md index 40c3dc044b..3a4211aad7 100644 --- a/guide/source/3.0-migration.md +++ b/guide/source/3.0-migration.md @@ -10,7 +10,7 @@ description: How to migrate your application to Meteor 3.0. ## What's the status of version 3.0? -**Latest version:** `3.0-beta.4`
+**Latest version:** `3.0-beta.6`
**Node.js version:** `20.9.0 LTS` Meteor 3.0 is in beta and not recommended for production. You can check the "[Release 3.0 Pull Request](https://github.com/meteor/meteor/pull/12359)" to see what is being changed. @@ -119,7 +119,7 @@ findOne is not available on the server. Please use findOneAsync instead. You can create a new Meteor 3.0 project by running the command below: ```bash -meteor create my-new-project --release 3.0-beta.4 +meteor create my-new-project --release 3.0-beta.6 ``` ### How to update from version 2? @@ -127,7 +127,7 @@ meteor create my-new-project --release 3.0-beta.4 You can update your Meteor 2.x project by running the command below inside your project folder: ```bash -meteor update --release 3.0-beta.4 +meteor update --release 3.0-beta.6 ``` ### When will Meteor 3.0 be ready? From e8596c011532cd816246adf977776f7854b90209 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:08:41 -0300 Subject: [PATCH 6/9] Updated node and npm version to match beta.6 --- guide/source/3.0-migration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guide/source/3.0-migration.md b/guide/source/3.0-migration.md index 3a4211aad7..f31ae24e1e 100644 --- a/guide/source/3.0-migration.md +++ b/guide/source/3.0-migration.md @@ -11,7 +11,8 @@ description: How to migrate your application to Meteor 3.0. ## What's the status of version 3.0? **Latest version:** `3.0-beta.6`
-**Node.js version:** `20.9.0 LTS` +**Node.js version:** `20.11.1 LTS` +**NPM version:** `10.2.4` Meteor 3.0 is in beta and not recommended for production. You can check the "[Release 3.0 Pull Request](https://github.com/meteor/meteor/pull/12359)" to see what is being changed. From f697f331cf71d1b17d7755d230c4061f240a6102 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:13:28 -0300 Subject: [PATCH 7/9] add missing BR --- guide/source/3.0-migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/source/3.0-migration.md b/guide/source/3.0-migration.md index f31ae24e1e..946dfcec26 100644 --- a/guide/source/3.0-migration.md +++ b/guide/source/3.0-migration.md @@ -11,7 +11,7 @@ description: How to migrate your application to Meteor 3.0. ## What's the status of version 3.0? **Latest version:** `3.0-beta.6`
-**Node.js version:** `20.11.1 LTS` +**Node.js version:** `20.11.1 LTS`
**NPM version:** `10.2.4` Meteor 3.0 is in beta and not recommended for production. You can check the "[Release 3.0 Pull Request](https://github.com/meteor/meteor/pull/12359)" to see what is being changed. From 3d64dc5dde0e2ca27a2e23058ec3c4b7f0bc28d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Wed, 6 Mar 2024 15:23:34 +0100 Subject: [PATCH 8/9] update changelog for observeChangesAsync and observeAsync --- docs/generators/changelog/versions/3.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/generators/changelog/versions/3.0.md b/docs/generators/changelog/versions/3.0.md index 0fdd7b8ad6..bf6e90d74a 100644 --- a/docs/generators/changelog/versions/3.0.md +++ b/docs/generators/changelog/versions/3.0.md @@ -389,6 +389,7 @@ if the cursor is ready and if the callbacks are have been called. If you only use it in the `Client` or as a `LocalCollection` things have not changed. + - `cursor.observeChangesAsync` and `cursor.observeAsync` are added and resolve as promises, returning results similar to their synchronous counterparts. - `mobile-experience@2.0.0`: @@ -431,6 +432,7 @@ - Updated to unify methods, `update`,`insert`,`remove`, `fetch` are now async, they are the same as their `*Async` counterpart. - `ensureIndex` and `createIndex` are now async. + - `observeChangesAsync` and `observeAsync` are added and resolve as promises, returning results similar to their synchronous counterparts. - `npm-mongo@5.0.0`: From 54745a9a6e47080318058ace93d173470cc4d8ea Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 7 Mar 2024 09:58:19 -0300 Subject: [PATCH 9/9] Updating old docs to make CI pass --- docs/source/api/assets.md | 6 +++--- docs/source/api/packagejs.md | 6 +++--- docs/source/api/passwords.md | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/api/assets.md b/docs/source/api/assets.md index e748b5b49d..af4cd86124 100644 --- a/docs/source/api/assets.md +++ b/docs/source/api/assets.md @@ -10,8 +10,8 @@ assets, which are located in the `private` subdirectory of an application's tree. Assets are not processed as source files and are copied directly into your application's bundle. -{% apibox "Assets.getText" %} -{% apibox "Assets.getBinary" %} +{% apibox "Assets.getTextAsync" %} +{% apibox "Assets.getBinaryAsync" %} {% apibox "Assets.absoluteFilePath" %} Static server assets are included by placing them in the application's `private` @@ -20,7 +20,7 @@ directory called `nested` with a file called `data.txt` inside it, then server code can read `data.txt` by running: ```js -const data = Assets.getText('nested/data.txt'); +const data = await Assets.getTextAsync('nested/data.txt'); ``` Note: Packages can only access their own assets. If you need to read the assets of a different package, or of the enclosing app, you need to get a reference to that package's `Assets` object. diff --git a/docs/source/api/packagejs.md b/docs/source/api/packagejs.md index 7cc521073f..9feb02877f 100644 --- a/docs/source/api/packagejs.md +++ b/docs/source/api/packagejs.md @@ -80,7 +80,7 @@ package) so that Meteor will pick up the local dependency. > In a lifecycle of a package there might come time to end the development for various reasons, or it gets superseded. In either case Meteor allows you to easily notify the users of the package by setting the deprecated flag to true: `deprecated: true` in the package description. In addition, you -replace it with a string that tells the users where to find replacement or what to do. +replace it with a string that tells the users where to find replacement or what to do. Provide basic package information with `Package.describe(options)`. To publish a package, you must define `summary` and `version`. @@ -97,7 +97,7 @@ package is exported to. {% apibox "PackageAPI#versionsFrom" %} > Choose Meteor versions carefully. First determine the minimum version of Meteor you need for the API you use in your package. - This should be based on specific needs of your package like needed the *Async calls, which would require minimum version to be + This should be based on specific needs of your package like needed the *Async calls, which would require minimum version to be at least 2.8. Another example are where packages had a major version bump, for example this has happened with the accounts packages in Meteor 2.3. If you want to be backward and forward compatible it is good to include Meteor version before 2.3 and then 2.3.6 in the array. A general recommendation for most compatibility for accounts packages (unless you need API that was affected in Meteor 2.3) is to have the following @@ -315,7 +315,7 @@ methods are available: - `addAsset` - Add a file to serve as-is to the browser or to include on the browser, depending on the target. On the web, it will be served at the exact path requested. For server targets, it can be retrieved using - `Assets.getText` or `Assets.getBinary`. + `Assets.getTextAsync` or `Assets.getBinaryAsync`. - `addHtml` - Works in web targets only. Add markup to the `head` or `body` section of the document. - `hmrAvailable` - Returns true if the file can be updated with HMR. Among other things, diff --git a/docs/source/api/passwords.md b/docs/source/api/passwords.md index 0a643930d7..107b38d45a 100644 --- a/docs/source/api/passwords.md +++ b/docs/source/api/passwords.md @@ -37,7 +37,7 @@ id. On the client, you must pass `password` and at least one of `username` or `email` — enough information for the user to be able to log in again later. If there are existing users with a username or email only differing in case, `createUser` will fail. The callback's `error.reason` will be `'Username already exists.'` or `'Email already exists.'` In the latter case, the user can then either [login](accounts.html#Meteor-loginWithPassword) or [reset their password](#Accounts-resetPassword). -On the server, you do not need to specify `password`, but the user will not be able to log in until it has a password (eg, set with [`Accounts.setPassword`](#accounts_setpassword)). To create an account without a password on the server and still let the user pick their own password, call `createUser` with the `email` option and then call [`Accounts.sendEnrollmentEmail`](#accounts_sendenrollmentemail). This will send the user an email with a link to set their initial password. +On the server, you do not need to specify `password`, but the user will not be able to log in until it has a password (eg, set with [`Accounts.setPasswordAsync`](#accounts_setpasswordasync)). To create an account without a password on the server and still let the user pick their own password, call `createUser` with the `email` option and then call [`Accounts.sendEnrollmentEmail`](#accounts_sendenrollmentemail). This will send the user an email with a link to set their initial password. By default the `profile` option is added directly to the new user document. To override this behavior, use [`Accounts.onCreateUser`](#accounts_oncreateuser). @@ -100,7 +100,7 @@ This function accepts tokens passed into the callbacks registered with If the user trying to reset the password has 2FA enabled, this error will be thrown: * "Changed password, but user not logged in because 2FA is enabled [2fa-enabled]": No longer signing in the user automatically if the user has 2FA enabled. -{% apibox "Accounts.setPassword" %} +{% apibox "Accounts.setPasswordAsync" %} {% apibox "Accounts.sendResetPasswordEmail" %}