From e13b7b0c86500b5579c96e3b56260905d8b91f1c Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Mon, 7 Oct 2024 17:47:12 +0200 Subject: [PATCH] Create docs for modern-browsers #13226 --- packages/modern-browsers/modern.js | 74 +++++++++---- v3-docs/docs/.vitepress/config.mts | 4 + v3-docs/docs/api/packages-listing.md | 2 + v3-docs/docs/history.md | 90 ++++++++++++++++ v3-docs/docs/package-lock.json | 126 +++++++++++++---------- v3-docs/docs/package.json | 6 +- v3-docs/docs/packages/modern-browsers.md | 19 ++++ 7 files changed, 242 insertions(+), 79 deletions(-) create mode 100644 v3-docs/docs/packages/modern-browsers.md diff --git a/packages/modern-browsers/modern.js b/packages/modern-browsers/modern.js index 19ff2734ae..5b737654a7 100644 --- a/packages/modern-browsers/modern.js +++ b/packages/modern-browsers/modern.js @@ -38,28 +38,32 @@ const browserAliases = { safari: ['appleMail'], }; -// Expand the given minimum versions by reusing chrome versions for -// chromeMobile (according to browserAliases above). +/** + * Expand the given minimum versions by reusing chrome versions for + * chromeMobile (according to browserAliases above). + * @param versions {object} + * @return {any} + */ function applyAliases(versions) { const lowerCaseVersions = Object.create(null); - Object.keys(versions).forEach(browser => { + for (const browser of Object.keys(versions)) { lowerCaseVersions[browser.toLowerCase()] = versions[browser]; - }); + } - Object.keys(browserAliases).forEach(original => { + for (let original of Object.keys(browserAliases)) { const aliases = browserAliases[original]; original = original.toLowerCase(); if (hasOwn.call(lowerCaseVersions, original)) { - aliases.forEach(alias => { + for (let alias of aliases) { alias = alias.toLowerCase(); if (!hasOwn.call(lowerCaseVersions, alias)) { lowerCaseVersions[alias] = lowerCaseVersions[original]; } - }); + } } - }); + } return lowerCaseVersions; } @@ -67,9 +71,15 @@ function applyAliases(versions) { // TODO Should it be possible for callers to setMinimumBrowserVersions to // forbid any version of a particular browser? -// Given a { name, major, minor, patch } object like the one provided by -// webapp via request.browser, return true if that browser qualifies as -// "modern" according to all requested version constraints. +/** + * @name ModernBrowsers.isModern + * @summary Given a { name, major, minor, patch } object like the one provided by + * webapp via request.browser, return true if that browser qualifies as + * "modern" according to all requested version constraints. + * @locus server + * @param [browser] {object} { name: string, major: number, minor?: number, patch?: number } + * @return {boolean} + */ function isModern(browser) { const lowerCaseName = browser && typeof browser.name === 'string' && browser.name.toLowerCase(); @@ -84,29 +94,44 @@ function isModern(browser) { ); } -// Any package that depends on the modern-browsers package can call this -// function to communicate its expectations for the minimum browser -// versions that qualify as "modern." The final decision between -// web.browser.legacy and web.browser will be based on the maximum of all -// requested minimum versions for each browser. +/** + * @name ModernBrowsers.setMinimumBrowserVersions + * @summary Any package that depends on the modern-browsers package can call this + * function to communicate its expectations for the minimum browser + * versions that qualify as "modern." The final decision between + * web.browser.legacy and web.browser builds will be based on the maximum of all + * requested minimum versions for each browser. + * @locus server + * @param versions {object} Name of the browser engine and minimum version for at which it is considered modern. For example: { + * chrome: 49, + * edge: 12, + * ie: 12, + * firefox: 45, + * mobileSafari: 10, + * opera: 38, + * safari: 10, + * electron: [1, 6], + * } + * @param source {function} Name of the capability that requires these minimums. + */ function setMinimumBrowserVersions(versions, source) { const lowerCaseVersions = applyAliases(versions); - Object.keys(lowerCaseVersions).forEach(lowerCaseName => { + for (const lowerCaseName of Object.keys(lowerCaseVersions)) { const version = lowerCaseVersions[lowerCaseName]; if ( hasOwn.call(minimumVersions, lowerCaseName) && !greaterThan(version, minimumVersions[lowerCaseName].version) ) { - return; + continue; } minimumVersions[lowerCaseName] = { version: copy(version), source: source || getCaller('setMinimumBrowserVersions'), }; - }); + } } function getCaller(calleeName) { @@ -123,12 +148,23 @@ function getCaller(calleeName) { return caller; } +/** + * @name ModernBrowsers.getMinimumBrowserVersions + * @summary Returns an object that lists supported browser engines and their minimum versions to be considered modern for Meteor. + * @locus server + * @return {object} + */ function getMinimumBrowserVersions() { return minimumVersions; } Object.assign(exports, { isModern, setMinimumBrowserVersions, getMinimumBrowserVersions, + /** + * @name ModernBrowsers.calculateHashOfMinimumVersions + * @summary Creates a hash of the object of minimum browser versions. + * @return {string} + */ calculateHashOfMinimumVersions() { const { createHash } = require('crypto'); return createHash('sha1') diff --git a/v3-docs/docs/.vitepress/config.mts b/v3-docs/docs/.vitepress/config.mts index 653f1b3b21..396641001f 100644 --- a/v3-docs/docs/.vitepress/config.mts +++ b/v3-docs/docs/.vitepress/config.mts @@ -317,6 +317,10 @@ export default defineConfig({ text: "markdown", link: "/packages/markdown", }, + { + text: "modern-browsers", + link: "/packages/modern-browsers", + }, { text: "modules", link: "/packages/modules", diff --git a/v3-docs/docs/api/packages-listing.md b/v3-docs/docs/api/packages-listing.md index f6f064191a..3dcb5ca193 100644 --- a/v3-docs/docs/api/packages-listing.md +++ b/v3-docs/docs/api/packages-listing.md @@ -106,6 +106,7 @@ ### [mongo-dev-server](https://github.com/meteor/meteor/tree/devel/packages/mongo-dev-server) {#mongo-dev-server} ### [mongo-id](https://github.com/meteor/meteor/tree/devel/packages/mongo-id) {#mongo-id} ### [mongo-livedata](https://github.com/meteor/meteor/tree/devel/packages/mongo-livedata) {#mongo-livedata} +### [npm-bcrypt](https://github.com/meteor/meteor/tree/devel/packages/npm-bcrypt) {#npm-bcrypt} ### [npm-mongo](https://github.com/meteor/meteor/tree/devel/packages/npm-mongo) {#npm-mongo} ### [oauth](https://github.com/meteor/meteor/tree/devel/packages/oauth) {#oauth} ### [oauth-encryption](https://github.com/meteor/meteor/tree/devel/packages/oauth-encryption) {#oauth-encryption} @@ -134,6 +135,7 @@ ### [standard-minifier-js](https://github.com/meteor/meteor/tree/devel/packages/standard-minifier-js) {#standard-minifier-js} ### [standard-minifiers](https://github.com/meteor/meteor/tree/devel/packages/standard-minifiers) {#standard-minifiers} ### [static-html](https://github.com/meteor/meteor/tree/devel/packages/static-html) {#static-html} +### [static-html-tools](https://github.com/meteor/meteor/tree/devel/packages/static-html-tools) {#static-html-tools} ### [test-helpers](https://github.com/meteor/meteor/tree/devel/packages/test-helpers) {#test-helpers} ### [test-in-browser](https://github.com/meteor/meteor/tree/devel/packages/test-in-browser) {#test-in-browser} ### [test-in-console](https://github.com/meteor/meteor/tree/devel/packages/test-in-console) {#test-in-console} diff --git a/v3-docs/docs/history.md b/v3-docs/docs/history.md index fb537c579f..aba723ccb2 100644 --- a/v3-docs/docs/history.md +++ b/v3-docs/docs/history.md @@ -12,6 +12,96 @@ This is a complete history of changes for Meteor releases. +## v3.0.4, 2024-09-xx + +### Highlights + +N/A + +#### Breaking Changes + +N/A + +#### Internal API changes + +N/A + +#### Migration Steps + +Please run the following command to update your project: + +```bash + +meteor update --release 3.0.4 + +``` + +#### Meteor Version Release + +N/A + +#### Special thanks to +N/A +## v3.0.3, 2024-09-11 + +### Highlights + +- Fixed `Meteor.userId` only being invoked with `bindEnvironment`. +- Updated to Node `20.17.x`. +- Fixed an issue where `meteor --open` opens the browser before the app is started. +- Investigated and addressed the error when installing the `jam:method` package. +- Improved the message for new available versions when running an app. +- Updated the documentation link inside `install.sh`. +- Resolved the issue where subscriptions stopped after a parameter change. +- Added MongoDB connection telemetry. +- Bumped the `email` package to prevent update errors. +- Cordova package updates + +#### Breaking Changes + +N/A + +#### Internal API changes + +- Some internal changes to how async contexts are handled, ensuring better performance and garbage collection. + +#### Migration Steps + +Please run the following command to update your project: + +```bash + +meteor update --release 3.0.3 + +``` + +If you've had your Meteor installation for over a year, we suggest reinstalling it to avoid any package installation issues. You can do this by running a few quick commands: + +```bash +npx meteor uninstall // or rm -rf ~/.meteor +npx meteor +``` + + + +#### Meteor Version Release + +* `Bumped packages`: + - accounts-base@3.0.2 + - accounts-password@3.0.2 + - email@3.1.0 + - mongo@2.0.2 + + +#### Special thanks to + +- [@ayewo](https://github.com/ayewo). +- [@denihs](https://github.com/denihs). +- [@harryadel](https://github.com/harryadel). +- [@kbarr1212](https://github.com/kbarr1212). +- [@leonardoventurini](https://github.com/leonardoventurini). +- [@nachocodoner](https://github.com/nachocodoner). + ## v3.0.2, 2024-08-14 ### Highlights diff --git a/v3-docs/docs/package-lock.json b/v3-docs/docs/package-lock.json index 55d9e175c4..2888dc0256 100644 --- a/v3-docs/docs/package-lock.json +++ b/v3-docs/docs/package-lock.json @@ -5,12 +5,12 @@ "packages": { "": { "dependencies": { - "vue-collapsed": "^1.3.0" + "vue-collapsed": "^1.3.4" }, "devDependencies": { "canonical-json": "^0.0.4", - "jsdoc": "^4.0.2", - "vitepress": "1.0.1" + "jsdoc": "^4.0.3", + "vitepress": "1.0.2" } }, "node_modules/@algolia/autocomplete-core": { @@ -824,10 +824,11 @@ "dev": true }, "node_modules/@types/linkify-it": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.5.tgz", - "integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==", - "dev": true + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "dev": true, + "license": "MIT" }, "node_modules/@types/markdown-it": { "version": "13.0.7", @@ -840,10 +841,11 @@ } }, "node_modules/@types/mdurl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.5.tgz", - "integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "dev": true, + "license": "MIT" }, "node_modules/@types/web-bluetooth": { "version": "0.0.20", @@ -1345,21 +1347,22 @@ } }, "node_modules/jsdoc": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.2.tgz", - "integrity": "sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.3.tgz", + "integrity": "sha512-Nu7Sf35kXJ1MWDZIMAuATRQTg1iIPdzh7tqJ6jjvaU/GfDf+qi5UV8zJR3Mo+/pYFvm8mzay4+6O5EWigaQBQw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@babel/parser": "^7.20.15", "@jsdoc/salty": "^0.2.1", - "@types/markdown-it": "^12.2.3", + "@types/markdown-it": "^14.1.1", "bluebird": "^3.7.2", "catharsis": "^0.9.0", "escape-string-regexp": "^2.0.0", "js2xmlparser": "^4.0.2", "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", + "markdown-it": "^14.1.0", + "markdown-it-anchor": "^8.6.7", "marked": "^4.0.10", "mkdirp": "^1.0.4", "requizzle": "^0.2.3", @@ -1374,13 +1377,14 @@ } }, "node_modules/jsdoc/node_modules/@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", "dev": true, + "license": "MIT", "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" + "@types/linkify-it": "^5", + "@types/mdurl": "^2" } }, "node_modules/klaw": { @@ -1393,12 +1397,13 @@ } }, "node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, + "license": "MIT", "dependencies": { - "uc.micro": "^1.0.1" + "uc.micro": "^2.0.0" } }, "node_modules/lodash": { @@ -1426,19 +1431,21 @@ "dev": true }, "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" }, "bin": { - "markdown-it": "bin/markdown-it.js" + "markdown-it": "bin/markdown-it.mjs" } }, "node_modules/markdown-it-anchor": { @@ -1451,15 +1458,6 @@ "markdown-it": "*" } }, - "node_modules/markdown-it/node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/marked": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", @@ -1473,10 +1471,11 @@ } }, "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, + "license": "MIT" }, "node_modules/minisearch": { "version": "6.3.0", @@ -1570,6 +1569,16 @@ "url": "https://opencollective.com/preact" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/requizzle": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", @@ -1670,10 +1679,11 @@ "dev": true }, "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" }, "node_modules/underscore": { "version": "1.13.6", @@ -1737,10 +1747,11 @@ } }, "node_modules/vitepress": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.1.tgz", - "integrity": "sha512-eNr5pOBppYUUjEhv8S0S2t9Tv95LQ6mMeHj6ivaGwfHxpov70Vduuwl/QQMDRznKDSaP0WKV7a82Pb4JVOaqEw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.2.tgz", + "integrity": "sha512-bEj9yTEdWyewJFOhEREZF+mXuAgOq27etuJZT6DZSp+J3XpQstXMJc5piSVwhZBtuj8OfA0iXy+jdP1c71KMYQ==", "dev": true, + "license": "MIT", "dependencies": { "@docsearch/css": "^3.6.0", "@docsearch/js": "^3.6.0", @@ -1796,9 +1807,10 @@ } }, "node_modules/vue-collapsed": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/vue-collapsed/-/vue-collapsed-1.3.0.tgz", - "integrity": "sha512-d2qwv0fj4aaoekI+6x1RgxpoK0s5K8HLj70E+dWxIKkgzADcZ9kUrnXRazgIz9ETYkKOi6j2CWv/8+rS8Kr3LQ==" + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/vue-collapsed/-/vue-collapsed-1.3.4.tgz", + "integrity": "sha512-W92b+QT3n5iTrfrH6kyvx3TsriYPfy/Ymsb6DaanjeMkJYMdVl1S4wzKRYVDsxWQPDxiC+5m+UwPwT/8YAYodA==", + "license": "MIT" }, "node_modules/xmlcreate": { "version": "2.0.4", diff --git a/v3-docs/docs/package.json b/v3-docs/docs/package.json index 748ffdba66..704e9b6cb1 100644 --- a/v3-docs/docs/package.json +++ b/v3-docs/docs/package.json @@ -9,10 +9,10 @@ }, "devDependencies": { "canonical-json": "^0.0.4", - "jsdoc": "^4.0.2", - "vitepress": "1.0.1" + "jsdoc": "^4.0.3", + "vitepress": "1.0.2" }, "dependencies": { - "vue-collapsed": "^1.3.0" + "vue-collapsed": "^1.3.4" } } diff --git a/v3-docs/docs/packages/modern-browsers.md b/v3-docs/docs/packages/modern-browsers.md new file mode 100644 index 0000000000..ae8d39d85d --- /dev/null +++ b/v3-docs/docs/packages/modern-browsers.md @@ -0,0 +1,19 @@ +# Modern-browsers + + +API for defining the boundary between modern and legacy JavaScript clients. + +You can use this package to define the minimum browser versions for which +a browser engine will be considered modern. All browsers that do not meet +the threshold will receive the legacy bundle. This way you can easily keep +on using modern features that you need. + +You can read more about this in [Meteor 1.7 announcement blog](https://blog.meteor.com/meteor-1-7-and-the-evergreen-dream-a8c1270b0901). + + + + + + + +