mirror of
https://github.com/meteor/meteor.git
synced 2026-01-08 15:24:00 -05:00
Merge branch 'devel' into patch-1
This commit is contained in:
@@ -32,6 +32,24 @@ run_env_change: &run_env_change
|
||||
# Reload sysctl so these are in effect.
|
||||
# sudo sysctl -p
|
||||
|
||||
log_env: &log_env
|
||||
name: Log Environment
|
||||
command: |
|
||||
echo "==> LBS Version"
|
||||
lsb_release -a
|
||||
echo "==> cat /etc/os-release"
|
||||
cat /etc/os-release
|
||||
echo "==> uname -srm"
|
||||
uname -srm
|
||||
echo "==> Node version: $(node --version)"
|
||||
echo "==> NPM version: $(npm --version)"
|
||||
echo "==> Meteor Node version: $(./meteor node --version)"
|
||||
echo "==> Meteor NPM version: $(./meteor npm --version)"
|
||||
echo "==> Dev bundle package.json:"
|
||||
cat ./dev_bundle/lib/package.json
|
||||
echo "==> Dev bundle node_modules:"
|
||||
ls -l ./dev_bundle/lib/node_modules
|
||||
|
||||
# A reusable "run" snippet which enables the continued logging of memoryusage
|
||||
# to a file on disk which can be saved to build artifacts for later analysis.
|
||||
run_log_mem_use: &run_log_mem_use
|
||||
@@ -58,10 +76,10 @@ run_save_node_bin: &run_save_node_bin
|
||||
fi
|
||||
|
||||
# This environment is set to every job (and the initial build).
|
||||
build_machine_environment: &build_machine_environment
|
||||
# Specify that we want an actual machine (ala Circle 1.0), not a Docker image.
|
||||
build_machine_environment:
|
||||
&build_machine_environment # Specify that we want an actual machine (ala Circle 1.0), not a Docker image.
|
||||
docker:
|
||||
- image: meteor/circleci:android-30-node-14
|
||||
- image: meteor/circleci:2025.07.8-android-35-node-22
|
||||
resource_class: large
|
||||
environment:
|
||||
# This multiplier scales the waitSecs for selftests.
|
||||
@@ -86,8 +104,8 @@ build_machine_environment: &build_machine_environment
|
||||
|
||||
# These will be evaled before each command.
|
||||
PRE_TEST_COMMANDS: |-
|
||||
ulimit -c unlimited; # Set core dump size as Ubuntu 14.04 lacks prlimit.
|
||||
ulimit -a # Display all ulimit settings for transparency.
|
||||
ulimit -c unlimited; # Set core dump size as Ubuntu 14.04 lacks prlimit.
|
||||
ulimit -a # Display all ulimit settings for transparency.
|
||||
|
||||
# This is only to make Meteor self-test not remind us that we can set
|
||||
# this argument for self-tests.
|
||||
@@ -97,29 +115,8 @@ build_machine_environment: &build_machine_environment
|
||||
NUM_GROUPS: 12
|
||||
RUNNING_AVG_LENGTH: 6
|
||||
|
||||
can_disable_fibers: &can_disable_fibers
|
||||
parameters:
|
||||
fibers:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
set_fibers_env: &set_fibers_env
|
||||
name: "Disable Fibers"
|
||||
command: |
|
||||
if [ "<< parameters.fibers >>" == "false" ]; then
|
||||
echo "Disabling Fibers"
|
||||
echo 'export DISABLE_FIBERS=1' >> "$BASH_ENV"
|
||||
source "$BASH_ENV"
|
||||
fi
|
||||
|
||||
|
||||
# Run tests with Fibers and then without.
|
||||
matrix_for_fibers: &matrix_for_fibers
|
||||
matrix:
|
||||
parameters:
|
||||
# If we want to run with Fibers and without, just append false here.
|
||||
fibers: [true]
|
||||
|
||||
# Force modern bundler test
|
||||
METEOR_MODERN: true
|
||||
|
||||
jobs:
|
||||
Get Ready:
|
||||
@@ -141,8 +138,16 @@ jobs:
|
||||
- run:
|
||||
name: Combine NPM Shrinkwrap Files
|
||||
command: |
|
||||
for d in packages/*/.npm/package; do cat $d/npm-shrinkwrap.json >> shrinkwraps.txt; done
|
||||
for d in packages/*/.npm/plugin/*; do cat $d/npm-shrinkwrap.json >> shrinkwraps.txt; done
|
||||
for d in packages/*/.npm/package; do
|
||||
if [ -f $d/npm-shrinkwrap.json ]; then
|
||||
cat $d/npm-shrinkwrap.json >> shrinkwraps.txt;
|
||||
fi
|
||||
done
|
||||
for d in packages/*/.npm/plugin/*; do
|
||||
if [ -f $d/npm-shrinkwrap.json ]; then
|
||||
cat $d/npm-shrinkwrap.json >> shrinkwraps.txt;
|
||||
fi
|
||||
done
|
||||
- restore_cache:
|
||||
keys:
|
||||
- package-npm-deps-cache-group1-v3-{{ checksum "shrinkwraps.txt" }}
|
||||
@@ -169,15 +174,19 @@ jobs:
|
||||
- run:
|
||||
name: Clear npm cache
|
||||
command: ./meteor npm cache clear --force
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: Get Ready
|
||||
command: |
|
||||
eval $PRE_TEST_COMMANDS;
|
||||
pushd tools
|
||||
npm install @types/node@14.17.6 --save-dev
|
||||
cd dev_bundle/lib
|
||||
../../meteor npm install @types/node@22.7.4 --save-dev
|
||||
# Ensure that meteor/tools has no TypeScript errors.
|
||||
../meteor npx tsc --noEmit --skipLibCheck
|
||||
popd
|
||||
../../meteor npm install -g typescript
|
||||
cd ../../
|
||||
# tools/node_modules is a symlink, but starting on NPM 7, this symlinks are deleted https://github.com/npm/cli/issues/3669
|
||||
# so we are copying the node_modules to tools
|
||||
./meteor --get-ready
|
||||
# shouldn't take longer than 60 minutes
|
||||
no_output_timeout: 60m
|
||||
@@ -192,7 +201,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Isolated Tests:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -201,7 +209,6 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
@@ -214,6 +221,8 @@ jobs:
|
||||
--retries ${METEOR_SELF_TEST_RETRIES} \
|
||||
--headless \
|
||||
no_output_timeout: 20m
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Custom Warehouse Tests)"
|
||||
command: |
|
||||
@@ -236,7 +245,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 0:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -245,10 +253,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 0)"
|
||||
command: |
|
||||
@@ -278,7 +287,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 1:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -287,10 +295,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 1)"
|
||||
command: |
|
||||
@@ -320,7 +329,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 2:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -329,7 +337,8 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
@@ -339,6 +348,9 @@ jobs:
|
||||
if [ -f ./tmp/test-groups/2.txt ]; then TEST_GROUP=$(<./tmp/test-groups/2.txt); elif [ -f ./tmp/test-groups/0.txt ]; then TEST_GROUP=XXXXX; else TEST_GROUP='^co[n-z]'; fi
|
||||
echo $TEST_GROUP;
|
||||
eval $PRE_TEST_COMMANDS;
|
||||
export PATH="/home/circleci/.sdkman/candidates/gradle/8.7/bin:${PATH}"
|
||||
java --version
|
||||
gradle --version
|
||||
./meteor self-test \
|
||||
"$TEST_GROUP" \
|
||||
--retries ${METEOR_SELF_TEST_RETRIES} \
|
||||
@@ -362,7 +374,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 3:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -371,7 +382,8 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
@@ -404,7 +416,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 4:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -413,10 +424,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 4)"
|
||||
command: |
|
||||
@@ -446,7 +458,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 5:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -455,10 +466,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 5)"
|
||||
command: |
|
||||
@@ -488,7 +500,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 6:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -497,10 +508,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 6)"
|
||||
command: |
|
||||
@@ -530,7 +542,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 7:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -539,10 +550,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 7)"
|
||||
command: |
|
||||
@@ -572,7 +584,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 8:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -581,10 +592,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 8)"
|
||||
command: |
|
||||
@@ -614,7 +626,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 9:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -623,10 +634,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 9)"
|
||||
command: |
|
||||
@@ -656,7 +668,6 @@ jobs:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
Test Group 10:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
@@ -665,10 +676,11 @@ jobs:
|
||||
<<: *run_env_change
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run: *set_fibers_env
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 10)"
|
||||
command: |
|
||||
@@ -709,6 +721,8 @@ jobs:
|
||||
- run:
|
||||
name: "Print environment"
|
||||
command: printenv
|
||||
- run:
|
||||
<<: *log_env
|
||||
- run:
|
||||
name: "Running self-test (Test Group 11)"
|
||||
command: |
|
||||
@@ -722,7 +736,7 @@ jobs:
|
||||
--headless \
|
||||
--junit ./tmp/results/junit/11.xml \
|
||||
--without-tag "custom-warehouse"
|
||||
no_output_timeout: 30m
|
||||
no_output_timeout: 35m
|
||||
- run:
|
||||
<<: *run_save_node_bin
|
||||
- store_test_results:
|
||||
@@ -737,47 +751,38 @@ jobs:
|
||||
- store_artifacts:
|
||||
path: /tmp/memuse.txt
|
||||
|
||||
# Test the JSDoc declarations which live within this codebase against the
|
||||
# Meteor Docs (https://github.com/meteor/docs) repository, where they'll
|
||||
# eventually be consumed. This test aims to provide an early warning of
|
||||
# potentially breaking changes, so they aren't discovered when the docs are
|
||||
# next updated, which generally occurs during major Meteor version releases
|
||||
# (for example, 1.4 to 1.5, 1.5 to 1.6).
|
||||
# Test the JSDoc declarations which live within this codebase.
|
||||
# Now the docs live in this repo, we can test them here, every PR is tested.
|
||||
Docs:
|
||||
docker:
|
||||
# This Node version should match that in the meteor/docs CircleCI config.
|
||||
- image: meteor/circleci:android-28-node-12
|
||||
- image: meteor/circleci:2025.07.8-android-35-node-22
|
||||
resource_class: large
|
||||
environment:
|
||||
CHECKOUT_METEOR_DOCS: /home/circleci/test_docs
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- run:
|
||||
name: Cloning "meteor/docs" Repository's "update-to-meteor-1.9" branch
|
||||
name: Cloning "meteor" Repository's current branch
|
||||
command: |
|
||||
git clone --branch update-to-meteor-1.9 https://github.com/meteor/docs.git ${CHECKOUT_METEOR_DOCS}
|
||||
# The "docs" repository normally brings in the Meteor code as a Git
|
||||
# submodule checked out into the "code" directory. As the goal of this
|
||||
# test is to run it against the _current_ repository's code, we'll move
|
||||
# the "code" directory out of the way and move the checkout (of meteor)
|
||||
# into that directory, rather than the default $CIRCLE_WORKING_DIRECTORY.
|
||||
- checkout
|
||||
- run:
|
||||
name: Move Meteor checkout into docs repository's "code" directory
|
||||
command: |
|
||||
rmdir "${CHECKOUT_METEOR_DOCS}/code"
|
||||
# $CIRCLE_WORKING_DIRECTORY uses a tilde, so expand it to $HOME.
|
||||
mv "${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}" \
|
||||
"${CHECKOUT_METEOR_DOCS}/code"
|
||||
if [[ -n "$CIRCLE_PULL_REQUEST" ]]; then
|
||||
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | sed 's|.*/pull/\([0-9]*\)|\1|')
|
||||
PR_BRANCH=$(curl -s https://api.github.com/repos/meteor/meteor/pulls/$PR_NUMBER | jq -r .head.ref)
|
||||
git clone https://github.com/meteor/meteor.git ${CHECKOUT_METEOR_DOCS}
|
||||
cd ${CHECKOUT_METEOR_DOCS}
|
||||
git fetch origin pull/$PR_NUMBER/head:$PR_BRANCH
|
||||
else
|
||||
git clone --branch $CIRCLE_BRANCH https://github.com/meteor/meteor.git ${CHECKOUT_METEOR_DOCS}
|
||||
fi
|
||||
# Run almost the same steps the meteor/docs repository runs, minus deploy.
|
||||
- run:
|
||||
name: Generating Meteor documentation for JSDoc testing
|
||||
command: |
|
||||
cd ${CHECKOUT_METEOR_DOCS}
|
||||
cd ${CHECKOUT_METEOR_DOCS}/docs
|
||||
npm install
|
||||
npm test
|
||||
|
||||
Clean Up:
|
||||
<<: *can_disable_fibers
|
||||
<<: *build_machine_environment
|
||||
steps:
|
||||
- attach_workspace:
|
||||
@@ -860,58 +865,45 @@ workflows:
|
||||
- Docs
|
||||
- Get Ready
|
||||
- Isolated Tests:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 0:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 1:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 2:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 3:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 4:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 5:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 6:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 7:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 8:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 9:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 10:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Get Ready
|
||||
- Test Group 11:
|
||||
requires:
|
||||
- Get Ready
|
||||
- Clean Up:
|
||||
<<: *matrix_for_fibers
|
||||
requires:
|
||||
- Isolated Tests
|
||||
- Test Group 0
|
||||
|
||||
113
.envrc
Normal file
113
.envrc
Normal file
@@ -0,0 +1,113 @@
|
||||
#!/bin/env zsh
|
||||
|
||||
#
|
||||
# Commands and shortcuts for Meteor core development, you can load these in your terminal by running `source .envrc`.
|
||||
# Or by adding `[[ -s .envrc ]] && source .envrc` to your `.zshrc` or `.bashrc`.
|
||||
#
|
||||
|
||||
export ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
|
||||
########
|
||||
# Core #
|
||||
########
|
||||
|
||||
function @meteor {
|
||||
"$ROOT_DIR/meteor" "$@"
|
||||
}
|
||||
|
||||
function @get-ready {
|
||||
@meteor --get-ready
|
||||
}
|
||||
|
||||
function @test-packages {
|
||||
TINYTEST_FILTER="$1" @meteor test-packages --exclude-archs=web.browser.legacy,web.cordova
|
||||
}
|
||||
|
||||
function @test-self {
|
||||
@meteor self-test "$@"
|
||||
}
|
||||
|
||||
function @test-in-console {
|
||||
"$ROOT_DIR/packages/test-in-console/run.sh" "$@"
|
||||
}
|
||||
|
||||
function @check-syntax {
|
||||
node "$ROOT_DIR/scripts/admin/check-legacy-syntax/check-syntax.js"
|
||||
}
|
||||
|
||||
function @generate-dev-bundle {
|
||||
rm -rf $ROOT_DIR/dev_bundle*
|
||||
"$ROOT_DIR/scripts/generate-dev-bundle.sh"
|
||||
}
|
||||
|
||||
function @init-submodule {
|
||||
git submodule update --init --recursive
|
||||
}
|
||||
|
||||
#################
|
||||
# Documentation #
|
||||
#################
|
||||
|
||||
function @docs-start {
|
||||
npm run docs:dev --prefix "$ROOT_DIR/v3-docs/docs"
|
||||
}
|
||||
|
||||
function @docs-migration-start {
|
||||
npm run docs:dev --prefix "$ROOT_DIR/v3-docs/v3-migration-docs"
|
||||
}
|
||||
|
||||
function @get-changes {
|
||||
git diff --numstat HEAD~1 HEAD | awk '($1 + $2) <= 5000 {print $3}'
|
||||
}
|
||||
|
||||
function @summarize-changes {
|
||||
changes=$(@get-changes)
|
||||
|
||||
if [ -n "$changes" ]; then
|
||||
changes=$(git diff HEAD~1 HEAD -- $(echo "$changes" | tr '\n' ' '))
|
||||
else
|
||||
changes=$(git diff HEAD~1 HEAD)
|
||||
fi
|
||||
|
||||
echo "$changes" | llm -s "Summarize the following changes in a few sentences:"
|
||||
}
|
||||
|
||||
function @packages-bumped {
|
||||
git diff --name-only devel...$(git branch --show-current) | grep "packages/.*/package.js$" | while IFS= read -r file; do
|
||||
if ! git show devel:$file > /dev/null 2>&1; then
|
||||
continue
|
||||
fi
|
||||
|
||||
old=$(git show devel:$file | grep -o "version: *['\"][^'\"]*['\"]" | sed "s/version: *.['\"]//;s/['\"].*//")
|
||||
version=$(grep -o "version: *['\"][^'\"]*['\"]" "$file" | sed "s/version: *.['\"]//;s/['\"].*//")
|
||||
name=$(grep -o "name: *['\"][^'\"]*['\"]" "$file" | sed "s/name: *.['\"]//;s/['\"].*//")
|
||||
|
||||
pkg_name=$(echo "$file" | sed -E 's|packages/([^/]*/)?([^/]*)/package\.js|\2|')
|
||||
|
||||
version_in_red=$(tput setaf 1)$version$(tput sgr0)
|
||||
|
||||
if [[ "$version" != "$old" ]]; then
|
||||
echo "- $pkg_name@$version_in_red"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function @packages-bumped-npm {
|
||||
git diff --name-only devel...$(git branch --show-current) | grep "npm-packages/.*/package.json$" | while IFS= read -r file; do
|
||||
if ! git show devel:$file > /dev/null 2>&1; then
|
||||
continue
|
||||
fi
|
||||
|
||||
old=$(git show devel:$file | grep -o "version: *['\"][^'\"]*['\"]" | sed "s/version: *.['\"]//;s/['\"].*//")
|
||||
version=$(grep -o "\"version\": *['\"][^'\"]*['\"]" "$file" | sed "s/\"version\": *.['\"]//;s/['\"].*//")
|
||||
name=$(grep -o "\"name\": *['\"][^'\"]*['\"]" "$file" | sed "s/\"name\": *.['\"]//;s/['\"].*//")
|
||||
|
||||
pkg_name=$(echo "$file" | sed -E 's|npm-packages/([^/]*/)?([^/]*)/package\.json|\2|')
|
||||
|
||||
version_in_red=$(tput setaf 1)$version$(tput sgr0)
|
||||
|
||||
if [[ "$version" != "$old" ]]; then
|
||||
echo "- $pkg_name@$version_in_red"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -2,9 +2,7 @@ android_bundle/
|
||||
dev_bundle/
|
||||
docs/
|
||||
examples/
|
||||
packages/
|
||||
scripts/
|
||||
tools/
|
||||
!tools/*.js
|
||||
!tools/isobuild/*.js
|
||||
!tools/catalog/*.js
|
||||
|
||||
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@henriquealbert @denihs @fredmaiaarantes @nachocodoner @leonardoventurini
|
||||
192
.github/labeler.yml
vendored
192
.github/labeler.yml
vendored
@@ -1,120 +1,178 @@
|
||||
Project:Accounts:Password:
|
||||
- packages/accounts-password/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: packages/accounts-password/**/*
|
||||
|
||||
Project:Accounts:UI:
|
||||
- packages/meteor-developer-config-ui/**/*
|
||||
- packages/github-config-ui/**/*
|
||||
- packages/google-config-ui/**/*
|
||||
- packages/twitter-config-ui/**/*
|
||||
- packages/facebook-config-ui/**/*
|
||||
- packages/accounts-ui/**/*
|
||||
- packages/accounts-ui-unstyled/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/meteor-developer-config-ui/**/*
|
||||
- packages/github-config-ui/**/*
|
||||
- packages/google-config-ui/**/*
|
||||
- packages/twitter-config-ui/**/*
|
||||
- packages/facebook-config-ui/**/*
|
||||
- packages/accounts-ui/**/*
|
||||
- packages/accounts-ui-unstyled/**/*
|
||||
|
||||
Project:CSS:
|
||||
- packages/non-core/less/**/*
|
||||
- packages/minifier-css/**/*
|
||||
- packages/standard-minifier-css/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/non-core/less/**/*
|
||||
- packages/minifier-css/**/*
|
||||
- packages/standard-minifier-css/**/*
|
||||
|
||||
Project:DDP:
|
||||
- packages/ddp-common/**/*
|
||||
- packages/ddp-rate-limiter/**/*
|
||||
- packages/ddp-server/**/*
|
||||
- packages/ddp-client/**/*
|
||||
- packages/ddp/**/*
|
||||
- packages/socket-stream-client/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/ddp-common/**/*
|
||||
- packages/ddp-rate-limiter/**/*
|
||||
- packages/ddp-server/**/*
|
||||
- packages/ddp-client/**/*
|
||||
- packages/ddp/**/*
|
||||
- packages/socket-stream-client/**/*
|
||||
|
||||
Project:EJSON:
|
||||
- packages/ejson/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: packages/ejson/**/*
|
||||
|
||||
Project:HMR:
|
||||
- packages/hot-code-push/**/*
|
||||
- packages/hot-module-replacement/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/hot-code-push/**/*
|
||||
- packages/hot-module-replacement/**/*
|
||||
|
||||
Project:Isobuild:Minifiers:
|
||||
- packages/minifier-css/**/*
|
||||
- packages/minifier-js/**/*
|
||||
- packages/standard-minifier-js/**/*
|
||||
- packages/standard-minifier-css/**/*
|
||||
- packages/standard-minifiers/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/minifier-css/**/*
|
||||
- packages/minifier-js/**/*
|
||||
- packages/standard-minifier-js/**/*
|
||||
- packages/standard-minifier-css/**/*
|
||||
- packages/standard-minifiers/**/*
|
||||
|
||||
Project:Isobuild:
|
||||
- tools/isobuild/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tools/isobuild/**/*
|
||||
|
||||
Project:JS Environment:Typescript:
|
||||
- packages/typescript/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/typescript/**/*
|
||||
|
||||
Project:JS Environment:
|
||||
- packages/babel-compiler/**/*
|
||||
- packages/babel-runtime/**/*
|
||||
- packages/ecmascript/**/*
|
||||
- packages/ecmascript-runtime/**/*
|
||||
- packages/ecmascript-runtime-client/**/*
|
||||
- packages/ecmascript-runtime-server/**/*
|
||||
- packages/es5-shim/**/*
|
||||
- packages/jshint/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/babel-compiler/**/*
|
||||
- packages/babel-runtime/**/*
|
||||
- packages/ecmascript/**/*
|
||||
- packages/ecmascript-runtime/**/*
|
||||
- packages/ecmascript-runtime-client/**/*
|
||||
- packages/ecmascript-runtime-server/**/*
|
||||
- packages/es5-shim/**/*
|
||||
- packages/jshint/**/*
|
||||
|
||||
Project:Livequery:
|
||||
- packages/livedata/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/livedata/**/*
|
||||
|
||||
Project:Minimongo:
|
||||
- packages/minimongo
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/minimongo
|
||||
|
||||
Project:Mobile:
|
||||
- tools/cordova/**/*
|
||||
- packages/launch-screen/**/*
|
||||
- packages/mobile-experience/**/*
|
||||
- packages/mobile-status-bar/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tools/cordova/**/*
|
||||
- packages/launch-screen/**/*
|
||||
- packages/mobile-experience/**/*
|
||||
- packages/mobile-status-bar/**/*
|
||||
|
||||
Project:Mongo Driver:
|
||||
- packages/mongo/**/*
|
||||
- packages/mongo-dev-server/**/*
|
||||
- packages/mongo-id/**/*
|
||||
- packages/mongo-livedata/**/*
|
||||
- packages/disable-oplog/**/*
|
||||
- packages/non-core/mongo-decimal/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/mongo/**/*
|
||||
- packages/mongo-dev-server/**/*
|
||||
- packages/mongo-id/**/*
|
||||
- packages/mongo-livedata/**/*
|
||||
- packages/disable-oplog/**/*
|
||||
- packages/non-core/mongo-decimal/**/*
|
||||
|
||||
Project:NPM:
|
||||
- npm-packages/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- npm-packages/**/*
|
||||
|
||||
Project:Release Process:
|
||||
- scripts/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- scripts/**/*
|
||||
|
||||
Project:Tool:
|
||||
- tools/**/*
|
||||
- packages/meteor-tool/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tools/**/*
|
||||
- packages/meteor-tool/**/*
|
||||
|
||||
Project:Tool:Shell:
|
||||
- tools/console/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tools/console/**/*
|
||||
|
||||
Project:Utilities:Email:
|
||||
- packages/email/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/email/**/*
|
||||
|
||||
Project:Utilities:HTTP:
|
||||
- packages/deprecated/http/**/*
|
||||
- packages/fetch/**/*
|
||||
- packages/url/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/deprecated/http/**/*
|
||||
- packages/fetch/**/*
|
||||
- packages/url/**/*
|
||||
|
||||
Project:Webapp:
|
||||
- packages/webapp/**/*
|
||||
- packages/webapp-hashing/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/webapp/**/*
|
||||
- packages/webapp-hashing/**/*
|
||||
|
||||
Project:Windows:
|
||||
- scripts/windows/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- scripts/windows/**/*
|
||||
|
||||
Project:Webapp:Browser Policy:
|
||||
- packages/browser-policy/**/*
|
||||
- packages/browser-policy-common/**/*
|
||||
- packages/browser-policy-content/**/*
|
||||
- packages/browser-policy-framing/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/browser-policy/**/*
|
||||
- packages/browser-policy-common/**/*
|
||||
- packages/browser-policy-content/**/*
|
||||
- packages/browser-policy-framing/**/*
|
||||
|
||||
Project:Examples:
|
||||
- tools/cli/example-repositories.js
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tools/cli/example-repositories.js
|
||||
|
||||
Project:Dynamic Import:
|
||||
- packages/dynamic-import/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- packages/dynamic-import/**/*
|
||||
|
||||
Project:Docs:
|
||||
- docs/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- docs/**/*
|
||||
- v3-docs/**/*
|
||||
|
||||
Project:Guide:
|
||||
- guide/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- guide/**/*
|
||||
|
||||
github_actions:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- ./github/**/*
|
||||
|
||||
198
.github/scripts/__tests__/inactive-issues.test.js
vendored
Normal file
198
.github/scripts/__tests__/inactive-issues.test.js
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
// Tests for inactive-issues.js using Node's built-in test runner (node:test)
|
||||
// We only care about the last comments (per user instruction), so we don't need pagination logic.
|
||||
|
||||
const { test, beforeEach } = require('node:test');
|
||||
const assert = require('node:assert');
|
||||
const path = require('node:path');
|
||||
|
||||
// Load the script dynamically so we can pass mocks.
|
||||
const scriptPath = path.join(__dirname, '..', 'inactive-issues.js');
|
||||
|
||||
// Helper to advance days
|
||||
const daysAgo = (days) => {
|
||||
const d = new Date();
|
||||
d.setUTCDate(d.getUTCDate() - days);
|
||||
return d.toISOString();
|
||||
};
|
||||
|
||||
// Factory for github REST mock structure
|
||||
function buildGithubMock({ issues, commentsByIssue }) {
|
||||
return {
|
||||
rest: {
|
||||
issues: {
|
||||
listForRepo: async ({ page, per_page }) => {
|
||||
// simple pagination slice
|
||||
const start = (page - 1) * per_page;
|
||||
const end = start + per_page;
|
||||
return { data: issues.slice(start, end) };
|
||||
},
|
||||
listComments: async ({ issue_number }) => {
|
||||
return { data: commentsByIssue[issue_number] || [] };
|
||||
},
|
||||
createComment: async ({ issue_number, body }) => {
|
||||
// push comment to structure to allow assertions on side effects if needed
|
||||
const arr = commentsByIssue[issue_number] || (commentsByIssue[issue_number] = []);
|
||||
arr.push({
|
||||
id: Math.random(),
|
||||
body,
|
||||
created_at: new Date().toISOString(),
|
||||
user: { login: 'github-actions[bot]', type: 'Bot' }
|
||||
});
|
||||
return {};
|
||||
},
|
||||
addLabels: async ({ issue_number, labels }) => {
|
||||
const issue = issues.find(i => i.number === issue_number);
|
||||
if (issue) {
|
||||
(issue.labels || (issue.labels = [])).push(...labels.map(l => ({ name: l })));
|
||||
}
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Wrap script invocation for reuse
|
||||
async function runScript({ issues, commentsByIssue }) {
|
||||
delete require.cache[require.resolve(scriptPath)];
|
||||
const fn = require(scriptPath);
|
||||
const github = buildGithubMock({ issues, commentsByIssue });
|
||||
await fn({ github, context: { repo: { owner: 'meteor', repo: 'meteor' } } });
|
||||
return { issues, commentsByIssue };
|
||||
}
|
||||
|
||||
let baseIssueNumber = 1000;
|
||||
function makeIssue({ daysSinceHumanActivity, isPR = false, labels = [], user = 'user1' }) {
|
||||
// We'll simulate by setting created_at to the human activity date if no comments.
|
||||
const updated_at = daysAgo(daysSinceHumanActivity);
|
||||
return {
|
||||
number: baseIssueNumber++,
|
||||
pull_request: isPR ? {} : undefined,
|
||||
labels: labels.map(n => ({ name: n })),
|
||||
user: { login: user },
|
||||
created_at: daysAgo(daysSinceHumanActivity),
|
||||
updated_at
|
||||
};
|
||||
}
|
||||
|
||||
// TESTS
|
||||
|
||||
beforeEach(() => {
|
||||
baseIssueNumber = 1000;
|
||||
});
|
||||
|
||||
test('60 days inactivity -> adds reminder comment (no prior reminder)', async () => {
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 60 });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = { [issue.number]: [] }; // no comments
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
|
||||
const botComments = commentsByIssue[issue.number].filter(c => c.user.login === 'github-actions[bot]');
|
||||
assert.equal(botComments.length, 1, 'Should have 1 reminder comment');
|
||||
assert.match(botComments[0].body, /60 days/);
|
||||
assert.ok(!issue.labels.some(l => l.name === 'idle'), 'Should not label yet');
|
||||
});
|
||||
|
||||
test('60 days inactivity but already reminded -> no duplicate comment', async () => {
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 65 });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = {
|
||||
[issue.number]: [
|
||||
{
|
||||
id: 1,
|
||||
body: '👋 @user1 This issue has been open with no human activity for 60 days. Is this issue still relevant? If there is no human response or activity within the next 30 days, this issue will be labeled as `idle`.',
|
||||
created_at: daysAgo(5), // 5 days ago bot comment (means last human is 65 days, bot after human)
|
||||
user: { login: 'github-actions[bot]', type: 'Bot' }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
|
||||
const botComments = commentsByIssue[issue.number].filter(c => c.user.login === 'github-actions[bot]');
|
||||
assert.equal(botComments.length, 1, 'Should still have only the existing reminder');
|
||||
});
|
||||
|
||||
test('90 days inactivity -> label + comment', async () => {
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 95 });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = { [issue.number]: [] };
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
|
||||
assert.ok(issue.labels.some(l => l.name === 'idle'), 'Should add idle label');
|
||||
const botComments = commentsByIssue[issue.number].filter(c => c.user.login === 'github-actions[bot]');
|
||||
assert.equal(botComments.length, 1, 'Should comment when labeling');
|
||||
assert.match(botComments[0].body, /90 days/i);
|
||||
});
|
||||
|
||||
test('90 days inactivity but already labeled -> no action', async () => {
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 100, labels: ['idle'] });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = { [issue.number]: [] };
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
|
||||
const botComments = commentsByIssue[issue.number].filter(c => c.user.login === 'github-actions[bot]');
|
||||
assert.equal(botComments.length, 0, 'Should not comment again');
|
||||
});
|
||||
|
||||
test('90 days inactivity but already labeled `in-development` -> no action', async () => {
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 100, labels: ['in-development'] });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = { [issue.number]: [] };
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
|
||||
const botComments = commentsByIssue[issue.number].filter(c => c.user.login === 'github-actions[bot]');
|
||||
assert.equal(botComments.length, 0, 'Should not comment again');
|
||||
});
|
||||
|
||||
|
||||
test('Human reply after reminder resets cycle (no immediate labeling)', async () => {
|
||||
// Scenario: last human activity 10 days ago, bot commented 40 days ago (which was 50 days after original). Should NOT comment again or label.
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 10 });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = {
|
||||
[issue.number]: [
|
||||
{
|
||||
id: 1,
|
||||
body: '👋 @user1 This issue has been open with no human activity for 60 days... ',
|
||||
created_at: daysAgo(50),
|
||||
user: { login: 'github-actions[bot]', type: 'Bot' }
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
body: 'I am still seeing this problem',
|
||||
created_at: daysAgo(10),
|
||||
user: { login: 'some-human', type: 'User' }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
|
||||
const botComments = commentsByIssue[issue.number].filter(c => c.user.login === 'github-actions[bot]');
|
||||
assert.equal(botComments.length, 1, 'Should not add a new bot comment');
|
||||
assert.ok(!issue.labels.some(l => l.name === 'idle'), 'Should not label');
|
||||
});
|
||||
|
||||
test('Only bot comments (no human ever) counts from creation date', async () => {
|
||||
const issue = makeIssue({ daysSinceHumanActivity: 61 });
|
||||
const issues = [issue];
|
||||
const commentsByIssue = {
|
||||
[issue.number]: [
|
||||
{
|
||||
id: 1,
|
||||
body: 'Automated maintenance notice',
|
||||
created_at: daysAgo(30),
|
||||
user: { login: 'github-actions[bot]', type: 'Bot' }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
await runScript({ issues, commentsByIssue });
|
||||
const botComments = commentsByIssue[issue.number].filter(c => /60 days/.test(c.body));
|
||||
assert.equal(botComments.length, 1, 'Should add a 60-day reminder');
|
||||
});
|
||||
200
.github/scripts/inactive-issues.js
vendored
Normal file
200
.github/scripts/inactive-issues.js
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
/**
|
||||
* Mark issues as idle after a period of inactivity
|
||||
* and post reminders after a shorter period of inactivity.
|
||||
*
|
||||
* 1. Issues with no human activity for 60 days get a reminder comment.
|
||||
* 2. Issues with no human activity for 90 days get labeled as "idle" and get a comment.
|
||||
*
|
||||
* Human activity is defined as any comment from a non-bot user.
|
||||
*
|
||||
* This script is intended to be run as a GitHub Action on a schedule (e.g., daily).
|
||||
*/
|
||||
module.exports = async ({ github, context }) => {
|
||||
const daysToComment = 60;
|
||||
const daysToLabel = 90;
|
||||
|
||||
const idleTimeComment = daysToComment * 24 * 60 * 60 * 1000;
|
||||
const idleTimeLabel = daysToLabel * 24 * 60 * 60 * 1000;
|
||||
const now = new Date();
|
||||
|
||||
const BOT_LOGIN = 'github-actions[bot]';
|
||||
const REMINDER_PHRASE = 'Is this issue still relevant?';
|
||||
|
||||
const COMMENT_60_TEMPLATE = (login) =>
|
||||
`👋 @${login} This issue has been open with no human activity for ${daysToComment} days. Is this issue still relevant? If there is no human response or activity within the next ${daysToLabel - daysToComment} days, this issue will be labeled as \`idle\`.`;
|
||||
|
||||
const COMMENT_90_TEXT =
|
||||
'This issue has been automatically labeled as `idle` due to 90 days of inactivity (no human interaction). If this is still relevant or if someone is working on it, please comment or add `in-development` label.';
|
||||
|
||||
// Fetch all open issues
|
||||
async function fetchAllIssues() {
|
||||
let page = 1;
|
||||
const per_page = 100;
|
||||
const results = [];
|
||||
let keepGoing = true;
|
||||
|
||||
while (keepGoing) {
|
||||
const { data } = await github.rest.issues.listForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
per_page,
|
||||
page,
|
||||
sort: 'updated',
|
||||
direction: 'asc'
|
||||
});
|
||||
|
||||
if (!data.length) break;
|
||||
results.push(...data);
|
||||
|
||||
if (data.length < per_page) {
|
||||
keepGoing = false;
|
||||
} else {
|
||||
page++;
|
||||
await new Promise((r) => setTimeout(r, 120));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
// analyse comments to find last human activity and if a reminder was already posted after that
|
||||
async function analyzeComments(issueNumber, issueCreatedAt) {
|
||||
const commentsResp = await github.rest.issues.listComments({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
const comments = commentsResp.data;
|
||||
let lastHumanActivity = null;
|
||||
|
||||
for (let i = comments.length - 1; i >= 0; i--) {
|
||||
const c = comments[i];
|
||||
const isBot = c.user?.type === 'Bot' || c.user?.login === BOT_LOGIN;
|
||||
if (!isBot) {
|
||||
lastHumanActivity = new Date(c.created_at);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!lastHumanActivity) {
|
||||
lastHumanActivity = new Date(issueCreatedAt);
|
||||
}
|
||||
|
||||
const hasReminderAfterLastHuman = comments.some(
|
||||
(c) =>
|
||||
c.user?.login === BOT_LOGIN &&
|
||||
c.body?.includes(REMINDER_PHRASE) &&
|
||||
new Date(c.created_at) > lastHumanActivity
|
||||
);
|
||||
|
||||
return { lastHumanActivity, hasReminderAfterLastHuman };
|
||||
}
|
||||
|
||||
const issues = await fetchAllIssues();
|
||||
|
||||
let processed = 0;
|
||||
let commented = 0;
|
||||
let labeled = 0;
|
||||
let skippedPR = 0;
|
||||
|
||||
for (const issue of issues) {
|
||||
processed++;
|
||||
|
||||
if (issue.pull_request) {
|
||||
skippedPR++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (issue.labels.some((l) => l.name === 'idle' || l.name === 'in-development')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let analysis;
|
||||
try {
|
||||
analysis = await analyzeComments(issue.number, issue.created_at);
|
||||
} catch (err) {
|
||||
continue; // fail to get comments, skip
|
||||
}
|
||||
|
||||
const { lastHumanActivity, hasReminderAfterLastHuman } = analysis;
|
||||
const inactivityMs = now.getTime() - lastHumanActivity.getTime();
|
||||
|
||||
// 90+ days => label + comment
|
||||
if (inactivityMs >= idleTimeLabel) {
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
labels: ['idle']
|
||||
});
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body: COMMENT_90_TEXT
|
||||
});
|
||||
labeled++;
|
||||
continue;
|
||||
} catch (err) {
|
||||
// retry simples
|
||||
try {
|
||||
await new Promise((r) => setTimeout(r, 5000));
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
labels: ['idle']
|
||||
});
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body: COMMENT_90_TEXT
|
||||
});
|
||||
labeled++;
|
||||
} catch {}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 60-89 days => comment (once)
|
||||
if (
|
||||
inactivityMs >= idleTimeComment &&
|
||||
inactivityMs < idleTimeLabel &&
|
||||
!hasReminderAfterLastHuman
|
||||
) {
|
||||
const body = COMMENT_60_TEMPLATE(issue.user.login);
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body
|
||||
});
|
||||
commented++;
|
||||
} catch (err) {
|
||||
try {
|
||||
await new Promise((r) => setTimeout(r, 5000));
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
body
|
||||
});
|
||||
commented++;
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Log summary for CI
|
||||
console.log(
|
||||
JSON.stringify(
|
||||
{ processed, commented, labeled, skippedPR },
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
};
|
||||
4
.github/workflows/check-code-style.yml
vendored
4
.github/workflows/check-code-style.yml
vendored
@@ -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: 22.x
|
||||
- run: npm ci
|
||||
- name: Run ESLint@8
|
||||
run: npx eslint@8 "./npm-packages/meteor-installer/**/*.js"
|
||||
|
||||
7
.github/workflows/check-syntax.yml
vendored
7
.github/workflows/check-syntax.yml
vendored
@@ -1,15 +1,14 @@
|
||||
name: Check legacy syntax
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
jobs:
|
||||
check-code-style:
|
||||
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: 22.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
|
||||
|
||||
4
.github/workflows/docs.yml
vendored
4
.github/workflows/docs.yml
vendored
@@ -11,13 +11,13 @@ 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
|
||||
run: npm ci && npm run build
|
||||
- name: Deploy to Netlify for preview
|
||||
uses: nwtgck/actions-netlify@v1.2.4
|
||||
uses: nwtgck/actions-netlify@v2.1.0
|
||||
with:
|
||||
publish-dir: './docs/public/'
|
||||
production-branch: devel
|
||||
|
||||
6
.github/workflows/guide.yml
vendored
6
.github/workflows/guide.yml
vendored
@@ -11,13 +11,13 @@ jobs:
|
||||
working-directory: guide/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 22.x
|
||||
- name: Build the Guide
|
||||
run: npm ci && npm run build
|
||||
- name: Deploy to Netlify for preview
|
||||
uses: nwtgck/actions-netlify@v1.2.4
|
||||
uses: nwtgck/actions-netlify@v2.1.0
|
||||
with:
|
||||
publish-dir: './guide/public'
|
||||
production-branch: devel
|
||||
|
||||
24
.github/workflows/inactive-issues.yml
vendored
Normal file
24
.github/workflows/inactive-issues.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Inactive Issues Management
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# “At 01:00 on Saturday.”
|
||||
- cron: '0 1 * * 6'
|
||||
# Allows to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
manage-inactive-issues:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Manage inactive issues
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/inactive-issues.js')
|
||||
await script({github, context})
|
||||
2
.github/workflows/labeler.yml
vendored
2
.github/workflows/labeler.yml
vendored
@@ -17,6 +17,6 @@ jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
- uses: actions/labeler@v5
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
@@ -16,15 +16,12 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: npm-packages/eslint-plugin-meteor
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.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 }}
|
||||
node-version: 22.x
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
|
||||
7
.github/workflows/npm-meteor-babel.yml
vendored
7
.github/workflows/npm-meteor-babel.yml
vendored
@@ -16,15 +16,12 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: npm-packages/meteor-babel
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.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 }}
|
||||
node-version: 14.x
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run test
|
||||
|
||||
4
.github/workflows/npm-meteor-promise.yml
vendored
4
.github/workflows/npm-meteor-promise.yml
vendored
@@ -18,11 +18,11 @@ jobs:
|
||||
working-directory: npm-packages/meteor-promise
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x]
|
||||
node-version: [14.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
|
||||
|
||||
46
.github/workflows/run-profiler.yml
vendored
Normal file
46
.github/workflows/run-profiler.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Run Profiler
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
run-profiler:
|
||||
if: github.event.issue.pull_request && contains(github.event.comment.body , '/profile')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout Pull Request
|
||||
run: gh pr checkout ${{ github.event.issue.number }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
|
||||
- name: Set ENVs
|
||||
run: |
|
||||
value="VALUE"
|
||||
echo "Key=$value" >> $GITHUB_ENV
|
||||
|
||||
PR_NUMBER="${{ github.event.issue.number }}"
|
||||
echo "PrNumber=$PR_NUMBER" >> $GITHUB_ENV
|
||||
|
||||
- name: Run CI
|
||||
run: |
|
||||
echo "Running meteor profiler..."
|
||||
echo $PR_NUMBER
|
||||
git status
|
||||
ls
|
||||
|
||||
- name: Comment PR
|
||||
uses: thollander/actions-comment-pull-request@v3
|
||||
with:
|
||||
message: |
|
||||
Hello world !!!! :wave:
|
||||
this is pr number: #${{ env.PrNumber }}
|
||||
testing value: ${{ env.Key }}
|
||||
pr-number: ${{ github.event.issue.number }}
|
||||
52
.github/workflows/test-deprecated-packages.yml
vendored
Normal file
52
.github/workflows/test-deprecated-packages.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Test Deprecated Packages
|
||||
|
||||
# Disabled until we figure out how to fix the error from puppeteer
|
||||
# Runs on Travis CI for now
|
||||
#
|
||||
#on:
|
||||
# push:
|
||||
# branches:
|
||||
# - main
|
||||
# pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: ${{ github.head_ref }}-test-deprecated-packages
|
||||
cancel-in-progress: true
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
PUPPETEER_DOWNLOAD_PATH: /home/runner/.npm/chromium
|
||||
|
||||
steps:
|
||||
- name: Update and install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y libnss3 g++-12
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20.15.1
|
||||
|
||||
- name: Cache Node.js modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
.meteor
|
||||
.babel-cache
|
||||
dev_bundle
|
||||
/home/runner/.npm/chromium
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('meteor', '**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run tests
|
||||
run: ./packages/test-in-console/run.sh
|
||||
81
.github/workflows/windows-selftest.yml
vendored
Normal file
81
.github/workflows/windows-selftest.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Windows Selftest
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
paths:
|
||||
- 'meteor'
|
||||
- 'meteor.bat'
|
||||
- 'tools/**'
|
||||
- 'packages/babel-compiler/**'
|
||||
- 'packages/dynamic-import/**'
|
||||
- 'packages/meteor/**'
|
||||
- 'packages/meteor-tool/**'
|
||||
- '.github/workflows/windows-selftest.yml'
|
||||
|
||||
push:
|
||||
branches:
|
||||
- devel
|
||||
|
||||
env:
|
||||
METEOR_PRETTY_OUTPUT: 0
|
||||
SELF_TEST_TOOL_NODE_FLAGS: ' '
|
||||
TOOL_NODE_FLAGS: --expose-gc
|
||||
TIMEOUT_SCALE_FACTOR: 20
|
||||
METEOR_HEADLESS: true
|
||||
SELF_TEST_EXCLUDE: '^NULL-LEAVE-THIS-HERE-NULL$'
|
||||
METEOR_MODERN: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-2019-meteor
|
||||
concurrency:
|
||||
group: ${{ github.head_ref }}-meteor-selftest-windows
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 22.x
|
||||
|
||||
- name: Cache dependencies
|
||||
id: meteor-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
dev_bundle/
|
||||
.babel-cache/
|
||||
.meteor/
|
||||
~/.npm
|
||||
node_modules/
|
||||
packages/**/.npm
|
||||
key: ${{ runner.os }}-meteor-${{ hashFiles('**/package-lock.json', 'meteor', 'meteor.bat') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-meteor-
|
||||
|
||||
- name: Install dependencies
|
||||
shell: pwsh
|
||||
run: |
|
||||
$env:PATH = "C:\Program Files\7-Zip;$env:PATH"
|
||||
.\scripts\windows\ci\install.ps1
|
||||
|
||||
# Run ONLY when the cache was NOT restored
|
||||
- name: Prepare Meteor (cache miss)
|
||||
if: steps.meteor-cache.outputs.cache-hit != 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$env:PATH = "C:\Program Files\7-Zip;$env:PATH"
|
||||
.\meteor.bat --get-ready
|
||||
|
||||
- name: Run tests
|
||||
shell: pwsh
|
||||
run: |
|
||||
$env:PATH = "C:\Program Files\7-Zip;$env:PATH"
|
||||
.\scripts\windows\ci\test.ps1
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -29,3 +29,13 @@ mongo-test-output
|
||||
|
||||
# core packages shouldn't have .versions files
|
||||
packages/*/.versions
|
||||
|
||||
# packages shouldn't have .npm on Git
|
||||
packages/**/.npm
|
||||
|
||||
# doc files should not be committed
|
||||
packages/**/*.docs.js
|
||||
|
||||
#cursor
|
||||
.cursorignore
|
||||
.cursorrules
|
||||
|
||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,3 +1,7 @@
|
||||
[submodule "packages/non-core/blaze"]
|
||||
path = packages/non-core/blaze
|
||||
url = https://github.com/meteor/blaze.git
|
||||
url = https://github.com/meteor/blaze.git
|
||||
[submodule "npm-packages/cordova-plugin-meteor-webapp/src/ios/GCDWebServer"]
|
||||
path = npm-packages/cordova-plugin-meteor-webapp/src/ios/GCDWebServer
|
||||
url = https://github.com/meteor/GCDWebServer.git
|
||||
branch = master
|
||||
|
||||
25
.travis.yml
25
.travis.yml
@@ -1,8 +1,10 @@
|
||||
language: node_js
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: jammy
|
||||
sudo: required
|
||||
services: xvfb
|
||||
node_js:
|
||||
- "14.17.6"
|
||||
- "22.17.0"
|
||||
cache:
|
||||
directories:
|
||||
- ".meteor"
|
||||
@@ -11,17 +13,22 @@ script:
|
||||
- travis_retry ./packages/test-in-console/run.sh
|
||||
env:
|
||||
global:
|
||||
- CXX=g++-4.8
|
||||
- CXX=g++-12
|
||||
- phantom=false
|
||||
- PUPPETEER_DOWNLOAD_PATH=~/.npm/chromium
|
||||
jobs:
|
||||
# We don't want to run the tests without fibers anymore.
|
||||
# - DISABLE_FIBERS=1
|
||||
# Use a different flag, since node would use false as a string.
|
||||
- FIBERS_ENABLED=1
|
||||
- TEST_PACKAGES_EXCLUDE=stylus
|
||||
- METEOR_MODERN=true
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
- g++-12
|
||||
- libnss3
|
||||
|
||||
before_install:
|
||||
- cat /etc/apt/sources.list
|
||||
- python3 --version
|
||||
- echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" | sudo tee -a /etc/apt/sources.list
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install -y libnss3
|
||||
|
||||
@@ -8,18 +8,18 @@ All recipients of reports commit to maintain the confidentiality with regard to
|
||||
|
||||
## Report an issue
|
||||
|
||||
To report an issue in one of the projects listed below, please send an email to code-of-conduct@meteor.com.
|
||||
To report an issue in one of the projects listed below, please email code-of-conduct@meteor.com.
|
||||
|
||||
* [OSS Meteor Projects](https://github.com/meteor)
|
||||
* [Meteor Forum](https://forums.meteor.com/)
|
||||
* [Meteor Lounge on Discord](https://discord.gg/hZkTCaVjmT)
|
||||
|
||||
## Code of Conduct panel
|
||||
|
||||
The Code of Conduct panel is a moderation team that handle code of conduct issues. The makeup of this team is as follows:
|
||||
|
||||
* CEO at Meteor Software - Frederico Maia Arantes
|
||||
* DevRel Manager at Meteor Software - Tatiana Barros
|
||||
* Software Engineer at Meteor Software - Denilson Silva
|
||||
* CTO at Meteor Software - Henrique Albert
|
||||
* CEO at High Impact Tech - Alim S. Gafar
|
||||
|
||||
Members of the CoCP team will be added for a 1-year term and will be re-confirmed on a yearly basis.
|
||||
|
||||
@@ -21,7 +21,7 @@ There are many ways to contribute to the Meteor Project. Here’s a list of tech
|
||||
|
||||
There are also several ways to contribute to the Meteor Project outside of GitHub, like organizing or speaking at [Meetups](https://forums.meteor.com/c/meetups) and events and helping to moderate our [forums](https://forums.meteor.com/).
|
||||
|
||||
If you can think of any changes to the project, [documentation](https://github.com/meteor/meteor/tree/devel/docs), or [guide](https://github.com/meteor/meteor/tree/devel/guide) that would improve the contributor experience, let us know by opening an issue!
|
||||
If you can think of any changes to the project, [documentation](https://github.com/meteor/meteor/tree/devel/v3-docs), or [guide](https://github.com/meteor/meteor/tree/devel/guide) that would improve the contributor experience, let us know by opening an issue!
|
||||
|
||||
### Finding work
|
||||
|
||||
@@ -43,15 +43,14 @@ Reviewers are members of the community who help with Pull Requests reviews.
|
||||
|
||||
Current Reviewers:
|
||||
- [meteor](https://github.com/meteor/meteor)
|
||||
- [@denihs](https://github.com/denihs)
|
||||
- [@fredmaiaarantes](https://github.com/fredmaiaarantes)
|
||||
- [@henriquealbert](https://github.com/henriquealbert)
|
||||
- [@aquinoit](https://github.com/aquinoit)
|
||||
- [@Grubba27](https://github.com/Grubba27)
|
||||
- [@filipenevola](https://github.com/filipenevola)
|
||||
- [@italojs](https://github.com/italojs)
|
||||
- [@nachocodoner](https://github.com/nachocodoner)
|
||||
- [@StorytellerCZ](https://github.com/StorytellerCZ)
|
||||
- [@zodern](https://github.com/zodern)
|
||||
- [@CaptainN](https://github.com/CaptainN)
|
||||
- [@radekmie](https://github.com/radekmie)
|
||||
|
||||
#### Core Committer
|
||||
@@ -59,20 +58,19 @@ Current Reviewers:
|
||||
The contributors with commit access to meteor/meteor are employees of Meteor Software LP or community members who have distinguished themselves in other contribution areas or members of partner companies. If you want to become a core committer, please start writing PRs.
|
||||
|
||||
Current Core Team:
|
||||
- [@denihs](https://github.com/denihs)
|
||||
- [@zodern](https://github.com/zodern)
|
||||
- [@filipenevola](https://github.com/filipenevola)
|
||||
- [@fredmaiaarantes](https://github.com/fredmaiaarantes)
|
||||
- [@henriquealbert](https://github.com/henriquealbert)
|
||||
- [@Grubba27](https://github.com/Grubba27)
|
||||
- [meteor](https://github.com/meteor/meteor)
|
||||
- [@fredmaiaarantes](https://github.com/fredmaiaarantes)
|
||||
- [@henriquealbert](https://github.com/henriquealbert)
|
||||
- [@Grubba27](https://github.com/Grubba27)
|
||||
- [@italojs](https://github.com/italojs)
|
||||
- [@nachocodoner](https://github.com/nachocodoner)
|
||||
- [@StorytellerCZ](https://github.com/StorytellerCZ)
|
||||
- [@CaptainN](https://github.com/CaptainN)
|
||||
- [@zodern](https://github.com/zodern)
|
||||
- [@radekmie](https://github.com/radekmie)
|
||||
- [@matheusccastroo](https://github.com/matheusccastroo)
|
||||
|
||||
### Tracking project work
|
||||
|
||||
Right now, the best place to track the work being done on Meteor is to take a look at the latest release milestone [here](https://github.com/meteor/meteor/milestones). Also, the [Meteor Roadmap](https://docs.meteor.com/roadmap.html) contains high-level information on the current priorities of the project.
|
||||
Right now, the best place to track the work being done on Meteor is to take a look at the latest release milestone [here](https://github.com/meteor/meteor/milestones). Also, the [Meteor Roadmap](https://docs.meteor.com/about/roadmap.html) contains high-level information on the current priorities of the project.
|
||||
|
||||
## Reporting a bug in Meteor
|
||||
<a name="reporting-bug"></a>
|
||||
@@ -134,7 +132,7 @@ for more details on proposing changes to core code.
|
||||
Feature requests are tracked in the [Discussions](https://github.com/meteor/meteor/discussions).
|
||||
|
||||
Meteor is a big project with [many sub-projects](https://github.com/meteor/meteor/tree/devel/packages).
|
||||
Community is welcome to help in all the sub-projects. We use our [roadmap](https://docs.meteor.com/roadmap.html) to communicate the high-level features we're currently prioritizing.
|
||||
Community is welcome to help in all the sub-projects. We use our [roadmap](https://docs.meteor.com/about/roadmap.html) to communicate the high-level features we're currently prioritizing.
|
||||
|
||||
Every additional feature adds a maintenance cost in addition to its value. This
|
||||
cost starts with the work of writing the feature or reviewing a community pull
|
||||
@@ -157,7 +155,7 @@ Learn how we use GitHub labels [here](LABELS.md)
|
||||
|
||||
## Documentation
|
||||
|
||||
If you'd like to contribute to Meteor's documentation, head over to https://docs.meteor.com or https://guide.meteor.com and if you find something that could be better click in "Edit on GitHub" footer to edit and submit a PR.
|
||||
If you'd like to contribute to Meteor's documentation, head over to https://docs.meteor.com/about/contributing.html for guidelines.
|
||||
|
||||
## Blaze
|
||||
|
||||
@@ -207,7 +205,7 @@ For more information about how to work with Meteor core, take a look at the [Dev
|
||||
|
||||
### Proposing your change
|
||||
|
||||
You'll have the best chance of getting a change into core if you can build consensus in the community for it or if it is listed in the [roadmap](https://docs.meteor.com/roadmap.html). Start by creating a well specified Discussion [here](https://github.com/meteor/meteor/discussions).
|
||||
You'll have the best chance of getting a change into core if you can build consensus in the community for it or if it is listed in the [roadmap](https://docs.meteor.com/about/roadmap.html). Start by creating a well specified Discussion [here](https://github.com/meteor/meteor/discussions).
|
||||
|
||||
Help drive discussion and advocate for your feature on the Github ticket (and perhaps the forums). The higher the demand for the feature and the greater the clarity of it's specification will determine the likelihood of a core contributor prioritizing your feature by flagging it with the `ready` label.
|
||||
|
||||
|
||||
@@ -43,13 +43,19 @@ can run Meteor directly from a Git checkout using these steps:
|
||||
$ /path/to/meteor-checkout/meteor run
|
||||
```
|
||||
|
||||
> _Tip:_ Consider making an easy-to-run alias for frequent use:
|
||||
> _Tip 1:_ Consider making an easy-to-run alias for frequent use:
|
||||
>
|
||||
> alias mymeteor=/path/to-meteor-checkout/meteor
|
||||
>
|
||||
> This allows the use of `mymeteor` in place of `meteor`. To persist this
|
||||
> across shell logouts, simply add it to `~/.bashrc` or `.zshrc`.
|
||||
|
||||
> _Tip 2:_ When working with meteor tool, it may be helpful to use the debugger to check what's happening. You can do this using the following flag:
|
||||
>
|
||||
> TOOL_NODE_FLAGS="--inspect-brk" mymeteor
|
||||
>
|
||||
> Then you can use the chrome debugger inside `chrome://inspect`.
|
||||
|
||||
### Notes when running from a checkout
|
||||
|
||||
The following are some distinct differences you must pay attention to when running Meteor from a checkout:
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
This content was moved to [history.md](./docs/history.md).
|
||||
|
||||
Previously the changelog was available to be edited here but it was always published in [https://docs.meteor.com/changelog.html](https://docs.meteor.com/changelog.html).
|
||||
Previously the changelog was available to be edited here but it was always published in [https://docs.meteor.com/history.html](https://docs.meteor.com/history.html).
|
||||
|
||||
37
README.md
37
README.md
@@ -1,16 +1,21 @@
|
||||
<div align="center">
|
||||
<a href="https://www.meteor.com" target="_blank">
|
||||
<img align="center" width="225" src="https://user-images.githubusercontent.com/841294/26841702-0902bbee-4af3-11e7-9805-0618da66a246.png">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://dmtgy0px4zdqn.cloudfront.net/images/meteor-logo.webp">
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/0467afb6-4f36-4cad-9d78-237150d5d881">
|
||||
<img alt="Meteor logo" src="https://github.com/user-attachments/assets/0467afb6-4f36-4cad-9d78-237150d5d881" width="300">
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](https://app.travis-ci.com/github/meteor/meteor)
|
||||
[](https://app.circleci.com/pipelines/github/meteor/meteor?branch=devel)
|
||||
[](https://meteor.com)
|
||||
[](https://meteor.com)
|
||||

|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
@@ -21,7 +26,7 @@ Meteor is an **ultra-simple** environment for building **modern** web applicatio
|
||||
<hr>
|
||||
|
||||
- [Official Website](https://www.meteor.com)
|
||||
- [Installation](https://www.meteor.com/developers/install)
|
||||
- [Installation](https://docs.meteor.com/about/install.html)
|
||||
- [Documentation](https://docs.meteor.com/#/full/)
|
||||
|
||||
<hr>
|
||||
@@ -46,28 +51,25 @@ Use the same code whether you’re developing for web, iOS, Android, or desktop
|
||||
|
||||
# 🔥 Getting Started
|
||||
|
||||
How about trying a getting started tutorial in your favorite technology?
|
||||
How about trying a tutorial to get started with your favorite technology?
|
||||
|
||||
| [<img align="left" width="25" src="https://upload.wikimedia.org/wikipedia/commons/a/a7/React-icon.svg"> React](https://react-tutorial.meteor.com/) |
|
||||
| [<img align="left" width="25" src="https://upload.wikimedia.org/wikipedia/commons/a/a7/React-icon.svg"> React](https://docs.meteor.com/tutorials/react/) |
|
||||
| - |
|
||||
| [<img align="left" width="25" src="https://progsoft.net/images/blaze-css-icon-3e80acb3996047afd09f1150f53fcd78e98c1e1b.png"> Blaze](https://blaze-tutorial.meteor.com/) |
|
||||
| [<img align="left" width="25" src="https://vuejs.org/images/logo.png"> Vue](https://vue-tutorial.meteor.com/) |
|
||||
| [<img align="left" width="25" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Svelte_Logo.svg/1200px-Svelte_Logo.svg.png"> Svelte](https://svelte-tutorial.meteor.com/) |
|
||||
|
||||
Next, read the [documentation](https://docs.meteor.com/) and get some [examples](https://github.com/meteor/examples).
|
||||
| [<img align="left" width="25" src="https://vuejs.org/images/logo.png"> Vue](https://docs.meteor.com/tutorials/vue/meteorjs3-vue3-vue-meteor-tracker.html) |
|
||||
|
||||
# 🚀 Quick Start
|
||||
|
||||
On your platform, use this line:
|
||||
|
||||
```shell
|
||||
> npm install -g meteor
|
||||
> npx meteor
|
||||
```
|
||||
|
||||
🚀 To create a project:
|
||||
|
||||
```shell
|
||||
> meteor create my-app
|
||||
> meteor create
|
||||
```
|
||||
|
||||
☄️ Run it:
|
||||
@@ -81,10 +83,9 @@ meteor
|
||||
|
||||
**Building an application with Meteor?**
|
||||
|
||||
* Deploy on [Meteor Cloud](https://www.meteor.com/cloud)
|
||||
* Discussion [Forums](https://forums.meteor.com/)
|
||||
* Join the Meteor community Slack by clicking this [invite link](https://join.slack.com/t/meteor-community/shared_invite/enQtODA0NTU2Nzk5MTA3LWY5NGMxMWRjZDgzYWMyMTEyYTQ3MTcwZmU2YjM5MTY3MjJkZjQ0NWRjOGZlYmIxZjFlYTA5Mjg4OTk3ODRiOTc).
|
||||
* Announcement list. Subscribe in the [footer](https://www.meteor.com/).
|
||||
* Deploy on [Galaxy](https://galaxycloud.app)
|
||||
* Discuss on [Forums](https://forums.meteor.com/)
|
||||
* Join the [Meteor Discord](https://discord.gg/hZkTCaVjmT)
|
||||
|
||||
|
||||
Interested in helping or contributing to Meteor? These resources will help:
|
||||
@@ -93,5 +94,3 @@ Interested in helping or contributing to Meteor? These resources will help:
|
||||
* [Contribution guidelines](CONTRIBUTING.md)
|
||||
* [Feature requests](https://github.com/meteor/meteor/discussions/)
|
||||
* [Issue tracker](https://github.com/meteor/meteor/issues)
|
||||
|
||||
To uninstall Meteor [read here](https://docs.meteor.com/install.html#uninstall).
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
| Version | Support Status
|
||||
| ------- | --------------
|
||||
| 2.x.y | ✅ all security issues
|
||||
| 1.12.x | 🚧 only critical security issues
|
||||
| <= 1.11.x | ❌ no longer supportted
|
||||
| 3.x.y | ✅ all security issues
|
||||
| 2.x.y | ⚠️ only major security issues (Until 2025-07)
|
||||
| <= 1.12.x | ❌ no longer supported
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
||||
47
appveyor.yml
47
appveyor.yml
@@ -1,47 +0,0 @@
|
||||
version: '{build}'
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /^dev-bundle-/
|
||||
|
||||
skip_branch_with_pr: true
|
||||
|
||||
clone_folder: C:\projects\meteor
|
||||
image: Visual Studio 2019
|
||||
|
||||
environment:
|
||||
METEOR_PRETTY_OUTPUT: 0
|
||||
SELF_TEST_TOOL_NODE_FLAGS: " "
|
||||
TOOL_NODE_FLAGS: --expose-gc
|
||||
TIMEOUT_SCALE_FACTOR: 8
|
||||
METEOR_HEADLESS: true
|
||||
SELF_TEST_EXCLUDE: "^NULL-LEAVE-THIS-HERE-NULL$"
|
||||
platform:
|
||||
- x64
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- platform: x64
|
||||
|
||||
# We don't need the actual "build", just the tests.
|
||||
build: off
|
||||
|
||||
install:
|
||||
- ps: C:\projects\meteor\scripts\windows\appveyor\install.ps1
|
||||
|
||||
test_script:
|
||||
- ps: C:\projects\meteor\scripts\windows\appveyor\test.ps1
|
||||
|
||||
on_failure:
|
||||
- ps: |
|
||||
$npmLogsDir = "$($Env:AppData)\npm-cache\_logs"
|
||||
If (Test-Path "$npmLogsDir") {
|
||||
Get-ChildItem "${npmLogsDir}\*.log" |
|
||||
% { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||
}
|
||||
|
||||
cache:
|
||||
- dev_bundle -> meteor
|
||||
- .babel-cache -> meteor
|
||||
- .meteor
|
||||
@@ -1,6 +1,8 @@
|
||||
title: Meteor API Docs
|
||||
subtitle: API Docs
|
||||
versions:
|
||||
- '2.16'
|
||||
- '2.14'
|
||||
- '2.13'
|
||||
- '2.12'
|
||||
- '2.11'
|
||||
@@ -62,6 +64,7 @@ sidebar_categories:
|
||||
- api/packagejs
|
||||
- api/mobile-config
|
||||
- api/environment
|
||||
- api/top-level-await
|
||||
Packages:
|
||||
- packages/accounts-ui
|
||||
- packages/accounts-passwordless
|
||||
@@ -85,9 +88,9 @@ sidebar_categories:
|
||||
- packages/server-render
|
||||
- packages/spacebars
|
||||
- packages/standard-minifier-css
|
||||
- packages/underscore
|
||||
- packages/url
|
||||
- packages/webapp
|
||||
- packages/packages-listing
|
||||
Command Line:
|
||||
- commandline
|
||||
- environment-variables
|
||||
@@ -210,6 +213,7 @@ redirects:
|
||||
/#/full/accounts-setusername: 'api/passwords.html#accounts-setusername'
|
||||
/#/full/accounts-addemail: 'api/passwords.html#accounts-addemail'
|
||||
/#/full/accounts-removeemail: 'api/passwords.html#accounts-removeemail'
|
||||
/#/full/accounts_replaceemail: 'api/passwords.html#Accounts-replaceEmail'
|
||||
/#/full/accounts_verifyemail: 'api/passwords.html#Accounts-verifyEmail'
|
||||
/#/full/accounts-finduserbyusername: 'api/passwords.html#accounts-finduserbyusername'
|
||||
/#/full/accounts-finduserbyemail: 'api/passwords.html#accounts-finduserbyemail'
|
||||
@@ -389,7 +393,6 @@ redirects:
|
||||
/#/full/oauth-encryption: 'packages/oauth-encryption.html'
|
||||
/#/full/random: 'packages/random.html'
|
||||
/#/full/spiderable: 'packages/spiderable.html'
|
||||
/#/full/underscore: 'packages/underscore.html'
|
||||
/#/full/webapp: 'packages/webapp.html'
|
||||
'#meteor_isclient': 'api/core.html#Meteor-isClient'
|
||||
'#meteor_isserver': 'api/core.html#Meteor-isServer'
|
||||
@@ -665,6 +668,5 @@ redirects:
|
||||
'#oauth-encryption': 'packages/oauth-encryption.html'
|
||||
'#random': 'packages/random.html'
|
||||
'#spiderable': 'packages/spiderable.html'
|
||||
'#underscore': 'packages/underscore.html'
|
||||
'#webapp': 'packages/webapp.html'
|
||||
'#pkg_spacebars': 'packages/spacebars.html'
|
||||
|
||||
@@ -1,36 +1,50 @@
|
||||
## vX.XX.X, 2023-XX-XX
|
||||
|
||||
### Highlights
|
||||
|
||||
## Highlights
|
||||
List the most important changes to catch people's attention.
|
||||
Are there breaking changes? Mention it here and link them.
|
||||
Are there exciting new features? Mention it here and link them.
|
||||
For example:
|
||||
* MongoDB Server 6.x Support
|
||||
* Embedded Mongo now uses MongoDB 6.0.3
|
||||
* Some pr [GH someone] [PR #number] // this will become -> [someone](https://github.com/someone) [PR](https://github.com/meteor/meteor/pull/number)
|
||||
#### Breaking Changes
|
||||
|
||||
N/A
|
||||
|
||||
#### Internal API changes
|
||||
|
||||
N/A
|
||||
|
||||
#### Migration Steps
|
||||
|
||||
TODO
|
||||
|
||||
#### Meteor Version Release
|
||||
|
||||
|
||||
* `Command line`:
|
||||
- Corrected typo in XX XX
|
||||
## Migration Steps
|
||||
Steps to migrate to this version. If it's a long one, we should have a migration guide page.
|
||||
|
||||
* `npm mongo @4.13.0`: // You can use @get-version to get the version of the package
|
||||
## New Features
|
||||
- Feature 1 description. PR Link.
|
||||
- Feature 2 description. PR Link.
|
||||
- Some feature. pr [GH someone] [PR #number] // this will become -> [someone](https://github.com/someone) [PR](https://github.com/meteor/meteor/pull/number)
|
||||
- `Command line`:
|
||||
- Added feature X
|
||||
## Patch changes
|
||||
- Patch Change 1 description. PR Link.
|
||||
- Patch Change 2 description. PR Link.
|
||||
- `npm mongo @4.13.0`: // You can use @get-version to get the version of the package
|
||||
- Updated MongoDB driver to version 4.13.0
|
||||
|
||||
#### Special thanks to
|
||||
## Breaking Changes
|
||||
- Breaking change 1.
|
||||
- Breaking change 1.
|
||||
|
||||
* `fetch@get-version`:
|
||||
- X has changed
|
||||
|
||||
## Docs
|
||||
- Docs change 1.
|
||||
- Docs change 2.
|
||||
|
||||
## Core dependencies
|
||||
Core dependency change 1.
|
||||
Core dependency change 2.
|
||||
|
||||
## Dependencies
|
||||
Dependency change 1.
|
||||
Dependency change 2.
|
||||
|
||||
## Contributors
|
||||
- Contributor 1.
|
||||
- [@XXX](https://github.com/XXXX).
|
||||
|
||||
|
||||
For making this great framework even better!
|
||||
|
||||
|
||||
|
||||
@@ -12,18 +12,37 @@ To get which branches were merged into release you can search in the GitHub
|
||||
repo by using this query:
|
||||
|
||||
```
|
||||
is:pr base:<release-branch-name> is:merged
|
||||
is:pr base:<release-branch-name> is:merged
|
||||
```
|
||||
|
||||
or in GH Cli:
|
||||
|
||||
```bash
|
||||
gh pr list --state merged --base <release-branch-name>
|
||||
```
|
||||
|
||||
note that it may not be as useful as the first one, since it will not show the
|
||||
Authors and other related information.
|
||||
|
||||
## Why?
|
||||
|
||||
Computers with lower memory/ IDEs with high memory usage can have problems with
|
||||
the changelog file(~10k lines). This is a way to reduce the memory usage of the changelog, also creating a more
|
||||
organized changelog, since all the files will be reflecting at least one version.
|
||||
|
||||
## Update ordering.
|
||||
|
||||
If you want to make sure that the changelog is correcly ordered, take a look at the `order-packages.js` file.
|
||||
to use it, run the command below:
|
||||
|
||||
```bash
|
||||
node order-packages.js versions/3.0.md
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
node order-packages.js versions/<your-version>.md
|
||||
```
|
||||
|
||||
it will update the file with the correct ordering(this will override the file).
|
||||
81
docs/generators/changelog/order-packages.js
Normal file
81
docs/generators/changelog/order-packages.js
Normal file
@@ -0,0 +1,81 @@
|
||||
const fs = require("fs").promises;
|
||||
|
||||
// we want to get the strings that are between #### Breaking Changes and #### New Public API
|
||||
// then we will create a map with the package name and the version for example:
|
||||
//
|
||||
// - `accounts-2fa@3.0.0`:
|
||||
|
||||
// - Some methods are now async. See below:
|
||||
// - `Accounts._is2faEnabledForUser`
|
||||
// - `(Meteor Method) - generate2faActivationQrCode`
|
||||
// - `(Meteor Method) - enableUser2fa`
|
||||
// - `(Meteor Method) - disableUser2fa`
|
||||
// - `(Meteor Method) - has2faEnabled`
|
||||
|
||||
// will be converted to:
|
||||
// {"accounts-2fa@3.0.0": ` - Some methods are now async. See below:
|
||||
// - `Accounts._is2faEnabledForUser`
|
||||
// - `(Meteor Method) - generate2faActivationQrCode`
|
||||
// - `(Meteor Method) - enableUser2fa`
|
||||
// - `(Meteor Method) - disableUser2fa`
|
||||
// - `(Meteor Method) - has2faEnabled``
|
||||
// }
|
||||
|
||||
// then we will iterate and order the packages in alphabetical order and write again to the file.
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} path
|
||||
* @returns {Promise<[string, null] | ["", Error]>}
|
||||
*/
|
||||
async function getFile(path) {
|
||||
try {
|
||||
const data = await fs.readFile(path, "utf8");
|
||||
return [data, null];
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return ["", new Error("could not read file")];
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const [filePath] = process.argv.slice(2);
|
||||
const [code, error] = await getFile(filePath);
|
||||
if (error) throw error;
|
||||
|
||||
const regex = /#### Breaking Changes([\s\S]*?)#### New Public API/gm;
|
||||
const matches = code.match(regex).join("\n").split("\n");
|
||||
|
||||
let objectMap = {};
|
||||
let currentWorkingPackage = "";
|
||||
for (const line of matches) {
|
||||
if (line.startsWith("-")) {
|
||||
const packageName = line
|
||||
.replace("-", "")
|
||||
.replace("`:", "")
|
||||
.replace("`", "")
|
||||
.trim();
|
||||
objectMap[packageName] = "";
|
||||
currentWorkingPackage = packageName;
|
||||
continue;
|
||||
}
|
||||
objectMap[currentWorkingPackage] += line + "\n";
|
||||
}
|
||||
// sorting acc
|
||||
const result = Object.keys(objectMap)
|
||||
.reduce((acc, key) => {
|
||||
if (key === "") return acc;
|
||||
acc.push({ key, value: objectMap[key]});
|
||||
return acc;
|
||||
}, [])
|
||||
.sort((a, b) => a.key.localeCompare(b.key))
|
||||
.reduce((acc, { key, value }) => {
|
||||
return acc + `- \`${key}\`:\n${value}`;
|
||||
}, "")
|
||||
|
||||
const newCode = code.replace(regex, `#### Breaking Changes\n\n${result}`);
|
||||
|
||||
await fs.writeFile(filePath, newCode);
|
||||
}
|
||||
|
||||
main().then(() => console.log("done"));
|
||||
@@ -1,56 +1,49 @@
|
||||
const _fs = require('fs');
|
||||
const _fs = require("fs");
|
||||
const fs = _fs.promises;
|
||||
|
||||
function getPackageVersion(packageName) {
|
||||
function getFile(path) {
|
||||
try {
|
||||
const data = _fs.readFileSync(path, 'utf8');
|
||||
const data = _fs.readFileSync(path, "utf8");
|
||||
return [data, null];
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return ['', e];
|
||||
return ["", e];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const [code, error] = getFile(`../packages/${ packageName }/package.js`);
|
||||
if (error) return 'ERR_NO_VERSION';
|
||||
const [code, error] = getFile(`../packages/${packageName}/package.js`);
|
||||
if (error) return "";
|
||||
for (const line of code.split(/\n/)) {
|
||||
// verify if the line has a version
|
||||
if (!line.includes('version:')) continue;
|
||||
if (!line.includes("version:")) continue;
|
||||
|
||||
//Package.describe({
|
||||
// summary: 'some description.',
|
||||
// version: '1.2.3' <--- this is the line we want, we assure that it has a version in the previous if
|
||||
//});
|
||||
const [_, versionValue] = line.split(':');
|
||||
const [_, versionValue] = line.split(":");
|
||||
if (!versionValue) continue;
|
||||
const removeQuotes =
|
||||
(v) =>
|
||||
v
|
||||
.trim()
|
||||
.replace(',', '')
|
||||
.replace(/'/g, '')
|
||||
.replace(/"/g, '');
|
||||
|
||||
if (versionValue.includes('-')) return removeQuotes(versionValue.split('-')[0]);
|
||||
const removeQuotes = (v) =>
|
||||
v.trim().replace(",", "").replace(/'/g, "").replace(/"/g, "");
|
||||
if (versionValue.includes("-"))
|
||||
return removeQuotes(versionValue.split("-")[0]);
|
||||
return removeQuotes(versionValue);
|
||||
}
|
||||
}
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
console.log('started concatenating files');
|
||||
const files = await fs.readdir('./generators/changelog/versions', 'utf8');
|
||||
console.log("started concatenating files");
|
||||
const files = await fs.readdir("./generators/changelog/versions", "utf8");
|
||||
const filesStream = files
|
||||
.map(file => {
|
||||
console.log(`reading file: ${ file }`);
|
||||
.map((file) => {
|
||||
console.log(`reading file: ${file}`);
|
||||
return {
|
||||
fileName: file,
|
||||
buf : fs.readFile(`./generators/changelog/versions/${ file }`, 'utf8')
|
||||
buf: fs.readFile(`./generators/changelog/versions/${file}`, "utf8"),
|
||||
};
|
||||
})
|
||||
.map(async ({buf, fileName}, index) => {
|
||||
.map(async ({ buf, fileName }, index) => {
|
||||
// first file we don't do anything
|
||||
// Big file and does not follow the new standard
|
||||
if (index === 0) return buf;
|
||||
@@ -58,52 +51,60 @@ const main = async () => {
|
||||
/**
|
||||
* @type {Set<string>}
|
||||
*/
|
||||
const contribuitors = new Set()
|
||||
const contribuitors = new Set();
|
||||
|
||||
// DSL Replacers
|
||||
// [PR #123] -> [PR #123](https://github.com/meteor/meteor/pull/123)
|
||||
// [GH meteor/meteor] -> [meteor/meteor](https://github.com/meteor/meteor)
|
||||
// package-name@get-version -> package-name@1.3.3
|
||||
|
||||
const file = content
|
||||
.replace(/\[PR #(\d+)\]/g, (_, number) => `[PR](https://github.com/meteor/meteor/pull/${ number })`)
|
||||
const file = content
|
||||
.replace(
|
||||
/\[PR #(\d+)\]/g,
|
||||
(_, number) =>
|
||||
`[PR](https://github.com/meteor/meteor/pull/${number})`
|
||||
)
|
||||
.replace(/\[GH ([^\]]+)\]/g, (_, name) => {
|
||||
contribuitors.add(name);
|
||||
return `[${ name }](https://github.com/${ name })`
|
||||
return `[${name}](https://github.com/${name})`;
|
||||
})
|
||||
.replace(/([a-z0-9-]+)@get-version/g, (_, name) => `${ name }@${ getPackageVersion(name) }`);
|
||||
.replace(
|
||||
/([a-z0-9-]+)@get-version/g,
|
||||
(_, name) => `${name}@${getPackageVersion(name)}`
|
||||
);
|
||||
|
||||
// already have the contribuitors thanks in the file
|
||||
if (
|
||||
file.includes('#### Special thanks to') ||
|
||||
file.includes('[//]: # (Do not edit this file by hand.)')
|
||||
) return file;
|
||||
file.includes('## Contributors') ||
|
||||
file.includes("#### Special thanks to") || // this must stay here for legacy reasons
|
||||
file.includes("[//]: # (Do not edit this file by hand.)")
|
||||
)
|
||||
return file;
|
||||
|
||||
// add the contribuitors
|
||||
const contribuitorsList =
|
||||
Array
|
||||
.from(contribuitors)
|
||||
.map(name => `- [@${ name }](https://github.com/${ name }).`)
|
||||
.join('\n');
|
||||
const contribuitorsList = Array.from(contribuitors)
|
||||
.map((name) => `- [@${name}](https://github.com/${name}).`)
|
||||
.join("\n");
|
||||
|
||||
const doneFile = `${ file }\n\n#### Special thanks to\n\n${ contribuitorsList }\n\n`;
|
||||
const doneFile = `${file}\n\n## Contributors\n\n${contribuitorsList}\n\n`;
|
||||
|
||||
//SIDE EFFECTS
|
||||
// so that this is not ran every time, we will update the last file.
|
||||
// this is for the expensive part of the script
|
||||
if (index === files.length - 2) await fs.writeFile(`./generators/changelog/versions/${fileName}`, doneFile);
|
||||
|
||||
if (index === files.length - 2)
|
||||
await fs.writeFile(
|
||||
`./generators/changelog/versions/${fileName}`,
|
||||
doneFile
|
||||
);
|
||||
return doneFile;
|
||||
})
|
||||
.reverse();
|
||||
console.log('Giving some touches to the files');
|
||||
console.log("Giving some touches to the files");
|
||||
const filesContent = await Promise.all(filesStream);
|
||||
await fs.writeFile('./history.md', filesContent.join(''));
|
||||
console.log('Finished :)');
|
||||
|
||||
await fs.writeFile("./history.md", filesContent.join(""));
|
||||
console.log("Finished :)");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
}
|
||||
main().then(_ => _);
|
||||
};
|
||||
main().then((_) => _);
|
||||
|
||||
@@ -441,7 +441,7 @@ N/A
|
||||
|
||||
* `mongo@1.15.0`
|
||||
- New option `Meteor.settings.packages.mongo.reCreateIndexOnOptionMismatch` for case when an index with the same name, but different options exists it will be re-created.
|
||||
- If there is an error on index creation Meteor will output a better message naming the collection and index where the error occured. [PR](https://github.com/meteor/meteor/pull/11995).
|
||||
- If there is an error on index creation Meteor will output a better message naming the collection and index where the error occurred. [PR](https://github.com/meteor/meteor/pull/11995).
|
||||
* `modern-browsers@0.1.8`
|
||||
- New api `getMinimumBrowserVersions` to access the `minimumBrowserVersions`. [PR](https://github.com/meteor/meteor/pull/11998).
|
||||
* `socket-stream-client@0.5.0`
|
||||
@@ -656,7 +656,7 @@ Read our [Migration Guide](https://guide.meteor.com/2.6-migration.html) for this
|
||||
- useUnifiedTopology is not an option anymore, it defaults to true.
|
||||
- native parser is not an option anymore, it defaults to false in the mongo connection.
|
||||
- poolSize not an option anymore, we are using max/minPoolSize for the same behavior on mongo connection.
|
||||
- fields option is deprecated, we are maintaining a translation layer to "projection" field (now prefered) until the next minor version, where we will start showing alerts.
|
||||
- fields option is deprecated, we are maintaining a translation layer to "projection" field (now preferred) until the next minor version, where we will start showing alerts.
|
||||
- _ensureIndex is now showing a deprecation message
|
||||
- we are maintaining a translation layer for the new oplog format, so if you read or rely on any behavior of it please read our oplog_v2_converter.js code
|
||||
- update/insert/remove behavior is maintained in the Meteor way, documented in our docs, but we are now using replaceOne/updateOne/updateMany internally. This is subject to changes in the API rewrite of MongoDB without Fibers AND if you are using rawCollection directly you have to review your methods otherwise you will see deprecation messages if you are still using the old mongodb style directly.
|
||||
@@ -2935,6 +2935,7 @@ N/A
|
||||
setMinimumBrowserVersions({
|
||||
chrome: 49,
|
||||
firefox: 45,
|
||||
firefoxIOS: 100,
|
||||
edge: 12,
|
||||
ie: Infinity, // Sorry, IE11.
|
||||
mobile_safari: [9, 2], // 9.2.0+
|
||||
|
||||
@@ -148,4 +148,3 @@ you can use ```WARN_WHEN_USING_OLD_API``` before starting your meteor process.
|
||||
- [@zodern](https://github.com/zodern).
|
||||
- [@dmromanov](https://github.com/dmromanov).
|
||||
- [@matheusccastroo](https://github.com/matheusccastroo).
|
||||
|
||||
|
||||
229
docs/generators/changelog/versions/2.14.md
Normal file
229
docs/generators/changelog/versions/2.14.md
Normal file
@@ -0,0 +1,229 @@
|
||||
## v2.14.0, 2023-12-12
|
||||
|
||||
### Highlights
|
||||
|
||||
Hacktoberfest release! 🎉
|
||||
|
||||
* MongoDB driver has been updated to v4.17.2.
|
||||
|
||||
* You can now set `DISABLE_SOCKJS_CORS=1` if you want to prevent SockJS from setting CORS headers. Do not set this option if you will have DDP clients from other origins connecting to the DDP server. [PR #12789]
|
||||
|
||||
* Added guide on [how to prepare for Meteor 3.0 migration](https://guide.meteor.com/prepare-meteor-3.0).
|
||||
|
||||
* New DDP merge strategy `NO_MERGE_MULTI`, which is similar to `NO_MERGE`, but it does track whether a document is used by multiple publications. [PR #12742]
|
||||
|
||||
* Appcache has been further deprecated and moved to the deprecated packages folder.
|
||||
|
||||
* Added `Accounts.createUserAsync` into the client.
|
||||
|
||||
* Many packages had their underscore dependency removed.
|
||||
|
||||
* Cordova has been updated to v12.0.1 for Android and v7.0.1 for iOS, being able to build to SDK 33.
|
||||
|
||||
* `meteor create` command is now interactive!
|
||||
|
||||
* Added `firstRunPromise` property to `Tracker` autorun blocks, that forces autorun blocks to be executed in synchronous-looking order by storing the value autorun promise thus making it awaitable.
|
||||
|
||||
#### Migration Steps
|
||||
|
||||
##### Android splash screen
|
||||
If you have been using `splash-screen` for Cordova, you need to update your code as Android changed their splash screen API,
|
||||
the `cordova-plugin-splashscreen` is now on `cordova-android` core, so we have removed the dependency from the `splash-screen`
|
||||
package. As a result we are dropping the support for dark mode splash screen on Android.
|
||||
|
||||
To create this now you need to create two themes on your `config.xml` file.
|
||||
|
||||
> Note that it's still possible to have it by adding the according themes with App.appendToConfig and App.addResourceFile - but this is not something Meteor will do automatically right now.
|
||||
|
||||
For more information you can check our [Migration Guide](https://guide.meteor.com/2.14-migration.html)
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
* `splash-screen` package has removed the `cordova-plugin-splashscreen` dependency. See migration steps for more info.
|
||||
|
||||
## Docs
|
||||
|
||||
- Added guide on [how to prepare for Meteor 3.0 migration](https://guide.meteor.com/prepare-meteor-3.0).
|
||||
- Added guide on [performance improvements](https://guide.meteor.com/performance-improvement).
|
||||
- Added FAQ about [Meteor 3](https://guide.meteor.com/3.0-migration).
|
||||
|
||||
## Internal API changes
|
||||
|
||||
* Tool
|
||||
- Rename `EACCESS` to `EACCES` to follow the Windows spelling
|
||||
- Fixed links in skeletons
|
||||
- Fixed build issue in Vue skeleton
|
||||
- Updated `source-map-support`
|
||||
- Fixed bugs in negated “in” and “instanceof” expressions
|
||||
- Updated `semver` to v7.5.4
|
||||
- Updated `@meteorjs/babel` to v7.18.4
|
||||
- Cordova has been updated to v12.0.1 for Android and v7.0.1 for iOS, being able to build to SDK 33.
|
||||
- `meteor create` command was re-made to be more interactive
|
||||
|
||||
## Meteor Version Release
|
||||
|
||||
* `accounts-base@get-version`
|
||||
- Ensure that `onLogin` callback fires properly
|
||||
- Indexes are now created asynchronously
|
||||
|
||||
* `accounts-oauth@get-version`
|
||||
- Indexes are now created asynchronously
|
||||
|
||||
* `accounts-password@get-version`
|
||||
- Add `Accounts.createUserAsync` to the client, a promise-based version of `Accounts.createUser`
|
||||
- Indexes are now created asynchronously
|
||||
|
||||
* `accounts-passwordless@get-version`
|
||||
- Fix #12401, ensure that user is found with ID
|
||||
- Indexes are now created asynchronously
|
||||
|
||||
* `babel-compiler@get-version`
|
||||
- Updated `@meteorjs/babel` to v7.18.4
|
||||
|
||||
* `boilerplate-generator@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `browser-policy-content@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `constraint-solver@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `crosswalk@get-version`
|
||||
- Updated `cordova-plugin-crosswalk-webview` to v2.4.0
|
||||
- Deprecated the package
|
||||
|
||||
* `ddp-rate-limiter@get-version`
|
||||
- Removed Underscore dependency
|
||||
* `ddp-server@get-version`:
|
||||
- Allow setting `DISABLE_SOCKJS_CORS` to prevent SockJS from setting CORS headers
|
||||
- Added new publication strategy `NO_MERGE_MULTI`
|
||||
|
||||
* `ecmascript@get-version`:
|
||||
- Bumped to get latest version of `@babel/compiler`
|
||||
|
||||
* `facebook-oauth@get-version`:
|
||||
- Updated default version of Facebook GraphAPI to v17
|
||||
|
||||
* `launch-screen@get-version`
|
||||
- Removed `cordova-plugin-splashscreen` dependency
|
||||
|
||||
* `fetch@get-version`:
|
||||
- Update `node-fetch` to version 1.6.12
|
||||
- Update `whatwg-fetch` to version 3.6.17
|
||||
|
||||
* `logging@get-version`:
|
||||
- Added TS types
|
||||
- Updated `chalk` to v4.1.2
|
||||
|
||||
* `logic-solver@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `meteor@get-version`:
|
||||
- Improve TS types
|
||||
|
||||
* `mobile-experience@get-version`:
|
||||
- Bumped to get latests version of `cordova` dependencies
|
||||
|
||||
* `modern-browsers@get-version`
|
||||
- Added `appleMail` user agent to allow modern bundle on iPads
|
||||
|
||||
* `modules@get-version`
|
||||
- Updated version of reify to v0.24.1
|
||||
|
||||
* `mongo@get-version`
|
||||
- Added deprecation messages into type definitions
|
||||
- Fix ObjectIDs handling in oplogV2V1Converter
|
||||
|
||||
* `npm-mongo@get-version`:
|
||||
- Bumped MongoDB driver to version 4.17.2
|
||||
|
||||
* `oauth@get-version`
|
||||
- Indexes are now created asynchronously
|
||||
- `remove` DB calls migrated to `removeAsync`
|
||||
|
||||
* `package-version-parser@get-version`
|
||||
- Updated `semver` to v7.5.4
|
||||
|
||||
* `react-fast-refresh@get-version`:
|
||||
- Updated `semver` to version 7.5.4
|
||||
|
||||
* `service-configuration@get-version`
|
||||
- Indexes are now created asynchronously
|
||||
- Add types for ConfigError
|
||||
|
||||
* `socket-stream-client@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `standard-minifier-css@get-version`
|
||||
- Updated `@babel/runtime` to v7.23.5
|
||||
- Updated `minifier-css` to v1.6.4
|
||||
- Updated `logging` package to v1.3.2
|
||||
|
||||
* `test-server-tests-in-console-once@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `tinytest@get-version`
|
||||
- Removed Underscore dependency
|
||||
|
||||
* `tracker@get-version`
|
||||
- Added `firstRunPromise` property, that forces autorun blocks to be executed
|
||||
in synchronous-looking order by storing the value autorun promise
|
||||
thus making it awaitable
|
||||
|
||||
* `typescript@get-version`:
|
||||
- Updated to 4.9.5
|
||||
|
||||
* `webapp@get-version`
|
||||
- Updated `cordova-plugin-meteor-webapp` to v2.0.3
|
||||
- Updated `cookie-parser` to v1.4.6
|
||||
- Updated `send` to v0.18.0
|
||||
- Updated `stream-to-string` to v1.2.1
|
||||
- Updated `qs` to v6.11.2
|
||||
- Updated `@types/connect` to v3.4.38
|
||||
|
||||
|
||||
## Independent releases
|
||||
|
||||
* `google-oauth@1.4.4`:
|
||||
- Remove logging request/response in google_server
|
||||
|
||||
* NPM `@meteorjs/babel@7.18.4`
|
||||
- Updated `@meteorjs/reify` to v0.24.1
|
||||
|
||||
* NPM `@meteorjs/babel-preset-meteor@7.10.1`
|
||||
- Add Facebook in-app browser
|
||||
|
||||
* NPM `cordova-plugin-meteor-webapp@2.0.2`
|
||||
- Fixed Android hot code push failing
|
||||
|
||||
* NPM `cordova-plugin-meteor-webapp@2.0.3`
|
||||
- Fix pull manifest from correct url if parameter are used in baseurl
|
||||
|
||||
* NPM `meteor-node-stubs@1.2.6`
|
||||
- Update dependencies
|
||||
- Deep update dependencies that were highlighted by `npm audit`
|
||||
|
||||
## Contributors
|
||||
|
||||
- [@StorytellerCZ](https://github.com/sponsors/StorytellerCZ)
|
||||
- [@Grubba27](https://github.com/sponsors/Grubba27)
|
||||
- [@vit0rr](https://github.com/vit0rr)
|
||||
- [@realyze](https://github.com/realyze)
|
||||
- [@jamauro](https://github.com/jamauro)
|
||||
- [@Torgen](https://github.com/Torgen)
|
||||
- [@brucejo75](https://github.com/brucejo75)
|
||||
- [@zodern](https://github.com/sponsors/zodern)
|
||||
- [@alisnic](https://github.com/alisnic)
|
||||
- [@ebroder](https://github.com/ebroder)
|
||||
- [@BANSAL-NISHU](https://github.com/BANSAL-NISHU)
|
||||
- [@salmanhasni](https://github.com/salmanhasni)
|
||||
- [@jdgjsag67251](https://github.com/jdgjsag67251)
|
||||
- [@guncebektas](https://github.com/guncebektas)
|
||||
- [@harryadel](https://github.com/harryadel)
|
||||
- [@dd137](https://github.com/dd137)
|
||||
- [@matheusccastroo](https://github.com/matheusccastroo)
|
||||
- [@mr-loop-1](https://github.com/mr-loop-1)
|
||||
|
||||
For making this great framework even better!
|
||||
|
||||
57
docs/generators/changelog/versions/2.15.0.md
Normal file
57
docs/generators/changelog/versions/2.15.0.md
Normal file
@@ -0,0 +1,57 @@
|
||||
## v2.15.0, 2024-02-05
|
||||
|
||||
### Highlights
|
||||
|
||||
* Bumps embedded MongoDB to 7.0.5.
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
N/A
|
||||
|
||||
#### Internal API changes
|
||||
|
||||
N/A
|
||||
|
||||
#### Migration Steps
|
||||
|
||||
In development, if you're using Linux, you might get an error like `version GLIBCXX_3.4.26 not found` or something related to g++.
|
||||
|
||||
This is related to your g++ version. With MongoDB 7, you need to have g++ 11 or higher. So make sure to have this updated.
|
||||
|
||||
This will happen only if you are trying to run your Meteor application with a MongoDB 7 version. If you run your app with a MONGO_URL pointing to a different MongoDB version, you won't have this issue.
|
||||
|
||||
```bash
|
||||
|
||||
meteor update --release 2.15
|
||||
|
||||
```
|
||||
|
||||
|
||||
#### Meteor Version Release
|
||||
|
||||
|
||||
* `Command line`:
|
||||
- The bundle version was changed to include embedded MongoDB to 7.0.5.
|
||||
- Fix cordova launch screen warnings on 2.15 [PR #12971]
|
||||
* `underscore@get-version`:
|
||||
- A test related to [PR #12798] to see if the tests can manage the first update step. [PR #12912]
|
||||
* `service-configuration@get-version`:
|
||||
- added new types* [PR #12922]
|
||||
* `meteor@get-version`:
|
||||
- added new types [PR #12922]
|
||||
* `accounts-base@get-version`:
|
||||
- Added missing type for createUserVerifyingEmail [PR #12919]
|
||||
|
||||
#### Special thanks to
|
||||
|
||||
- [@Grubba27](https://github.com/Grubba27).
|
||||
- [@denihs](https://github.com/denihs).
|
||||
- [@mcorbelli](https://github.com/mcorbelli).
|
||||
- [@matheusccastroo](https://github.com/matheusccastroo).
|
||||
- [@StorytellerCZ](https://github.com/StorytellerCZ).
|
||||
- [@ebroder](https://github.com/ebroder).
|
||||
- [@nachocodoner](https://github.com/nachocodoner).
|
||||
|
||||
For making this great framework even better!
|
||||
|
||||
|
||||
102
docs/generators/changelog/versions/2.16.md
Normal file
102
docs/generators/changelog/versions/2.16.md
Normal file
@@ -0,0 +1,102 @@
|
||||
## v2.16.0, 2024-05-14
|
||||
|
||||
### Highlights
|
||||
|
||||
- Support observeChangesAsync and observeAsync. [PR](https://github.com/meteor/meteor/pull/13025)
|
||||
- New mongo package options to optimize Oplog tailing performance to include/exclude certain collections [PR](https://github.com/meteor/meteor/pull/13009)
|
||||
|
||||
#### Migration Steps
|
||||
|
||||
To update from 2.15 to this one, you can run:
|
||||
|
||||
```
|
||||
meteor update --release 2.16
|
||||
```
|
||||
|
||||
If you're coming from an older version, please check our [Migration Guides](https://guide.meteor.com/2.14-migration).
|
||||
|
||||
#### Breaking Changes
|
||||
N/A
|
||||
|
||||
#### Internal API changes
|
||||
|
||||
* Add method name to MethodInvocation in DDP messages
|
||||
|
||||
#### Meteor Version Release
|
||||
|
||||
* Meteor tool
|
||||
- Updated Svelte skeleton
|
||||
- Update tsconfig.json for Svelte skeleton
|
||||
- Updated Solid skeleton NPM dependencies
|
||||
|
||||
* Blaze
|
||||
- Support of async dynamic attributes [PR](https://github.com/meteor/blaze/pull/460)
|
||||
- Fix Blaze._expandAttributes returns empty object, if null. [PR](https://github.com/meteor/blaze/pull/458)
|
||||
|
||||
* `accounts-base@get-version`
|
||||
- Supported session storage to store accounts login token [PR #13046]
|
||||
- Update config checking
|
||||
- Added new types [PR #13042]
|
||||
|
||||
* `accounts-oauth@get-version`
|
||||
- Remove config checking as it is done in `accounts-base`
|
||||
|
||||
* `accounts-ui-unstyled@get-version`
|
||||
- `Connect with Twitter` is now `Connect with X/Twitter`
|
||||
|
||||
* `check@get-version`:
|
||||
- Added an optional flag to immediately throw error when all checks failed. [PR #12970]
|
||||
|
||||
* `ddp-common@get-version`
|
||||
- Add method name to MethodInvocation
|
||||
|
||||
* `ddp-client@get-version`
|
||||
- Add method name to MethodInvocation
|
||||
|
||||
* `ddp-server@get-version`
|
||||
- Add method name to MethodInvocation
|
||||
|
||||
* `twitter-config-ui@get-version`
|
||||
- Update setup instructions
|
||||
|
||||
* `email@get-version`
|
||||
- Nodemailer update to v6.9.10
|
||||
- `@types/nodemailer` updated to v6.4.14
|
||||
- Adds the ability to encrypt your emails using PGP [PR #12991]
|
||||
|
||||
* `logging@get-version`
|
||||
- Type update
|
||||
|
||||
* `minimongo@get-version`
|
||||
- Support observeChangesAsync and observeAsync [PR #13025]
|
||||
- Report and extend test cases for the old async behaviors
|
||||
|
||||
* `minifier-js@get-version`
|
||||
- Update terser to v5.31.0
|
||||
|
||||
* `mongo@get-version`
|
||||
- Support a new option to include/exclude certain collections for oplog tailing [PR #13009]
|
||||
|
||||
* `reload-safetybelt@get-version`
|
||||
- Remove underscore dependency
|
||||
|
||||
* `service-configuration@get-version`
|
||||
- Type update
|
||||
|
||||
#### Independent releases
|
||||
|
||||
* `mongo@1.16.9`:
|
||||
- Set `minPoolSize` for oplog
|
||||
|
||||
* `underscore@1.6.1`
|
||||
- Fix bug in `_.intersection`
|
||||
|
||||
#### Contributors
|
||||
|
||||
- [GH nachocodoner]
|
||||
- [GH StorytellerCZ]
|
||||
- [GH jamauro]
|
||||
- [GH Twisterking]
|
||||
- [GH harryadel]
|
||||
|
||||
Thanks for making this great framework even better!
|
||||
743
docs/generators/changelog/versions/3.0.0.md
Normal file
743
docs/generators/changelog/versions/3.0.0.md
Normal file
@@ -0,0 +1,743 @@
|
||||
## v3.0, 2024-07-15
|
||||
|
||||
### Highlights
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- `accounts-2fa@3.0.0`:
|
||||
|
||||
- Some methods are now async. See below:
|
||||
- `Accounts._is2faEnabledForUser`
|
||||
- `(Meteor Method) - generate2faActivationQrCode`
|
||||
- `(Meteor Method) - enableUser2fa`
|
||||
- `(Meteor Method) - disableUser2fa`
|
||||
- `(Meteor Method) - has2faEnabled`
|
||||
|
||||
- `accounts-base@3.0.0`:
|
||||
|
||||
- `methods.removeOtherTokens` is now async
|
||||
- `Accounts.destroyToken` is now async
|
||||
- `Accounts.insertUserDoc` is now async
|
||||
- `Accounts.updateOrCreateUserFromExternalService` is now async
|
||||
- `Accounts.expirePasswordToken` is now async
|
||||
- `Accounts.setupUsersCollection` is now async
|
||||
- `Meteor.user` is now async in server
|
||||
|
||||
- `accounts-facebook@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-github@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-google@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-meetup@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-meteor-developer@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-password@3.0.0`:
|
||||
|
||||
- Some server methods are now async:
|
||||
- `Accounts.sendResetPasswordEmail`
|
||||
- `Accounts.sendEnrollmentEmail`
|
||||
- `Accounts.sendVerificationEmail`
|
||||
- `Accounts.addEmail`
|
||||
- `Accounts.removeEmail`
|
||||
- `Accounts.replaceEmailAsync`
|
||||
- `Accounts.verifyEmail`
|
||||
- `Accounts.createUserVerifyingEmail`
|
||||
- `Accounts.createUser`
|
||||
- `Accounts.generateVerificationToken`
|
||||
- `Accounts.generateResetToken`
|
||||
- `Accounts.forgotPassword`
|
||||
- `Accounts.setPassword`
|
||||
- `Accounts.changePassword`
|
||||
- `Accounts.setUsername`
|
||||
- `Accounts.findUserByEmail`
|
||||
- `Accounts.findUserByUsername`
|
||||
|
||||
- `accounts-passwordless@3.0.0`:
|
||||
|
||||
- `Accounts.sendLoginTokenEmail` is now async.
|
||||
|
||||
- `accounts-twitter@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-ui-unstyled@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `accounts-weibo@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `allow-deny@2.0.0`:
|
||||
|
||||
- Updated to accept async functions.
|
||||
|
||||
- `appcache@2.0.0`:
|
||||
|
||||
- Updated internal api to use `handlers`
|
||||
|
||||
- `audit-argument-checks@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `autopublish@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `autoupdate@2.0.0`:
|
||||
|
||||
- Updated api to be async, with asyncronous queueing.
|
||||
|
||||
- `babel-compiler@8.0.0`:
|
||||
|
||||
- Add `Babel.compileForShell`
|
||||
- Removed `Promise.await` default transform.
|
||||
- Added top-level-await to packages.
|
||||
|
||||
- `babel-runtime@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `base64@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `binary-heap@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `blaze@3.0.0`:
|
||||
- Todo
|
||||
|
||||
- `boilerplate-generator-tests@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `boilerplate-generator@2.0.0`:
|
||||
|
||||
- `toHTML` is no longer available (it was already deprecated). Use `toHTMLStream` instead.
|
||||
- Updated to use `handlers`
|
||||
|
||||
- `browser-policy-common@2.0.0`:
|
||||
|
||||
- Updated to use `handlers`
|
||||
|
||||
- `browser-policy-content@2.0.0`:
|
||||
|
||||
- Some methods are now async. See below:
|
||||
- `BrowserPolicy.content.setPolicy`
|
||||
- `BrowserPolicy.content.allowInlineScripts`
|
||||
- `BrowserPolicy.content.disallowInlineScripts`
|
||||
- `BrowserPolicy.content.disallowAll`
|
||||
- `BrowserPolicy.setDefaultPolicy`
|
||||
|
||||
- `browser-policy-framing@2.0.0`:
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `browser-policy@2.0.0`:
|
||||
Updated to use async methods from `browser-policy-common` and `browser-policy-content`.
|
||||
|
||||
- `caching-compiler@2.0.0`:
|
||||
|
||||
- `afterLink` is now async.
|
||||
- Updated to use now async API.
|
||||
|
||||
- `callback-hook@2.0.0`:
|
||||
|
||||
- Added `forEachAsync` method.
|
||||
|
||||
- `check@2.0.0`:
|
||||
|
||||
- Removed `fibers` related tests.
|
||||
|
||||
- `constraint-solver@2.0.0`:
|
||||
|
||||
- Some methods are now async. See below:
|
||||
|
||||
- `ConstraintSolver.getVersionCostSteps`
|
||||
- `ConstraintSolver.analyze`
|
||||
- `ConstraintSolver.resolve`
|
||||
|
||||
- Updated tests to be async.
|
||||
- Removed a few underscore usage.
|
||||
- Added updated to use async methods
|
||||
|
||||
- `context@1.0.0`:
|
||||
|
||||
- Removed `fibers` from package.
|
||||
|
||||
- `core-runtime@2.0.0`:
|
||||
|
||||
- Created package to load packages and the app.
|
||||
- This is the pakcages that sets up the Runtime.
|
||||
|
||||
- `crosswalk@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `ddp-client@3.0.0`:
|
||||
|
||||
- Added `isAsyncCall` method to know if call is being made by an async method.
|
||||
- Removed `fibers` from package.
|
||||
- Updated tests to use async methods.
|
||||
- Now `stubPromise` is returned when calling `callAsync` or `applyAsync`.
|
||||
|
||||
- `ddp-common@2.0.0`:
|
||||
|
||||
- Added `.fence` option.
|
||||
|
||||
- `ddp-rate-limiter@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `ddp-server@3.0.0`:
|
||||
|
||||
- Updated to use async methods.
|
||||
- Removed `fibers` from package.
|
||||
- Updated tests to use async methods.
|
||||
- Turned server implementation to async.
|
||||
|
||||
- `ddp@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `diff-sequence@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `disable-oplog@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `ecmascript-runtime-client@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `ecmascript-runtime-server@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `ecmascript-runtime@1.0.0`:
|
||||
|
||||
- Added dependency to `@babel/runtime`.
|
||||
|
||||
- `ecmascript@1.0.0`:
|
||||
|
||||
- `ECMAScript.compileForShell` was removed. Use `Babel.compileForShell` from
|
||||
`babel-compiler` instead. This change makes some build plugins and apps that do not use `babel-compiler` 90mb smaller.
|
||||
- Added dependency to `@babel/runtime`.
|
||||
- Moved runtime tests.
|
||||
|
||||
- `ejson@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `email@3.0.0`:
|
||||
|
||||
- `Email.send` is no longer available. Use `Email.sendAsync` instead.
|
||||
- Updated types to reflext async methods and `Email.send` depracation.
|
||||
|
||||
- `es5-shim@5.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `facebook-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `facebook-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `facts-base@2.0.0`:
|
||||
|
||||
- turned unorderd deps on `ddp` to false.
|
||||
|
||||
- `facts-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `fetch@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `force-ssl-common@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `force-ssl@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `geojson-utils@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `github-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `github-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `google-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `google-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `hot-code-push@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `http@`:
|
||||
- Updated handlers to use `handlers`
|
||||
- `id-map@2.0.0`:
|
||||
|
||||
- Added `forEachAsync` method.
|
||||
|
||||
- `insecure@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `inter-process-messaging@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `launch-screen@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `localstorage@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `logging@2.0.0`:
|
||||
|
||||
- Added dependency to `@babel/runtime`.
|
||||
|
||||
- `logic-solver@3.0.0`:
|
||||
`Logic.disablingAssertions` is now async.
|
||||
`minMaxWS` is now async.
|
||||
|
||||
- `meetup-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `meetup-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `meteor-base@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `meteor-developer-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `meteor-developer-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `meteor-tool@3.0.0`:
|
||||
|
||||
- Changes to how meteor apps are being created [PR](https://github.com/meteor/meteor/pull/12697)
|
||||
|
||||
- `meteor@2.0.0`:
|
||||
|
||||
- Async local storage was added to help deal with async methods.
|
||||
- Added `promiseEmmiter` to help with async methods.
|
||||
- Removed `fibers` from package.
|
||||
|
||||
- `minifier-css@2.0.0`:
|
||||
|
||||
- `minifyCss` is now async.
|
||||
- Removed `fibers` from package.
|
||||
|
||||
- `minifier-js@3.0.0`:
|
||||
|
||||
- `minifyJs` is now async.
|
||||
- `terserMinify` no longer takes callbacks
|
||||
- Removed `fibers` from package.
|
||||
|
||||
* `minimongo@2.0.0`:
|
||||
- `cursor.observe` now returns `isReady` and `isReadyPromise` wich indicates
|
||||
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`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `mobile-status-bar@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `modern-browsers@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `modules-runtime@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `modules@1.0.0`:
|
||||
|
||||
- Updated `reify` version.
|
||||
|
||||
- `mongo-decimal@`:
|
||||
|
||||
- Updated to use `async` methods.
|
||||
|
||||
- `mongo-dev-server@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `mongo-id@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `mongo-livedata@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `mongo@2.0.0`:
|
||||
|
||||
- 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`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `oauth-encryption@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `oauth@`:
|
||||
|
||||
- `_endOfPopupResponseTemplate` and `_endOfRedirectResponseTemplate` are no longer a property but now a function that returns a promise of the same value as before
|
||||
- the following server methods are now async:
|
||||
- `OAuth._renderOauthResults`
|
||||
- `OAuth._endOfLoginResponse`
|
||||
- `OAuth.renderEndOfLoginResponse`
|
||||
- `OAuth._storePendingCredential`
|
||||
- `OAuth._retrievePendingCredential`
|
||||
- `ensureConfigured`
|
||||
- `_cleanStaleResults`
|
||||
|
||||
- `oauth@3.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `oauth1@`:
|
||||
|
||||
- the following server methods are now async:
|
||||
- `OAuth._storeRequestToken`
|
||||
- `OAuth._retrieveRequestToken`
|
||||
|
||||
- `oauth1@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `oauth2@`:
|
||||
|
||||
- `OAuth._requestHandlers['2']` is now async.
|
||||
|
||||
- `oauth2@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `ordered-dict@2.0.0`:
|
||||
|
||||
- Added `forEachAsync` method.
|
||||
|
||||
- `package-stats-opt-out@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `package-version-parser@4.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `promise@1.0.0`:
|
||||
|
||||
- Removed `fibers` usage
|
||||
|
||||
- `random@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `rate-limit@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `reactive-dict@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `reactive-var@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `reload-safetybelt@2.0.0`:
|
||||
|
||||
- Added `ecmascript` package to `package.js`
|
||||
|
||||
- `reload@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `retry@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `routepolicy@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `server-render@1.0.0`:
|
||||
|
||||
- Updated usage with `getBoilerplate` that are now `async`.
|
||||
|
||||
- `service-configuration@2.0.0`:
|
||||
|
||||
- Updated to use `createIndexAsync`.
|
||||
|
||||
- `session@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `sha@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `shell-server@1.0.0`:
|
||||
|
||||
- Updated to handle promises results.
|
||||
|
||||
- `socket-stream-client@1.0.0`:
|
||||
|
||||
- Updated tests to handle `async` code.
|
||||
|
||||
- `spiderable@`:
|
||||
|
||||
- Updated handlers to use `handlers` that are now using express
|
||||
- removed `fibers` usage if flag is set to `true`
|
||||
|
||||
- `standard-minifier-css@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `standard-minifier-js@3.0.0`:
|
||||
|
||||
- `processFilesForBundle` is now `async`.
|
||||
|
||||
- `standard-minifiers@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `static-html@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `test-helpers@2.0.0`:
|
||||
|
||||
- Updated to use `async` methods.
|
||||
- Removed `fibers` usage.
|
||||
- Added possibliy to use `async` tests.
|
||||
|
||||
- `test-in-browser@2.0.0`:
|
||||
|
||||
- Updated css to be in dark mode.
|
||||
|
||||
- `test-in-console@2.0.0`:
|
||||
|
||||
- Updated log identation.
|
||||
|
||||
- `test-server-tests-in-console-once@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `tinytest-harness@1.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `tinytest@2.0.0`:
|
||||
|
||||
- Added `test name` to logs.
|
||||
- Removed `fibers` usage.
|
||||
|
||||
- `twitter-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `twitter-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `typescript@5.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `underscore-tests@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `underscore@2.0.0`:
|
||||
|
||||
- Removed dependency in meteor package.
|
||||
|
||||
- `url@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `webapp-hashing@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `webapp@2.0.0`:
|
||||
|
||||
- These methods are now async:
|
||||
|
||||
- `WebAppInternals.reloadClientPrograms()`
|
||||
- `WebAppInternals.pauseClient()`
|
||||
- `WebAppInternals.generateClientProgram()`
|
||||
- `WebAppInternals.generateBoilerplate()`
|
||||
- `WebAppInternals.setInlineScriptsAllowed()`
|
||||
- `WebAppInternals.enableSubresourceIntegrity()`
|
||||
- `WebAppInternals.setBundledJsCssUrlRewriteHook()`
|
||||
- `WebAppInternals.setBundledJsCssPrefix()`
|
||||
- `WebAppInternals.getBoilerplate`
|
||||
|
||||
- Changed engine from connect to express and changed api naming to match express. See below:
|
||||
- `WebApp.connectHandlers.use(middleware)` is now `WebApp.handlers.use(middleware)`
|
||||
- `WebApp.rawConnectHandlers.use(middleware)` is now `WebApp.rawHandlers.use(middleware)`
|
||||
- `WebApp.connectApp` is now `WebApp.expressApp`
|
||||
|
||||
- `weibo-config-ui@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
- `weibo-oauth@2.0.0`:
|
||||
|
||||
- Package was bumped due to a dependency update. No code changes were made.
|
||||
|
||||
#### New Public API
|
||||
|
||||
|
||||
|
||||
- `accounts-base`: (2.9+)
|
||||
|
||||
- `Meteor.userAsync()`
|
||||
|
||||
- `callback-hook`:forEachAsync
|
||||
|
||||
- `forEachAsync`
|
||||
|
||||
- `ddp-server`: (2.8+)
|
||||
|
||||
- `Meteor.callAsync()`
|
||||
|
||||
- `meteor`:
|
||||
- Added `Meteor.isDebug` to execute code in debug builds, activated with the --inspect mode.
|
||||
|
||||
- `minifier-css`: (2.9+)
|
||||
|
||||
- `CssTools.minifyCssAsync()`
|
||||
|
||||
- `mongo`:
|
||||
|
||||
- `Mongo.Collection`: (2.8+)
|
||||
- `createCappedCollectionAsync`
|
||||
- `createIndexAsync`
|
||||
- `dropCollectionAsync`
|
||||
- `dropIndexAsync`
|
||||
- `findOneAsync`
|
||||
- `insertAsync`
|
||||
- `removeAsync`
|
||||
- `updateAsync`
|
||||
- `upsertAsync`
|
||||
- `Collection.Cursor`: (2.8+)
|
||||
- `countAsync`
|
||||
- `fetchAsync`
|
||||
- `forEachAsync`
|
||||
- `mapAsync`
|
||||
- `[Symbol.asyncIterator]` so this code should work:
|
||||
```js
|
||||
for await (const document of collection.find(query, options)) /* ... */
|
||||
```
|
||||
|
||||
#### Internal API changes
|
||||
|
||||
`accounts-base`:
|
||||
|
||||
- `_attemptLogin`
|
||||
- `_loginMethod`
|
||||
- `_runLoginHandlers`
|
||||
|
||||
* Upgraded `node-gyp` to v9.4.0
|
||||
* Upgraded `node-pre-gyp` to `@mapbox/node-pre-gyp` v1.0.11
|
||||
|
||||
#### New Internal API
|
||||
|
||||
`accounts-password`:
|
||||
|
||||
- `Accounts._checkPasswordAsync`
|
||||
|
||||
#### Special thanks to
|
||||
|
||||
- [@denihs](https://github.com/denihs)
|
||||
- [@Grubba27](https://github.com/Grubba27)
|
||||
- [@nachocodoner](https://github.com/nachocodoner)
|
||||
- [@fredmaiaarantes](https://github.com/fredmaiaarantes)
|
||||
- [@vit0rr](https://github.com/vit0rr)
|
||||
- [@filipenevola](https://github.com/filipenevola)
|
||||
- [@zodern](https://github.com/zodern)
|
||||
- [@radekmie](https://github.com/radekmie)
|
||||
- [@StorytellerCZ](https://github.com/StorytellerCZ)
|
||||
- [@gunnartorfis](https://github.com/gunnartorfis)
|
||||
- [@xet7](https://github.com/xet7)
|
||||
- [@harryadel](https://github.com/harryadel)
|
||||
- [@simonwebs](https://github.com/simonwebs)
|
||||
- [@TylerThompson](https://github.com/TylerThompson)
|
||||
- [@rodrigok](https://github.com/rodrigok)
|
||||
- [@zarvox](https://github.com/zarvox)
|
||||
- [@srsgores](https://github.com/srsgores)
|
||||
- [@tassoevan](https://github.com/tassoevan)
|
||||
- [@Torgen](https://github.com/Torgen)
|
||||
- [@MarcosSpessatto](https://github.com/MarcosSpessatto)
|
||||
- [@vincentcarpentier](https://github.com/vincentcarpentier)
|
||||
- [@ggazzo](https://github.com/ggazzo)
|
||||
- [@StevenMia](https://github.com/StevenMia)
|
||||
- [@acemtp](https://github.com/acemtp)
|
||||
|
||||
And so many more people, for making this great framework even better!
|
||||
45
docs/generators/changelog/versions/3.0.1.md
Normal file
45
docs/generators/changelog/versions/3.0.1.md
Normal file
@@ -0,0 +1,45 @@
|
||||
## v3.0.1, 2024-07-16
|
||||
|
||||
### Highlights
|
||||
|
||||
* Bump the patch for some packages, so we publish them using Meteor 3 tooling. [PR #13231]
|
||||
|
||||
#### 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.1
|
||||
|
||||
```
|
||||
|
||||
|
||||
#### Meteor Version Release
|
||||
|
||||
|
||||
* `Bumped packages`:
|
||||
- accounts-ui-unstyled@1.7.2
|
||||
- crosswalk@1.7.3
|
||||
- facebook-oauth@1.11.4
|
||||
- npm-mongo@4.17.3
|
||||
- package-version-parser@3.2.3
|
||||
- twitter-config-ui@1.0.2
|
||||
|
||||
|
||||
#### Special thanks to
|
||||
|
||||
- [@denihs](https://github.com/denihs).
|
||||
|
||||
|
||||
For making this great framework even better!
|
||||
|
||||
|
||||
18
docs/generators/packages-listing/README.md
Normal file
18
docs/generators/packages-listing/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Listing of all meteor core packages
|
||||
|
||||
This is a script that will generate a list of all meteor core packages, being ran every build.
|
||||
This ensures that we always have a list of core packages up to date with their correct links to GitHub.
|
||||
|
||||
|
||||
We can always add packages to the list by adding them to the `script.js` constant `OUTSIDE_OF_CORE_PACKAGES`.
|
||||
|
||||
Should follow the following format:
|
||||
|
||||
```js
|
||||
{
|
||||
name: 'package-name',
|
||||
link: 'https://link-to-github.com/meteor/meteor/tree/devel/packages/package-name'
|
||||
}
|
||||
```
|
||||
|
||||
At the end, this script will update the file located in `docs/source/packages/packages-listing.md` with the new list of packages.
|
||||
68
docs/generators/packages-listing/script.js
Normal file
68
docs/generators/packages-listing/script.js
Normal file
@@ -0,0 +1,68 @@
|
||||
const fs = require('fs').promises;
|
||||
const HEADER_TEMPLATE = `
|
||||
---
|
||||
title: Core Package Listing
|
||||
description: list of all Meteor core packages.
|
||||
---
|
||||
|
||||
[//]: # (Do not edit this file by hand.)
|
||||
|
||||
[//]: # (This is a generated file.)
|
||||
|
||||
[//]: # (If you want to change something in this file)
|
||||
|
||||
[//]: # (go to meteor/docs/generators/packages-listing)
|
||||
|
||||
# Core Packages
|
||||
|
||||
|
||||
`
|
||||
|
||||
const OUTSIDE_OF_CORE_PACKAGES = [
|
||||
{
|
||||
name: 'blaze',
|
||||
link: 'https://github.com/meteor/blaze'
|
||||
},
|
||||
{
|
||||
name: 'react-packages',
|
||||
link: 'https://github.com/meteor/react-packages'
|
||||
}
|
||||
];
|
||||
|
||||
const IGNORED = [
|
||||
'depracated',
|
||||
'non-core'
|
||||
];
|
||||
const getPackages = async () => {
|
||||
const packages =
|
||||
(await fs.readdir('../packages', { withFileTypes: true }))
|
||||
.filter(dirent => dirent.isDirectory())
|
||||
.map(dirent => dirent.name)
|
||||
.filter(name => !IGNORED.includes(name))
|
||||
.map(name => {
|
||||
return {
|
||||
name,
|
||||
link: `https://github.com/meteor/meteor/tree/devel/packages/${name}`
|
||||
}
|
||||
});
|
||||
return [...OUTSIDE_OF_CORE_PACKAGES, ...packages, ];
|
||||
}
|
||||
|
||||
const generateMarkdown = (packages) =>
|
||||
packages
|
||||
.map(({name, link}) => `- [${name}](${link})`)
|
||||
.join('\n');
|
||||
|
||||
|
||||
|
||||
async function main() {
|
||||
console.log("🚂 Started listing 🚂");
|
||||
const packages = await getPackages();
|
||||
const markdown = generateMarkdown(packages);
|
||||
const content = HEADER_TEMPLATE + markdown;
|
||||
console.log("📝 Writing to file 📝");
|
||||
await fs.writeFile('./source/packages/packages-listing.md', content);
|
||||
console.log("🚀 Done 🚀");
|
||||
}
|
||||
|
||||
main();
|
||||
1497
docs/history.md
1497
docs/history.md
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,9 @@
|
||||
{
|
||||
"plugins": ["plugins/markdown"],
|
||||
"markdown": {
|
||||
"parser": "gfm"
|
||||
},
|
||||
"source": {
|
||||
"exclude": [
|
||||
"packages/ddp/sockjs-0.3.4.js",
|
||||
"packages/test-in-browser/diff_match_patch_uncompressed.js",
|
||||
"packages/jquery/jquery.js",
|
||||
"packages/underscore/underscore.js",
|
||||
"packages/json/json2.js",
|
||||
"packages/minimongo/minimongo_tests.js",
|
||||
"tools/node_modules",
|
||||
@@ -18,5 +13,9 @@
|
||||
"**/node_modules",
|
||||
"npm-packages"
|
||||
]
|
||||
},
|
||||
"plugins": [ "plugins/markdown"],
|
||||
"markdown": {
|
||||
"parser": "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ Most users don't use `observeChanges` directly, but whenever you return a cursor
|
||||
|
||||
Previous versions of Meteor only had one strategy for implementing `observeChanges`: the "poll-and-diff" algorithm, implemented by the `PollingObserveDriver` class. This approach re-runs the query frequently and calculates the difference between each set of results. This code is simple and has historically contained very few bugs. But the cost of the `PollingObserveDriver` is proportional to the poll frequency and to the size of each query result, and the time from database change to callback invocation depends on whether the write originated in the same Meteor server process (very fast) or in another process (up to 10 seconds).
|
||||
|
||||
Starting with Meteor 0.7.0, Meteor can use an additional strategy to implemnt `observeChanges`: **oplog tailing**, implemented by the `OplogObserveDriver` class.
|
||||
Starting with Meteor 0.7.0, Meteor can use an additional strategy to implement `observeChanges`: **oplog tailing**, implemented by the `OplogObserveDriver` class.
|
||||
Meteor now knows how to read the MongoDB "operations log" --- a special collection that records all the write operations as they are applied to your database. This means changes to the database can be instantly noticed and reflected in Meteor, whether they originated from Meteor or from an external database client. Oplog tailing has different performance characteristics than "poll-and-diff" which are superior in many cases.
|
||||
|
||||
`OplogObserveDriver` needs to understand the meaning of MongoDB [selectors](http://docs.meteor.com/#selectors), [field specifiers](http://docs.meteor.com/#fieldspecifiers), [modifiers](http://docs.meteor.com/#modifiers), and [sort specifiers](http://docs.meteor.com/#sortspecifiers) at a much deeper level than `PollingObserveDriver`. This is because it actually needs to understand how write operations that it sees in the oplog interact with queries, instead of just relying on the MongoDB server to repeatedly execute the query. To deal with these structures, `OplogObserveDriver` uses Meteor's implementation of the MongoDB query engine, [Minimongo](https://github.com/meteor/meteor/tree/master/packages/minimongo), which Meteor also uses as its client-side local database cache.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[build]
|
||||
publish = "public"
|
||||
command = "npm install && npm run build"
|
||||
command = "npm cache clear --force && npm install --legacy-peer-deps && npm run build"
|
||||
|
||||
2209
docs/package-lock.json
generated
2209
docs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,8 @@
|
||||
"version": "3.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@meteorjs/meteor-hexo-config": "1.0.14",
|
||||
"@meteorjs/meteor-theme-hexo": "^2.0.9",
|
||||
"canonical-json": "0.0.4",
|
||||
"chexo": "1.0.7",
|
||||
"handlebars": "4.7.7",
|
||||
@@ -16,19 +18,21 @@
|
||||
"hexo-renderer-marked": "2.0.0",
|
||||
"hexo-server": "1.0.0",
|
||||
"hexo-versioned-netlify-redirects": "1.1.0",
|
||||
"jsdoc": "3.5.5",
|
||||
"@meteorjs/meteor-hexo-config": "1.0.14",
|
||||
"@meteorjs/meteor-theme-hexo": "2.0.8",
|
||||
"jsdoc": "^4.0.2",
|
||||
"showdown": "1.9.1",
|
||||
"underscore": "1.13.1"
|
||||
},
|
||||
"scripts": {
|
||||
"list-core-packages": "node ./generators/packages-listing/script.js",
|
||||
"generate-history": "node ./generators/changelog/script.js",
|
||||
"build": "npm run generate-history && jsdoc/jsdoc.sh && chexo @meteorjs/meteor-hexo-config -- generate",
|
||||
"build": "npm run list-core-packages && jsdoc/jsdoc.sh && chexo @meteorjs/meteor-hexo-config -- generate",
|
||||
"clean": "hexo clean; rm data/data.js data/names.json",
|
||||
"test": "npm run clean; npm run build",
|
||||
"predeploy": "npm run build",
|
||||
"deploy": "hexo-s3-deploy",
|
||||
"start": "npm run build && chexo @meteorjs/meteor-hexo-config -- server"
|
||||
},
|
||||
"volta": {
|
||||
"node": "14.21.3"
|
||||
}
|
||||
}
|
||||
|
||||
35
docs/scripts/legacy-warning.js
Normal file
35
docs/scripts/legacy-warning.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/* global hexo */
|
||||
|
||||
hexo.extend.filter.register('after_render:html', function (str) {
|
||||
const warningMessage = `
|
||||
<div class="warning-banner">
|
||||
<p>
|
||||
⚠️ You're browsing the documentation for an old version of Meteor.js.
|
||||
Check out the <a href="https://docs.meteor.com" target="_blank">v3 docs</a> and <a href="https://v3-migration-docs.meteor.com/" target="_blank">migration guide</a>.
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const css = `
|
||||
<style>
|
||||
.warning-banner {
|
||||
text-align: center;
|
||||
background-color: #fff3cd;
|
||||
border: 1px solid #ffeeba;
|
||||
color: #856404;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.warning-banner a {
|
||||
color: #0056b3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.warning-banner a:hover {
|
||||
color: #003d82;
|
||||
}
|
||||
</style>
|
||||
`;
|
||||
|
||||
const injectedContent = css + warningMessage;
|
||||
|
||||
return str.replace(/<div class="content">/, `<div class="content" data-injected>${injectedContent}`);
|
||||
});
|
||||
@@ -151,7 +151,8 @@ password-based users or from an external service login flow. `options` may come
|
||||
from an untrusted client so make sure to validate any values you read from
|
||||
it. The `user` argument is created on the server and contains a
|
||||
proposed user object with all the automatically generated fields
|
||||
required for the user to log in, including the `_id`.
|
||||
required for the user to log in, including a temporary `_id` (the final _id is
|
||||
generated upon document insertion and not available in this function).
|
||||
|
||||
The function should return the user document (either the one passed in or a
|
||||
newly-created object) with whatever modifications are desired. The returned
|
||||
@@ -297,7 +298,7 @@ The function will be called with a single argument, the info object:
|
||||
{% enddtdd %}
|
||||
|
||||
{% dtdd name:"options" type:"Exception" %}
|
||||
An optional arugment passed down from the oauth service that may contain
|
||||
An optional argument passed down from the oauth service that may contain
|
||||
additional user profile information. As the data in `options` comes from an
|
||||
external source, make sure you validate any values you read from it.
|
||||
{% enddtdd %}
|
||||
|
||||
@@ -19,6 +19,24 @@ login provider packages: `accounts-password`, `accounts-facebook`,
|
||||
|
||||
Read more about customizing user accounts in the [Accounts](http://guide.meteor.com/accounts.html) article in the Meteor Guide.
|
||||
|
||||
<h3 id="accounts-session-storage" name="accounts-session-storage">Accounts with Session Storage</h3>
|
||||
|
||||
By default, Meteor uses Local Storage to store, among other things, login tokens in your browser session. But, for some applications, it makes sense to use Session Storage instead. You can achieve this by adding this to your settings:
|
||||
|
||||
```json
|
||||
{
|
||||
// ... all other settings,
|
||||
"public": {
|
||||
// ... all your public settings
|
||||
"packages": {
|
||||
"accounts": {
|
||||
"clientStorage": "session"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% apibox "Meteor.user" %}
|
||||
|
||||
Retrieves the user record for the current user from
|
||||
@@ -338,3 +356,41 @@ Accounts.ui.config({
|
||||
|
||||
|
||||
Since Meteor 2.7 you can configure these in your Meteor settings under `Meteor.settings.public.packages.accounts-ui-unstyled`.
|
||||
|
||||
<h3 id="initialize-with-custom-settings">Initialize with custom settings</h3>
|
||||
|
||||
This feature allows users to specify custom configuration parameters for both client-side and server-side initialization.
|
||||
|
||||
* Client
|
||||
|
||||
{% apibox "AccountsClient" %}
|
||||
|
||||
On the client-side, AccountsClient can be initialized with custom parameters provided through Meteor settings configuration. Below is an example of how to use this functionality:
|
||||
|
||||
```json
|
||||
{
|
||||
"public": {
|
||||
"packages": {
|
||||
"accounts": {
|
||||
...configParams
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* Server
|
||||
|
||||
{% apibox "AccountsServer" %}
|
||||
|
||||
On the server-side, AccountsServer can also be initialized with custom parameters. Server-specific configuration may differ from the client and can also be specified through Meteor settings. Below is an example of how to do it:
|
||||
|
||||
```json
|
||||
{
|
||||
"packages": {
|
||||
"accounts": {
|
||||
...configParams
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Check
|
||||
desription: Documentation on how to use check, Meteor's type checking library.
|
||||
description: Documentation on how to use check, Meteor's type checking library.
|
||||
---
|
||||
|
||||
The `check` package includes pattern checking functions useful for checking the types and structure
|
||||
@@ -46,6 +46,11 @@ this error gets sent over the wire to the client, it will appear only as
|
||||
`Meteor.Error(400, 'Match Failed')`. The failure details will be written to the
|
||||
server logs but not revealed to the client.
|
||||
|
||||
By default, `check` will throw immediately at the first error encountered. Pass in `{ throwAllErrors: true }` to throw an array of all errors. For example:
|
||||
```js
|
||||
check(message, {/* ... */}, {throwAllErrors: true})
|
||||
```
|
||||
|
||||
{% apibox "Match.test" %}
|
||||
|
||||
`Match.test` can be used to identify if a variable has a certain structure.
|
||||
|
||||
@@ -201,10 +201,10 @@ changes the documents in a cursor will trigger a recomputation. To
|
||||
disable this behavior, pass `{reactive: false}` as an option to
|
||||
`find`.
|
||||
|
||||
Note that when `fields` are specified, only changes to the included
|
||||
Note that when `projection` are specified, only changes to the included
|
||||
fields will trigger callbacks in `observe`, `observeChanges` and
|
||||
invalidations in reactive computations using this cursor. Careful use
|
||||
of `fields` allows for more fine-grained reactivity for computations
|
||||
of `projection` allows for more fine-grained reactivity for computations
|
||||
that don't depend on an entire document.
|
||||
|
||||
On the client, there will be a period of time between when the page loads and
|
||||
@@ -216,6 +216,8 @@ collections will be empty.
|
||||
Equivalent to [`find`](#find)`(selector, options).`[`fetch`](#fetch)`()[0]` with
|
||||
`options.limit = 1`.
|
||||
|
||||
> **Note**: The `fields` option is deprecated in favor of `projection`, which aligns with MongoDB's official terminology and driver. Using `projection` ensures consistency and clarity in specifying which fields to include or exclude in query results.
|
||||
|
||||
{% apibox "Mongo.Collection#findOneAsync" %}
|
||||
|
||||
Async version of [`findOne`](#findOne) that return a `Promise`.
|
||||
@@ -837,6 +839,7 @@ const handle = cursor.observeChanges({
|
||||
setTimeout(() => handle.stop(), 5000);
|
||||
```
|
||||
|
||||
{% apibox "Mongo.getCollection" %}
|
||||
{% apibox "Mongo.ObjectID" %}
|
||||
|
||||
`Mongo.ObjectID` follows the same API as the [Node MongoDB driver
|
||||
@@ -949,30 +952,30 @@ document objects, and returns -1 if the first document comes first in order,
|
||||
1 if the second document comes first, or 0 if neither document comes before
|
||||
the other. This is a Minimongo extension to MongoDB.
|
||||
|
||||
<h2 id="fieldspecifiers">Field Specifiers</h2>
|
||||
<h2 id="fieldspecifiers">Projection Specifiers</h2>
|
||||
|
||||
Queries can specify a particular set of fields to include or exclude from the
|
||||
result object.
|
||||
result object using the `projection` option.
|
||||
|
||||
To exclude specific fields from the result objects, the field specifier is a
|
||||
To exclude specific fields from the result objects, the projection specifier is a
|
||||
dictionary whose keys are field names and whose values are `0`. All unspecified
|
||||
fields are included.
|
||||
|
||||
```js
|
||||
Users.find({}, { fields: { password: 0, hash: 0 } });
|
||||
Users.find({}, { projection: { password: 0, hash: 0 } });
|
||||
```
|
||||
|
||||
To include only specific fields in the result documents, use `1` as
|
||||
the value. The `_id` field is still included in the result.
|
||||
|
||||
```js
|
||||
Users.find({}, { fields: { firstname: 1, lastname: 1 } });
|
||||
Users.find({}, { projection: { firstname: 1, lastname: 1 } });
|
||||
```
|
||||
|
||||
With one exception, it is not possible to mix inclusion and exclusion styles:
|
||||
the keys must either be all 1 or all 0. The exception is that you may specify
|
||||
`_id: 0` in an inclusion specifier, which will leave `_id` out of the result
|
||||
object as well. However, such field specifiers can not be used with
|
||||
object as well. However, such projection specifiers can not be used with
|
||||
[`observeChanges`](#observe_changes), [`observe`](#observe), cursors returned
|
||||
from a [publish function](#meteor_publish), or cursors used in
|
||||
`{% raw %}{{#each}}{% endraw %}` in a template. They may be used with [`fetch`](#fetch),
|
||||
@@ -993,10 +996,12 @@ Users.insert({
|
||||
name: 'Yagami Light',
|
||||
});
|
||||
|
||||
Users.findOne({}, { fields: { 'alterEgos.name': 1, _id: 0 } });
|
||||
Users.findOne({}, { projection: { 'alterEgos.name': 1, _id: 0 } });
|
||||
// Returns { alterEgos: [{ name: 'Kira' }, { name: 'L' }] }
|
||||
```
|
||||
|
||||
> Note: The `fields` option is deprecated in favor of `projection`, which is the standard term used by MongoDB. Using `projection` ensures compatibility with MongoDB's documentation and drivers.
|
||||
|
||||
See <a href="http://docs.mongodb.org/manual/tutorial/project-fields-from-query-results/#projection">
|
||||
the MongoDB docs</a> for details of the nested field rules and array behavior.
|
||||
|
||||
@@ -1082,6 +1087,38 @@ option:
|
||||
You can pass any MongoDB valid option, these are just examples using
|
||||
certificates configurations.
|
||||
|
||||
<h3 id="mongo_oplog_options">Mongo Oplog Options</h3>
|
||||
|
||||
> Oplog options were introduced in Meteor 2.15.1
|
||||
|
||||
If you set the [`MONGO_OPLOG_URL`](https://docs.meteor.com/environment-variables.html#MONGO-OPLOG-URL) env var, Meteor will use MongoDB's Oplog to show efficient, real time updates to your users via your subscriptions.
|
||||
|
||||
Due to how Meteor's Oplog implementation is built behind the scenes, if you have certain collections where you expect **big amounts of write operations**, this might lead to **big CPU spikes on your meteor app server, even if you have no publications/subscriptions on any data/documents of these collections**. For more information on this, please have a look into [this blog post from 2016](https://blog.meteor.com/tuning-meteor-mongo-livedata-for-scalability-13fe9deb8908), [this github discussion from 2022](https://github.com/meteor/meteor/discussions/11842) or [this meteor forums post from 2023](https://forums.meteor.com/t/cpu-spikes-due-to-oplog-updates-without-subscriptions/60028).
|
||||
|
||||
To solve this, **2 Oplog settings** have been introduced **to tweak, which collections are *watched* or *ignored* in the oplog**.
|
||||
|
||||
**Exclusion**: To *exclude* for example all updates/inserts of documents in the 2 collections called `products` and `prices`, you would need to set the following setting in your Meteor settings file:
|
||||
|
||||
```json
|
||||
"packages": {
|
||||
"mongo": {
|
||||
"oplogExcludeCollections": ["products", "prices"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Inclusion**: vice versa, if you only want to watch/*include* the oplog for changes on documents in the 2 collections `chats` and `messages`, you would use:
|
||||
|
||||
```json
|
||||
"packages": {
|
||||
"mongo": {
|
||||
"oplogIncludeCollections": ["chats", "messages"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For obvious reasons, using both `oplogExcludeCollections` and `oplogIncludeCollections` at the same time is not possible and will result in an error.
|
||||
|
||||
<h3 id="mongo_connection_options_settings">Mongo.setConnectionOptions</h3>
|
||||
|
||||
You can also call `Mongo.setConnectionOptions` to set the connection options but
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Core
|
||||
description: Documentation of core Meteor functions.
|
||||
---
|
||||
|
||||
If you prefer to watch the video, click below.
|
||||
If you prefer to watch the video, click below.
|
||||
|
||||
{% youtube 6RRVU0-Vvm8 %}
|
||||
|
||||
@@ -64,3 +64,5 @@ if (Meteor.isServer) {
|
||||
{% apibox "Meteor.isAppTest" %}
|
||||
|
||||
{% apibox "Meteor.isPackageTest" %}
|
||||
|
||||
{% apibox "Meteor.isFibersDisabled" %}
|
||||
|
||||
@@ -80,6 +80,12 @@ with this ID has already been made. Alternatively, you can use
|
||||
|
||||
Read more about methods and how to use them in the [Methods](http://guide.meteor.com/methods.html) article in the Meteor Guide.
|
||||
|
||||
{% apibox "Meteor.isAsyncCall" %}
|
||||
|
||||
This method can be used to determine if the current method invocation is
|
||||
asynchronous. It returns true if the method is running on the server and came from
|
||||
an async call(`Meteor.callAsync`)
|
||||
|
||||
{% apibox "DDPCommon.MethodInvocation#userId" %}
|
||||
|
||||
The user id is an arbitrary string — typically the id of the user record
|
||||
|
||||
@@ -54,16 +54,7 @@ App.launchScreens({
|
||||
'Default@2x~ipad~comany': 'Default@2xipadcomany.png', // (1278x2732) - iPad Pro 12.9"/11"/10.5"/9.7"/7.9" - portrait mode
|
||||
|
||||
// Android
|
||||
'android_mdpi_portrait': 'splash/android_mdpi_portrait.png', // (320x480)
|
||||
'android_mdpi_landscape': { src: 'splash/android_mdpi_landscape.png', srcDarkMode: 'splash/android_mdpi_landscape-night.png' }, // (480x320)
|
||||
'android_hdpi_portrait': 'splash/android_hdpi_portrait.png', // (480x800)
|
||||
'android_hdpi_landscape': 'splash/android_hdpi_landscape.png', // (800x480)
|
||||
'android_xhdpi_portrait': 'splash/android_xhdpi_portrait.png', // (720x1280)
|
||||
'android_xhdpi_landscape': 'splash/android_xhdpi_landscape.png', // (1280x720)
|
||||
'android_xxhdpi_portrait': { src: 'splash/android_xxhdpi_portrait.png', srcDarkMode: 'splash/android_xxhdpi_portrait-night.png'}, // (960x1600)
|
||||
'android_xxhdpi_landscape': 'splash/android_xxhdpi_landscape.png', // (1600x960)
|
||||
'android_xxxhdpi_portrait': 'splash/android_xxxhdpi_portrait.png', // (1280x1920)
|
||||
'android_xxxhdpi_landscape': 'splash/android_xxxhdpi_landscape.png', // (1920x1280)
|
||||
'android_universal': 'splash/android_universal.png', // (320x480)
|
||||
});
|
||||
|
||||
// Set PhoneGap/Cordova preferences.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -27,13 +27,17 @@ include a turn-key user interface for password-based sign-in.
|
||||
|
||||
{% apibox "Accounts.createUser" %}
|
||||
|
||||
Or a promise based version of `Accounts.createUser`:
|
||||
|
||||
{% apibox "Accounts.createUserAsync" %}
|
||||
|
||||
On the client, this function logs in as the newly created user on
|
||||
successful completion. On the server, it returns the newly created user
|
||||
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).
|
||||
@@ -49,18 +53,20 @@ insensitive duplicates before updates.
|
||||
|
||||
{% apibox "Accounts.setUsername" %}
|
||||
|
||||
{% apibox "Accounts.addEmail" %}
|
||||
{% apibox "Accounts.addEmailAsync" %}
|
||||
|
||||
By default, an email address is added with `{ verified: false }`. Use
|
||||
[`Accounts.sendVerificationEmail`](#Accounts-sendVerificationEmail) to send an
|
||||
email with a link the user can use to verify their email address.
|
||||
|
||||
{% apibox "Accounts.replaceEmailAsync" %}
|
||||
|
||||
{% apibox "Accounts.removeEmail" %}
|
||||
|
||||
{% apibox "Accounts.verifyEmail" %}
|
||||
|
||||
If the user trying to verify the email has 2FA enabled, this error will be thrown:
|
||||
* "Email verified, but user not logged in because 2FA is enabled [2fa-enabled]": No longer signing in the user automatically if the user has 2FA enabled.
|
||||
* "Email verified, but user not logged in because 2FA is enabled [2fa-enabled]": No longer signing in the user automatically if the user has 2FA enabled.
|
||||
|
||||
|
||||
This function accepts tokens passed into the callback registered with
|
||||
@@ -96,7 +102,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" %}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ stay subscribed to your private messages.
|
||||
> The following features are available from Meteor 2.4 or `ddp-server@2.5.0`
|
||||
|
||||
Once you start scaling your application you might want to have more control on how the data from publications is being handled on the client.
|
||||
There are three publications strategies:
|
||||
There are four publications strategies:
|
||||
|
||||
#### SERVER_MERGE
|
||||
`SERVER_MERGE` is the default strategy. When using this strategy, the server maintains a copy of all data a connection is subscribed to.
|
||||
@@ -291,12 +291,17 @@ Specifically:
|
||||
* When we receive a change message for a document that is not in the client's collection, it will be added.
|
||||
* When we receive a removed message for a document that is not in the client's collection, nothing will happen.
|
||||
|
||||
#### NO_MERGE_MULTI
|
||||
`NO_MERGE_MULTI` is similar to `NO_MERGE`, but it does track whether a document is used by multiple publications.
|
||||
This has some memory overhead, but it still does not do diffing so it's faster and slimmer than
|
||||
`SERVER_MERGE`.
|
||||
|
||||
You can import the publication strategies from `DDPServer`.
|
||||
|
||||
```js
|
||||
import { DDPServer } from 'meteor/ddp-server'
|
||||
|
||||
const { SERVER_MERGE, NO_MERGE_NO_HISTORY, NO_MERGE } = DDPServer.publicationStrategies
|
||||
const { SERVER_MERGE, NO_MERGE_NO_HISTORY, NO_MERGE, NO_MERGE_MULTI } = DDPServer.publicationStrategies
|
||||
```
|
||||
|
||||
You can use the following methods to set or get the publication strategy for publications:
|
||||
|
||||
122
docs/source/api/top-level-await.md
Normal file
122
docs/source/api/top-level-await.md
Normal file
@@ -0,0 +1,122 @@
|
||||
---
|
||||
title: Top Level Await
|
||||
description: Documentation of how to use top level await in Meteor
|
||||
---
|
||||
|
||||
[Top level await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#top_level_await) (TLA) allows you to use `await` in the top level of a module or file instead of only in async functions. One way to view it as every file runs inside an `async` function.
|
||||
|
||||
Here is an example of using top level await on the server. When this file is loaded, the `await` will cause the module to wait for the count before the code in the rest of the module is run.
|
||||
|
||||
```js
|
||||
const Links = new Mongo.Collection('links');
|
||||
|
||||
// Async code using top level await.
|
||||
// The module waits for this to finish before continuing
|
||||
const count = await Links.find().countAsync();
|
||||
|
||||
if (count === 0) {
|
||||
await Links.insertAsync({ url: 'https://meteor.com' });
|
||||
}
|
||||
```
|
||||
|
||||
In previous versions of Meteor, async code using fibers could be run in the top level of a module. Top level await allows writing similar code that works without fibers. There are a few differences that this article will cover.
|
||||
|
||||
Meteor's implementation of top level await tries to closely follow the specification. There currently are some differences with how Meteor handles circular dependencies.
|
||||
|
||||
## Using Top Level Await
|
||||
|
||||
Top level await can be used in any app or package that uses the `ecmascript`, `typescript`, or `coffeescript` packages, or that uses any other build plugin that compiles top level await using reify.
|
||||
Generally, if you can use ECMAScript modules, then you can also use top level await.
|
||||
|
||||
There are some extra considerations when using top level await in packages. They are covered later in this article.
|
||||
|
||||
Top level await is only enabled by default on the server. You can enable it for the client by setting the env var `METEOR_ENABLE_CLIENT_TOP_LEVEL_AWAIT` to `true`. There are a couple known issues with using TLA on the client:
|
||||
|
||||
1. It breaks any files in `/client/compatibility` since it now wraps those files in a function
|
||||
2. Hot module replacement has not been updated to work with TLA
|
||||
|
||||
## Async Modules
|
||||
|
||||
With top level await, some modules are considered async, which affects how they behave. There are two ways a module can become an async module:
|
||||
1. It uses top level await
|
||||
2. It imports a module that is async
|
||||
|
||||
For example, this module (`setup.js`) would be async because it uses top level await:
|
||||
|
||||
```js
|
||||
await setupLanguages();
|
||||
```
|
||||
|
||||
This module (`main.js`) would be sync:
|
||||
|
||||
```js
|
||||
console.log('in main.js');
|
||||
```
|
||||
|
||||
However, if it imports `setup.js` which does use top level await, then `main.js` also becomes async.
|
||||
|
||||
```js
|
||||
import './setup.js';
|
||||
|
||||
console.log('in main.js');
|
||||
```
|
||||
|
||||
## Require
|
||||
|
||||
When using `require` to load an async module, instead of directly returning a module's exports, it will return a promise that resolves to the module's exports.
|
||||
|
||||
```js
|
||||
// resolves to the exports of init.js
|
||||
const promise = require('./init.js');
|
||||
```
|
||||
|
||||
If you are using `require`, this does mean you need to be careful when adding or removing top level await in a file since you also have to update where the module is required.
|
||||
Since a module becomes async if it depends on an async module, this could affect more than just the individual modules using top level await.
|
||||
|
||||
When possible, you can use ecmascript import syntax or dynamic imports instead so you don't have to worry about which modules are sync or async.
|
||||
|
||||
## Nested Imports
|
||||
|
||||
Nested imports refer to using `import ...` outside of the root of a module, for example in an if block or a function.
|
||||
|
||||
```js
|
||||
if (Meteor.isClient) {
|
||||
import './init-client.js';
|
||||
}
|
||||
|
||||
export function showNotification(message) {
|
||||
import show from './notifications.js';
|
||||
|
||||
show(message);
|
||||
}
|
||||
```
|
||||
|
||||
This is a feature unique to Meteor, so the top level await specification wasn't written to work with nested imports. Using nested imports to import a sync module continues to work, but it will throw an error if used to import an async module. You can use `require` or dynamic imports for async modules in these situations.
|
||||
|
||||
## Using in Packages
|
||||
|
||||
Top level await is only supported starting in Meteor 3. Published build plugins are able to use top level await in older Meteor versions since the runtime is bundled when they are published, though in development they require Meteor 3.
|
||||
|
||||
If you want to ensure your package only runs in versions of Meteor that support top level await, you can have your package use `isobuild:top-level-await`:
|
||||
|
||||
```js
|
||||
Package.onUse(function (api) {
|
||||
// Do not allow this package to be used in pre-Meteor 3 apps.
|
||||
api.use("isobuild:top-level-await@3.0.0");
|
||||
});
|
||||
```
|
||||
|
||||
When importing a package that does not have a lazy main module, it will work the same whether a package uses top level await or not. This is true even when using `require`. This allows packages to add or remove top level await without it being a breaking change.
|
||||
|
||||
There are a couple cases where adding or removing top level await from a module in a package could be considered a breaking change:
|
||||
|
||||
1. If specific modules are require'd from a package. For example: `require('meteor/zodern:aurorae/svelte.js')`. When importing a specific module from a package, `require` changes its behavior based on if the module is async or not.
|
||||
2. If a package that has lazy main modules is require'd. Unlike normal packages, `require` will return a promise if the lazy main module is an async module. Changing if the lazy main module is async or not should be considered a breaking change for the package.
|
||||
|
||||
## Module and Package Execution Order
|
||||
|
||||
Normally, modules are run one at a time. This was even true when using async code with fibers in the root of a module. However, top level await is different - it allows siblings (modules that do not depend on each other) to sometimes run in parallel. This can allow the app to load faster, which is especially important on the client. However, this could cause code to run in an unexpected order if you are used to how Meteor worked with fibers.
|
||||
|
||||
This is also applies to packages. Packages that do not directly or indirectly depend on each other are able to load in parallel if they use top level await.
|
||||
|
||||
Modules that are eagerly evaluated (added in packages with `api.addFiles`, or outside of `imports` in apps that do not have a main module) and not directly imported continue to run one at a time, even if they use top level await, since it is common for these modules to implicitly depend on the previous modules.
|
||||
@@ -80,7 +80,7 @@ If the initial run of an autorun throws an exception, the computation
|
||||
is automatically stopped and won't be rerun.
|
||||
|
||||
### Tracker.autorun and async callbacks
|
||||
`Tracker.autorun` can accept an `async` callback function.
|
||||
`Tracker.autorun` can accept an `async` callback function.
|
||||
To preserve reactivity for the reactive variables inside the async callback function, you must use a `Tracker.withComputation` call as described below:
|
||||
|
||||
{% apibox "Tracker.withComputation" %}
|
||||
@@ -90,13 +90,13 @@ Tracker.autorun(async function example1(computation) {
|
||||
// Code before the first await will stay reactive.
|
||||
reactiveVar1.get(); // This will trigger a rerun.
|
||||
|
||||
let links = await LinksCollection.findAsync({}).fetch(); // First async call will stay reactive.
|
||||
let links = await LinksCollection.find({}).fetchAsync(); // First async call will stay reactive.
|
||||
|
||||
// Code after the first await looses Tracker.currentComputation: no reactivity.
|
||||
reactiveVar2.get(); // This won't trigger a rerun.
|
||||
|
||||
|
||||
// You can bring back reactivity with the Tracker.withCompuation wrapper:
|
||||
let users = await Tracker.withComputation(computation, () => Meteor.users.findAsync({}).fetch());
|
||||
let users = await Tracker.withComputation(computation, () => Meteor.users.find({}).fetchAsync());
|
||||
|
||||
// Code below will again not be reactive, so you will need another Tracker.withComputation.
|
||||
const value = Tracker.withComputation(computation, () => reactiveVar3.get()); // This will trigger a rerun.
|
||||
@@ -112,7 +112,7 @@ The `react-meteor-data` package uses `Tracker.withComputation` to make the `useT
|
||||
More can be seen [here](https://github.com/meteor/react-packages/tree/master/packages/react-meteor-data#maintaining-the-reactive-context)
|
||||
|
||||
### Using async callbacks in versions of Meteor prior to 2.10
|
||||
`Tracker.autorun` can accept an `async` callback function.
|
||||
`Tracker.autorun` can accept an `async` callback function.
|
||||
However, the async call back function will only be dependent on reactive functions called prior to any called functions that return a promise.
|
||||
|
||||
Example 1 - autorun `example1()` **is not** dependent on reactive changes to the `Meteor.users` collection. Because it is dependent on nothing reactive it will run only once:
|
||||
@@ -302,6 +302,41 @@ recomputed at flush time.
|
||||
This property is a convenience to support the common pattern where a
|
||||
computation has logic specific to the first run.
|
||||
|
||||
{% apibox "Tracker.Computation#firstRunPromise" %}
|
||||
|
||||
`Computation.firstRunPromise` will be set to the result of the call of the autorun function after the initial computation has been completed. If the autorun function is an async function, it'll then contain its promise, thus making the completion of the execution await-able. That allows us to manually synchronize autoruns like this:
|
||||
|
||||
```js
|
||||
|
||||
await Tracker.autorun(async () => {
|
||||
await Meteor.userAsync();
|
||||
(...more async code...)
|
||||
}).firstRunPromise;
|
||||
|
||||
await Tracker.autorun(async () => {
|
||||
await asyncSomeOrOther();
|
||||
(...more async code...)
|
||||
}).firstRunPromise;
|
||||
|
||||
```
|
||||
|
||||
For a better developer experience `firstRunPromise` is automatically appended to your async `autorun` calls so you don't have to write them yourself. Meaning this also works:
|
||||
|
||||
```js
|
||||
|
||||
await Tracker.autorun(async () => {
|
||||
await Meteor.userAsync();
|
||||
(...more async code...)
|
||||
});
|
||||
|
||||
await Tracker.autorun(async () => {
|
||||
await asyncSomeOrOther();
|
||||
(...more async code...)
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
|
||||
<h2 id="tracker_dependency"><span>Tracker.Dependency</span></h2>
|
||||
|
||||
A Dependency represents an atomic unit of reactive data that a
|
||||
|
||||
@@ -33,7 +33,7 @@ required.
|
||||
This is the default command. Simply running `meteor` is the
|
||||
same as `meteor run`.
|
||||
|
||||
To pass additional options to Node.js use the `SERVER_NODE_OPTIONS` environment variable. E.g. for Windows PowerShell:
|
||||
To pass additional options to Node.js use the `SERVER_NODE_OPTIONS` environment variable. E.g. for Windows PowerShell:
|
||||
`$env:SERVER_NODE_OPTIONS = '--inspect' | meteor run`. Or for Linux: `SERVER_NODE_OPTIONS=--inspect-brk meteor run`.
|
||||
|
||||
To specify a port to listen on (instead of the default 3000), use `--port [PORT]`.
|
||||
@@ -43,6 +43,9 @@ For example: `meteor run --port 4000`
|
||||
will run the development server on `http://localhost:4000`
|
||||
and the development MongoDB instance on `mongodb://localhost:4001`.
|
||||
|
||||
To open your default browser you can pass the `--open` flag.
|
||||
For example: `meteor run --open`
|
||||
|
||||
Run `meteor help run` to see the full list of options.
|
||||
|
||||
<h2 id="meteordebug">meteor debug</h2>
|
||||
@@ -83,21 +86,24 @@ option to other `meteor` tool commands, such as `meteor run` and `meteor test-pa
|
||||
|
||||
<h2 id="meteorcreate">meteor create <i>app-name</i></h2>
|
||||
|
||||
The command `meteor create app-name` is the default command for creating a new Meteor project. It creates a subdirectory
|
||||
named `app-name` and copies a template app into it. You can pass an absolute or relative path. If you pass a relative
|
||||
The command `meteor create app-name` is the default command for creating a new Meteor project. It creates a subdirectory
|
||||
named `app-name` and copies a template app into it. You can pass an absolute or relative path. If you pass a relative
|
||||
path, it will be resolved relative to the current working directory. By default, it generates a React project.
|
||||
|
||||
See the flags below to learn how you can generate different types of apps.
|
||||
|
||||
Using only `meteor create` will create a promt to help you choose the type of app you want to create,
|
||||
giving you the options with the flags below.
|
||||
|
||||
|
||||
<h3 id="apollo">--apollo</h3>
|
||||
|
||||
The command `meteor create --apollo app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[Apollo](https://www.apollographql.com/) (GraphQL), and [MongoDB](https://www.mongodb.com/). To create a complete app,
|
||||
including testing and deployment, follow the [React tutorial](https://react-tutorial.meteor.com/). To learn how to use
|
||||
The command `meteor create --apollo app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[Apollo](https://www.apollographql.com/) (GraphQL), and [MongoDB](https://www.mongodb.com/). To create a complete app,
|
||||
including testing and deployment, follow the [React tutorial](https://react-tutorial.meteor.com/). To learn how to use
|
||||
Apollo, refer to the [GraphQL section](https://react-tutorial.meteor.com/simple-todos-graphql/).
|
||||
|
||||
Npm packages included: `@apollo/client`, `@apollo/server`, `@babel/runtime`, `body-parser`, `express`,
|
||||
Npm packages included: `@apollo/client`, `@apollo/server`, `@babel/runtime`, `body-parser`, `express`,
|
||||
`graphql` `meteor-node-stubs`, `react`, `react-dom`.
|
||||
|
||||
Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive-var`, `standard-minifier-css`,
|
||||
@@ -107,7 +113,7 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
|
||||
<h3 id="bare">--bare</h3>
|
||||
|
||||
The command `meteor create --bare app-name` creates an empty Meteor app with [Blaze](https://blazejs.org) and
|
||||
The command `meteor create --bare app-name` creates an empty Meteor app with [Blaze](https://blazejs.org) and
|
||||
[MongoDB](https://www.mongodb.com/). To create a complete app, including testing and deployment, follow the
|
||||
[Blaze tutorial](https://blaze-tutorial.meteor.com/).
|
||||
|
||||
@@ -119,22 +125,22 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
|
||||
<h3 id="blaze-app">--blaze</h3>
|
||||
|
||||
The command `meteor create --blaze app-name` creates a Meteor app with [Blaze](https://blazejs.org) and
|
||||
The command `meteor create --blaze app-name` creates a Meteor app with [Blaze](https://blazejs.org) and
|
||||
[MongoDB](https://www.mongodb.com/). To create a complete app, including testing and deployment, follow the
|
||||
[Blaze tutorial](https://blaze-tutorial.meteor.com/).
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `jquery`.
|
||||
|
||||
Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `blaze-html-templates`, `jquery`, `reactive-var`,
|
||||
`tracker`, `standard-minifier-css`, `standard-minifier-js`, `es5-shim`, `ecmascript`, `typescript`, `shell-server`,
|
||||
`tracker`, `standard-minifier-css`, `standard-minifier-js`, `es5-shim`, `ecmascript`, `typescript`, `shell-server`,
|
||||
`hot-module-replacement`, `blaze-hot`.
|
||||
|
||||
|
||||
<h3 id="chakra-ui">--chakra-ui</h3>
|
||||
|
||||
The command `meteor create --chakra-ui app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[Chakra-UI](https://chakra-ui.com/), and [MongoDB](https://www.mongodb.com/). To create a complete app, including
|
||||
testing and deployment, follow the [React tutorial](https://react-tutorial.meteor.com/). To learn how to use Chakra-UI,
|
||||
The command `meteor create --chakra-ui app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[Chakra-UI](https://chakra-ui.com/), and [MongoDB](https://www.mongodb.com/). To create a complete app, including
|
||||
testing and deployment, follow the [React tutorial](https://react-tutorial.meteor.com/). To learn how to use Chakra-UI,
|
||||
refer to the [Simple Tasks](https://github.com/fredmaiaarantes/simpletasks) example.
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `react`, `react-dom`, `@chakra-ui/icons`, `@chakra-ui/react`, `@emotion/react`
|
||||
@@ -147,10 +153,10 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
|
||||
<h3 id="full">--full</h3>
|
||||
|
||||
The command `meteor create --full app-name` creates a Meteor app with [Blaze](https://blazejs.org) and
|
||||
The command `meteor create --full app-name` creates a Meteor app with [Blaze](https://blazejs.org) and
|
||||
[MongoDB](https://www.mongodb.com/). It creates a more complete, imports-based project that closely matches the
|
||||
[file structure](https://guide.meteor.com/structure.html#javascript-structure) recommended by the
|
||||
[Meteor Guide](https://guide.meteor.com/). To create a complete app, including testing and deployment, follow the
|
||||
[file structure](https://guide.meteor.com/structure.html#javascript-structure) recommended by the
|
||||
[Meteor Guide](https://guide.meteor.com/). To create a complete app, including testing and deployment, follow the
|
||||
[Blaze tutorial](https://blaze-tutorial.meteor.com/).
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `jquery`, `chai`.
|
||||
@@ -172,7 +178,7 @@ Meteor packages included: `meteor`, `standard-minifier-css`, `standard-minifier-
|
||||
|
||||
<h3 id="package">--package</h3>
|
||||
|
||||
The command `meteor create --package package-name` creates a new package. If used in an existing app, it will create a
|
||||
The command `meteor create --package package-name` creates a new package. If used in an existing app, it will create a
|
||||
package in the `packages` directory. Check the [Meteor Guide](https://guide.meteor.com/writing-atmosphere-packages.html)
|
||||
for more information on how to get started writing packages.
|
||||
|
||||
@@ -180,7 +186,7 @@ for more information on how to get started writing packages.
|
||||
<h3 id="prototype">--prototype</h3>
|
||||
|
||||
The command `meteor create --prototype app-name` creates a project with the prototype purpose packages (`autopublish`
|
||||
and `insecure`). If you use them, you can change your collections quickly and create prototype apps very quickly.
|
||||
and `insecure`). If you use them, you can change your collections quickly and create prototype apps very quickly.
|
||||
However, these packages are not supposed to be used in production.
|
||||
|
||||
For more information about security, you can read our [security checklist](https://guide.meteor.com/security.html#checklist).
|
||||
@@ -189,28 +195,28 @@ It can be used with other flags that create apps, such as `--react`, `blaze`, or
|
||||
|
||||
<h3 id="react">--react</h3>
|
||||
|
||||
The command `meteor create --react app-name` creates a Meteor app with [React](https://react.dev/) and
|
||||
[MongoDB](https://www.mongodb.com/). It functions in the same way as if you don't use any flags. To create a complete
|
||||
The command `meteor create --react app-name` creates a Meteor app with [React](https://react.dev/) and
|
||||
[MongoDB](https://www.mongodb.com/). It functions in the same way as if you don't use any flags. To create a complete
|
||||
app, including testing and deployment, follow the [React tutorial](https://react-tutorial.meteor.com/).
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `react`, `react-dom`.
|
||||
|
||||
Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive-var`, `standard-minifier-css`,
|
||||
Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive-var`, `standard-minifier-css`,
|
||||
`standard-minifier-js`, `es5-shim`, `ecmascript`, `typescript`, `shell-server`, `hot-module-replacement`, `static-html`,
|
||||
`react-meteor-data`.
|
||||
|
||||
|
||||
<h3 id="release">--release</h3>
|
||||
|
||||
The command `meteor create app-name --release {meteor-version}` creates a Meteor app with the release specified in the
|
||||
command. For instance, you can create a Meteor app with the `2.8` release using `meteor create app-name --release 2.8`.
|
||||
By default, it generates a React app, but you can use it with other flags that create apps such as `--blaze`,
|
||||
The command `meteor create app-name --release {meteor-version}` creates a Meteor app with the release specified in the
|
||||
command. For instance, you can create a Meteor app with the `2.8` release using `meteor create app-name --release 2.8`.
|
||||
By default, it generates a React app, but you can use it with other flags that create apps such as `--blaze`,
|
||||
`--svelte`, `--vue`, or `--typescript`.
|
||||
|
||||
|
||||
<h3 id="solid">--solid</h3>
|
||||
|
||||
The command `meteor create --solid app-name` creates a Meteor app with [Solid](https://www.solidjs.com/),
|
||||
The command `meteor create --solid app-name` creates a Meteor app with [Solid](https://www.solidjs.com/),
|
||||
[Vite](https://vitejs.dev/), and [MongoDB](https://www.mongodb.com/). You can see an example on the
|
||||
[meteor-solid-app](https://github.com/fredmaiaarantes/meteor-solid-app/releases/tag/milestone-2.0) repository.
|
||||
|
||||
@@ -223,7 +229,7 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
|
||||
<h3 id="svelte">--svelte</h3>
|
||||
|
||||
The command `meteor create --svelte app-name` creates a Meteor app with [Svelte](https://svelte.dev/) and
|
||||
The command `meteor create --svelte app-name` creates a Meteor app with [Svelte](https://svelte.dev/) and
|
||||
[MongoDB](https://www.mongodb.com/). To create a complete app, including testing and deployment, follow the
|
||||
[Svelte tutorial](https://svelte-tutorial.meteor.com/).
|
||||
|
||||
@@ -239,7 +245,7 @@ You can see an example on the [meteor-vite](https://github.com/JorgenVatle/meteo
|
||||
|
||||
<h3 id="tailwind">--tailwind</h3>
|
||||
|
||||
The command `meteor create --tailwind app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
The command `meteor create --tailwind app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[Tailwind CSS](https://tailwindcss.com), and [MongoDB](https://www.mongodb.com/).
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `react`, `react-dom`, `autoprefixer`, `postcss`, `postcss-load-config`, `tailwindcss`.
|
||||
@@ -251,9 +257,9 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
|
||||
<h3 id="typescript">--typescript</h3>
|
||||
|
||||
The command `meteor create --typescript app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[TypeScript](https://www.typescriptlang.org/), and [MongoDB](https://www.mongodb.com/). Check the
|
||||
[Meteor Guide](https://guide.meteor.com/build-tool.html#typescript) for more information about TypeScript and how to
|
||||
The command `meteor create --typescript app-name` creates a Meteor app with [React](https://react.dev/),
|
||||
[TypeScript](https://www.typescriptlang.org/), and [MongoDB](https://www.mongodb.com/). Check the
|
||||
[Meteor Guide](https://guide.meteor.com/build-tool.html#typescript) for more information about TypeScript and how to
|
||||
use it with other UI frameworks.
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `react`, `react-dom`, `@types/mocha`, `@types/node`, `@types/react`, `@types/react-dom`, `typescript`.
|
||||
@@ -265,8 +271,8 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
|
||||
<h3 id="vue">--vue</h3>
|
||||
|
||||
The command `meteor create --vue app-name` creates a Meteor app with [Vue 3](https://vuejs.org/),
|
||||
[Tailwind CSS](https://tailwindcss.com), [Vite](https://vitejs.dev/), and [MongoDB](https://www.mongodb.com/). To
|
||||
The command `meteor create --vue app-name` creates a Meteor app with [Vue 3](https://vuejs.org/),
|
||||
[Tailwind CSS](https://tailwindcss.com), [Vite](https://vitejs.dev/), and [MongoDB](https://www.mongodb.com/). To
|
||||
create a complete app, including testing and deployment, follow the [Vue 3 tutorial](https://vue3-tutorial.meteor.com/).
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `vue`, `vue-meteor-tracker`, `vue-router`, `@types/meteor`, `@vitejs/plugin-vue`, `autoprefixer`, `postcss`, `tailwindcss`, `vite`.
|
||||
@@ -276,23 +282,9 @@ Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive
|
||||
`vite:bundler`.
|
||||
|
||||
You can also use Vue 3 with Vite by using the [jorgenvatle:meteor-vite](https://github.com/JorgenVatle/meteor-vite)
|
||||
package. You can see an example on the [meteor-vite](https://github.com/JorgenVatle/meteor-vite/tree/release/examples/vue)
|
||||
package. You can see an example on the [meteor-vite](https://github.com/JorgenVatle/meteor-vite/tree/release/examples/vue)
|
||||
repository.
|
||||
|
||||
|
||||
<h3 id="vue-2">--vue-2</h3>
|
||||
|
||||
The command `meteor create --vue-2 app-name` creates a Meteor app with [Vue 2](https://v2.vuejs.org/) and
|
||||
[MongoDB](https://www.mongodb.com/). To create a complete app, including testing and deployment, follow the
|
||||
[Vue 2 tutorial](https://vue-tutorial.meteor.com/).
|
||||
|
||||
Npm packages included: `@babel/runtime`, `meteor-node-stubs`, `vue`, `vue-meteor-tracker`.
|
||||
|
||||
Meteor packages included: `meteor-base`, `mobile-experience`, `mongo`, `reactive-var`, `standard-minifier-css`,
|
||||
`standard-minifier-js`, `es5-shim`, `ecmascript`, `typescript`, `shell-server`, `tracker`, `static-html`, `akryum:vue-component`,
|
||||
`meteortesting:mocha`, `johanbrook:publication-collector`.
|
||||
|
||||
|
||||
<h2 id="meteorgenerate"> meteor generate </h2>
|
||||
|
||||
``meteor generate`` is a command for generating scaffolds for your current project. When ran without arguments, it will ask
|
||||
@@ -303,7 +295,7 @@ used as a command line only operation as well.
|
||||
> By default, the generator will use JavaScript but if it detects that you have a
|
||||
``tsconfig.json`` file in your project, it will use TypeScript instead.
|
||||
|
||||
running
|
||||
running
|
||||
```bash
|
||||
meteor generate customer
|
||||
|
||||
@@ -511,7 +503,7 @@ It will prompt the following questions.
|
||||
|
||||
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
<h3 id="meteorgenerate-templating"> Using your own template </h3>
|
||||
|
||||
@@ -533,7 +525,7 @@ You can use your own templates for scaffolding your specific workloads. To do th
|
||||
Out of the box is provided a few functions such as replacing ``$$name$$``, ``$$PascalName$$`` and ``$$camelName$$``
|
||||
|
||||
these replacements come from this function:
|
||||
|
||||
|
||||
_Note that scaffoldName is the name that you have passed as argument_
|
||||
|
||||
```js
|
||||
@@ -661,7 +653,7 @@ If you want to connect to your free MongoDB shared cluster using your on setting
|
||||
```
|
||||
packages: {
|
||||
mongo: {
|
||||
options: {
|
||||
options: {
|
||||
tlsAllowInvalidCertificates: true,
|
||||
},
|
||||
},
|
||||
@@ -685,7 +677,7 @@ Your project should be a git repository as the commit hash is going to be used t
|
||||
The `cache-build` option is available since Meteor 1.11.
|
||||
{% endpullquote %}
|
||||
|
||||
With the argument `--container-size` you can change your app's container size using the deploy command. The valid arguments are: `tiny`, `compact`, `standard`, `double`, `quad`, `octa`, and `dozen`. One more thing to note here is that the `--container-size` flag can only be used when the `--plan` option is already specified, otherwise using the `--container-size` option will throw an error with the message : `Error deploying application: Internal error`. To see more about the difference and prices of each one you can check [here](https://www.meteor.com/cloud#pricing-section).
|
||||
With the argument `--container-size` you can change your app's container size using the deploy command. The valid arguments are: `tiny`, `compact`, `standard`, `double`, `quad`, `octa`, and `dozen`. One more thing to note here is that the `--container-size` flag can only be used when the `--plan` option is already specified, otherwise using the `--container-size` option will throw an error with the message : `Error deploying application: Internal error`. To see more about the difference and prices of each one you can check [here](https://galaxycloud.app/meteorjs/pricing).
|
||||
|
||||
{% pullquote warning %}
|
||||
The `--container-size` option is available since Meteor 2.4.1.
|
||||
@@ -912,7 +904,7 @@ upload the build to the architecture that you were using to publish it. You can
|
||||
use `publish-for-arch` to upload a build to a different architecture from a
|
||||
different machine.
|
||||
|
||||
If you have already published a package but need to update it's metadata
|
||||
If you have already published a package but need to update it's metadata
|
||||
(the content of `Package.describe`) or the README you can actually achieve this
|
||||
via `meteor publish --update`.
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ See also: [`PORT`](#PORT).
|
||||
> In development, this can be accomplished with `meteor run --port a.b.c.d:port`.
|
||||
|
||||
## DDP_DEFAULT_CONNECTION_URL
|
||||
(_develoment, production_)
|
||||
(_development, production_)
|
||||
|
||||
There are some situations where it is valuable for the meteor client to use a different DDP server than the `ROOT_URL` server.
|
||||
|
||||
@@ -33,6 +33,11 @@ In the event that your own deployment platform does not support WebSockets, or y
|
||||
|
||||
Set `DISABLE_SOCKJS=1` if you want to use the native WebSocket implementation instead of SockJS on the client side, for example, if you want to use a custom WebSocket implementation (e.g. [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js/)) on the server side.
|
||||
|
||||
## DISABLE_SOCKJS_CORS
|
||||
(_development, production_)
|
||||
|
||||
Set `DISABLE_SOCKJS_CORS=1` if you want to prevent SockJS from setting CORS headers. Do not set this option if you will have DDP clients from other origins connecting to the DDP server.
|
||||
|
||||
## HTTP_FORWARDED_COUNT
|
||||
(_production_)
|
||||
|
||||
@@ -72,7 +77,7 @@ When running your bundled application in production mode, pass a string of JSON
|
||||
## METEOR_SQLITE_JOURNAL_MODE
|
||||
(_development_)
|
||||
|
||||
The Meteor package catalog uses the `WAL` [SQLite Journal Mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) by default. The Journal mode for the package catalog can be modifed by setting `METEOR_SQLITE_JOURNAL_MODE`.
|
||||
The Meteor package catalog uses the `WAL` [SQLite Journal Mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) by default. The Journal mode for the package catalog can be modified by setting `METEOR_SQLITE_JOURNAL_MODE`.
|
||||
|
||||
When running multiple concurrent meteor servers on [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/) some meteor developers have seen issues with the package catalog. Setting the environment variable `METEOR_SQLITE_JOURNAL_MODE=TRUNCATE` can overcome the issue.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Docs
|
||||
---
|
||||
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.0 is in progress, and it will run on the latest Node.js version. For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html).
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3 has been released with support for the latest Node.js LTS version. For more information, please consult our [migration guide](https://v3-migration-docs.meteor.com/) and the [latest docs](https://v3-docs.meteor.com).
|
||||
|
||||
<!-- XXX: note that this content is somewhat duplicated on the guide, and should be updated in parallel -->
|
||||
<h2 id="what-is-meteor">What is Meteor?</h2>
|
||||
@@ -24,11 +24,11 @@ Meteor is a full-stack JavaScript platform for developing modern web and mobile
|
||||
1. The place to get started with Meteor is the [tutorials page](https://www.meteor.com/developers/tutorials).
|
||||
|
||||
1. [Meteor Examples](https://github.com/meteor/examples) is a list of examples using Meteor. You can also include your example with Meteor.
|
||||
|
||||
|
||||
1. Once you are familiar with the basics, the [Meteor Guide](http://guide.meteor.com) covers intermediate material on how to use Meteor in a larger scale app.
|
||||
|
||||
1. Visit the [Meteor discussion forums](https://forums.meteor.com) to announce projects, get help, talk about the community, or discuss changes to core.
|
||||
|
||||
|
||||
1. [Meteor Slack Community](https://join.slack.com/t/meteor-community/shared_invite/enQtODA0NTU2Nzk5MTA3LWY5NGMxMWRjZDgzYWMyMTEyYTQ3MTcwZmU2YjM5MTY3MjJkZjQ0NWRjOGZlYmIxZjFlYTA5Mjg4OTk3ODRiOTc) is the best place to ask (and answer!) technical questions and also meet Meteor developers.
|
||||
|
||||
1. [Atmosphere](https://atmospherejs.com) is the repository of community packages designed especially for Meteor.
|
||||
|
||||
@@ -8,7 +8,7 @@ You need to install the Meteor command line tool to create, run, and manage your
|
||||
|
||||
<h3 id="prereqs-node">Node.js version</h3>
|
||||
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.0 is in progress, and it will run on the latest Node.js version. For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html).
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3 has been released with support for the latest Node.js LTS version. For more information, please consult our [migration guide](https://v3-migration-docs.meteor.com/) and the [latest docs](https://v3-docs.meteor.com).
|
||||
|
||||
- Node.js version >= 10 and <= 14 is required.
|
||||
- We recommend you using [nvm](https://github.com/nvm-sh/nvm) or [Volta](https://volta.sh/) for managing Node.js versions.
|
||||
@@ -30,10 +30,13 @@ You need to install the Meteor command line tool to create, run, and manage your
|
||||
|
||||
Install the latest official version of Meteor.js from your terminal by running one of the commands below. You can check our [changelog](https://docs.meteor.com/changelog.html) for the release notes.
|
||||
|
||||
> Run `node -v` to ensure you are using Node.js 14. Meteor 3.0 is in progress, and it will run on the latest Node.js version.
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3 is released with support for the latest Node.js LTS version.
|
||||
> For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html) and the [new docs](https://docs.meteor.com/).
|
||||
|
||||
For Windows, Linux and OS X, you can run the following command:
|
||||
|
||||
> Preferably, do not use `sudo` to install Meteor. If you need to use `sudo`, please check the [troubleshooting section](#troubleshooting).
|
||||
|
||||
```bash
|
||||
npm install -g meteor
|
||||
```
|
||||
@@ -67,6 +70,8 @@ If you only use sudo because of a distribution default permission system, [check
|
||||
|
||||
In some cases you can get this error `npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules` because your Node.js installation was performed with wrong permissions. An easy way to fix this is to install Node.js using [nvm](https://github.com/nvm-sh/nvm) and forcing it to be used in your terminal. You can force it in the current session of your terminal by running `nvm use 14`.
|
||||
|
||||
As a last resort you can delete the `.meteor` folder in your home directory and try to install Meteor again using the correct permissions.
|
||||
|
||||
<h2 id="path-management">PATH management</h2>
|
||||
|
||||
By default, the Meteor installer adds its install path (by default, `~/.meteor/`) to your PATH by updating either your `.bashrc`, `.bash_profile`, or `.zshrc` as appropriate. To disable this behavior, install Meteor by running:
|
||||
@@ -118,5 +123,4 @@ If you installed Meteor using npm, you can remove it by running:
|
||||
|
||||
If you installed Meteor using curl, you can remove it by running:
|
||||
`rm -rf ~/.meteor`
|
||||
`sudo rm /usr/local/bin/meteor`
|
||||
|
||||
`sudo rm /usr/local/bin/meteor`
|
||||
|
||||
@@ -3,7 +3,7 @@ title: fetch
|
||||
description: Isomorphic modern/legacy/Node polyfill for WHATWG fetch().
|
||||
---
|
||||
|
||||
This package replaces the `http` package for HTTP calls. `fetch` package provides polyfill for the [WHATWG fetch specification](https://fetch.spec.whatwg.org/) for legacy browsers or defaults to the global class which is available in modern browsers and Node. It is recomended that you use this package for compatibility with non-modern browsers.
|
||||
This package replaces the `http` package for HTTP calls. `fetch` package provides polyfill for the [WHATWG fetch specification](https://fetch.spec.whatwg.org/) for legacy browsers or defaults to the global class which is available in modern browsers and Node. It is recommended that you use this package for compatibility with non-modern browsers.
|
||||
|
||||
For more information we recommend [reading the MDN articles](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) about it as this article covers only basic usage in Meteor.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ title: logging
|
||||
description: Documentation of Meteor's logging utility
|
||||
---
|
||||
|
||||
The `logging` package provides a standartised way for you to log and display in console various message from your application.
|
||||
The `logging` package provides a standardised way for you to log and display in console various message from your application.
|
||||
The added benefit is that among other data it will show you the location where the log was fired,
|
||||
this is useful during debugging to quickly locate where the message is coming from.
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ import { exportedPackageMethod } from "meteor/<package name>";
|
||||
```
|
||||
|
||||
> Note: Packages with `lazy` main modules cannot use `api.export` to export global
|
||||
symbols to other packages/apps. Also, prior to Meteor 1.4.4.2 it is neccessary to explicitly name the file containing the module: `import "meteor/<package name>/client.js"`.
|
||||
symbols to other packages/apps. Also, prior to Meteor 1.4.4.2 it is necessary to explicitly name the file containing the module: `import "meteor/<package name>/client.js"`.
|
||||
|
||||
|
||||
## Local `node_modules`
|
||||
|
||||
@@ -31,10 +31,16 @@ the top level of your source file), not called from inside of a
|
||||
`Meteor.startup` block.
|
||||
|
||||
To avoid storing the secret key in your application's source code, you
|
||||
can use [`Meteor.settings`](http://docs.meteor.com/#meteor_settings):
|
||||
can provide the same value under [`Meteor.settings.packages.accounts-base.oauthSecretKey`](http://docs.meteor.com/#meteor_settings):
|
||||
|
||||
```js
|
||||
Accounts.config({ oauthSecretKey: Meteor.settings.oauthSecretKey });
|
||||
```json
|
||||
{
|
||||
"packages": {
|
||||
"accounts-base": {
|
||||
"oauthSecretKey": "onsqJ+1e4iGFlV0nhZYobg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
158
docs/source/packages/packages-listing.md
Normal file
158
docs/source/packages/packages-listing.md
Normal file
@@ -0,0 +1,158 @@
|
||||
|
||||
---
|
||||
title: Core Package Listing
|
||||
description: list of all Meteor core packages.
|
||||
---
|
||||
|
||||
[//]: # (Do not edit this file by hand.)
|
||||
|
||||
[//]: # (This is a generated file.)
|
||||
|
||||
[//]: # (If you want to change something in this file)
|
||||
|
||||
[//]: # (go to meteor/docs/generators/packages-listing)
|
||||
|
||||
# Core Packages
|
||||
|
||||
|
||||
- [blaze](https://github.com/meteor/blaze)
|
||||
- [react-packages](https://github.com/meteor/react-packages)
|
||||
- [accounts-2fa](https://github.com/meteor/meteor/tree/devel/packages/accounts-2fa)
|
||||
- [accounts-base](https://github.com/meteor/meteor/tree/devel/packages/accounts-base)
|
||||
- [accounts-facebook](https://github.com/meteor/meteor/tree/devel/packages/accounts-facebook)
|
||||
- [accounts-github](https://github.com/meteor/meteor/tree/devel/packages/accounts-github)
|
||||
- [accounts-google](https://github.com/meteor/meteor/tree/devel/packages/accounts-google)
|
||||
- [accounts-meetup](https://github.com/meteor/meteor/tree/devel/packages/accounts-meetup)
|
||||
- [accounts-meteor-developer](https://github.com/meteor/meteor/tree/devel/packages/accounts-meteor-developer)
|
||||
- [accounts-oauth](https://github.com/meteor/meteor/tree/devel/packages/accounts-oauth)
|
||||
- [accounts-password](https://github.com/meteor/meteor/tree/devel/packages/accounts-password)
|
||||
- [accounts-passwordless](https://github.com/meteor/meteor/tree/devel/packages/accounts-passwordless)
|
||||
- [accounts-twitter](https://github.com/meteor/meteor/tree/devel/packages/accounts-twitter)
|
||||
- [accounts-ui](https://github.com/meteor/meteor/tree/devel/packages/accounts-ui)
|
||||
- [accounts-ui-unstyled](https://github.com/meteor/meteor/tree/devel/packages/accounts-ui-unstyled)
|
||||
- [accounts-weibo](https://github.com/meteor/meteor/tree/devel/packages/accounts-weibo)
|
||||
- [allow-deny](https://github.com/meteor/meteor/tree/devel/packages/allow-deny)
|
||||
- [audit-argument-checks](https://github.com/meteor/meteor/tree/devel/packages/audit-argument-checks)
|
||||
- [autopublish](https://github.com/meteor/meteor/tree/devel/packages/autopublish)
|
||||
- [autoupdate](https://github.com/meteor/meteor/tree/devel/packages/autoupdate)
|
||||
- [babel-compiler](https://github.com/meteor/meteor/tree/devel/packages/babel-compiler)
|
||||
- [babel-runtime](https://github.com/meteor/meteor/tree/devel/packages/babel-runtime)
|
||||
- [base64](https://github.com/meteor/meteor/tree/devel/packages/base64)
|
||||
- [binary-heap](https://github.com/meteor/meteor/tree/devel/packages/binary-heap)
|
||||
- [boilerplate-generator](https://github.com/meteor/meteor/tree/devel/packages/boilerplate-generator)
|
||||
- [boilerplate-generator-tests](https://github.com/meteor/meteor/tree/devel/packages/boilerplate-generator-tests)
|
||||
- [browser-policy](https://github.com/meteor/meteor/tree/devel/packages/browser-policy)
|
||||
- [browser-policy-common](https://github.com/meteor/meteor/tree/devel/packages/browser-policy-common)
|
||||
- [browser-policy-content](https://github.com/meteor/meteor/tree/devel/packages/browser-policy-content)
|
||||
- [browser-policy-framing](https://github.com/meteor/meteor/tree/devel/packages/browser-policy-framing)
|
||||
- [caching-compiler](https://github.com/meteor/meteor/tree/devel/packages/caching-compiler)
|
||||
- [callback-hook](https://github.com/meteor/meteor/tree/devel/packages/callback-hook)
|
||||
- [check](https://github.com/meteor/meteor/tree/devel/packages/check)
|
||||
- [constraint-solver](https://github.com/meteor/meteor/tree/devel/packages/constraint-solver)
|
||||
- [context](https://github.com/meteor/meteor/tree/devel/packages/context)
|
||||
- [crosswalk](https://github.com/meteor/meteor/tree/devel/packages/crosswalk)
|
||||
- [ddp](https://github.com/meteor/meteor/tree/devel/packages/ddp)
|
||||
- [ddp-client](https://github.com/meteor/meteor/tree/devel/packages/ddp-client)
|
||||
- [ddp-common](https://github.com/meteor/meteor/tree/devel/packages/ddp-common)
|
||||
- [ddp-rate-limiter](https://github.com/meteor/meteor/tree/devel/packages/ddp-rate-limiter)
|
||||
- [ddp-server](https://github.com/meteor/meteor/tree/devel/packages/ddp-server)
|
||||
- [deprecated](https://github.com/meteor/meteor/tree/devel/packages/deprecated)
|
||||
- [dev-error-overlay](https://github.com/meteor/meteor/tree/devel/packages/dev-error-overlay)
|
||||
- [diff-sequence](https://github.com/meteor/meteor/tree/devel/packages/diff-sequence)
|
||||
- [disable-oplog](https://github.com/meteor/meteor/tree/devel/packages/disable-oplog)
|
||||
- [dynamic-import](https://github.com/meteor/meteor/tree/devel/packages/dynamic-import)
|
||||
- [ecmascript](https://github.com/meteor/meteor/tree/devel/packages/ecmascript)
|
||||
- [ecmascript-runtime](https://github.com/meteor/meteor/tree/devel/packages/ecmascript-runtime)
|
||||
- [ecmascript-runtime-client](https://github.com/meteor/meteor/tree/devel/packages/ecmascript-runtime-client)
|
||||
- [ecmascript-runtime-server](https://github.com/meteor/meteor/tree/devel/packages/ecmascript-runtime-server)
|
||||
- [ejson](https://github.com/meteor/meteor/tree/devel/packages/ejson)
|
||||
- [email](https://github.com/meteor/meteor/tree/devel/packages/email)
|
||||
- [es5-shim](https://github.com/meteor/meteor/tree/devel/packages/es5-shim)
|
||||
- [facebook-config-ui](https://github.com/meteor/meteor/tree/devel/packages/facebook-config-ui)
|
||||
- [facebook-oauth](https://github.com/meteor/meteor/tree/devel/packages/facebook-oauth)
|
||||
- [facts-base](https://github.com/meteor/meteor/tree/devel/packages/facts-base)
|
||||
- [facts-ui](https://github.com/meteor/meteor/tree/devel/packages/facts-ui)
|
||||
- [fetch](https://github.com/meteor/meteor/tree/devel/packages/fetch)
|
||||
- [force-ssl](https://github.com/meteor/meteor/tree/devel/packages/force-ssl)
|
||||
- [force-ssl-common](https://github.com/meteor/meteor/tree/devel/packages/force-ssl-common)
|
||||
- [geojson-utils](https://github.com/meteor/meteor/tree/devel/packages/geojson-utils)
|
||||
- [github-config-ui](https://github.com/meteor/meteor/tree/devel/packages/github-config-ui)
|
||||
- [github-oauth](https://github.com/meteor/meteor/tree/devel/packages/github-oauth)
|
||||
- [google-config-ui](https://github.com/meteor/meteor/tree/devel/packages/google-config-ui)
|
||||
- [google-oauth](https://github.com/meteor/meteor/tree/devel/packages/google-oauth)
|
||||
- [hot-code-push](https://github.com/meteor/meteor/tree/devel/packages/hot-code-push)
|
||||
- [hot-module-replacement](https://github.com/meteor/meteor/tree/devel/packages/hot-module-replacement)
|
||||
- [id-map](https://github.com/meteor/meteor/tree/devel/packages/id-map)
|
||||
- [insecure](https://github.com/meteor/meteor/tree/devel/packages/insecure)
|
||||
- [inter-process-messaging](https://github.com/meteor/meteor/tree/devel/packages/inter-process-messaging)
|
||||
- [launch-screen](https://github.com/meteor/meteor/tree/devel/packages/launch-screen)
|
||||
- [localstorage](https://github.com/meteor/meteor/tree/devel/packages/localstorage)
|
||||
- [logging](https://github.com/meteor/meteor/tree/devel/packages/logging)
|
||||
- [logic-solver](https://github.com/meteor/meteor/tree/devel/packages/logic-solver)
|
||||
- [meetup-config-ui](https://github.com/meteor/meteor/tree/devel/packages/meetup-config-ui)
|
||||
- [meetup-oauth](https://github.com/meteor/meteor/tree/devel/packages/meetup-oauth)
|
||||
- [meteor](https://github.com/meteor/meteor/tree/devel/packages/meteor)
|
||||
- [meteor-base](https://github.com/meteor/meteor/tree/devel/packages/meteor-base)
|
||||
- [meteor-developer-config-ui](https://github.com/meteor/meteor/tree/devel/packages/meteor-developer-config-ui)
|
||||
- [meteor-developer-oauth](https://github.com/meteor/meteor/tree/devel/packages/meteor-developer-oauth)
|
||||
- [meteor-platform](https://github.com/meteor/meteor/tree/devel/packages/meteor-platform)
|
||||
- [meteor-tool](https://github.com/meteor/meteor/tree/devel/packages/meteor-tool)
|
||||
- [minifier-css](https://github.com/meteor/meteor/tree/devel/packages/minifier-css)
|
||||
- [minifier-js](https://github.com/meteor/meteor/tree/devel/packages/minifier-js)
|
||||
- [minimongo](https://github.com/meteor/meteor/tree/devel/packages/minimongo)
|
||||
- [mobile-experience](https://github.com/meteor/meteor/tree/devel/packages/mobile-experience)
|
||||
- [mobile-status-bar](https://github.com/meteor/meteor/tree/devel/packages/mobile-status-bar)
|
||||
- [modern-browsers](https://github.com/meteor/meteor/tree/devel/packages/modern-browsers)
|
||||
- [modules](https://github.com/meteor/meteor/tree/devel/packages/modules)
|
||||
- [modules-runtime](https://github.com/meteor/meteor/tree/devel/packages/modules-runtime)
|
||||
- [modules-runtime-hot](https://github.com/meteor/meteor/tree/devel/packages/modules-runtime-hot)
|
||||
- [mongo](https://github.com/meteor/meteor/tree/devel/packages/mongo)
|
||||
- [mongo-dev-server](https://github.com/meteor/meteor/tree/devel/packages/mongo-dev-server)
|
||||
- [mongo-id](https://github.com/meteor/meteor/tree/devel/packages/mongo-id)
|
||||
- [mongo-livedata](https://github.com/meteor/meteor/tree/devel/packages/mongo-livedata)
|
||||
- [npm-mongo](https://github.com/meteor/meteor/tree/devel/packages/npm-mongo)
|
||||
- [oauth](https://github.com/meteor/meteor/tree/devel/packages/oauth)
|
||||
- [oauth-encryption](https://github.com/meteor/meteor/tree/devel/packages/oauth-encryption)
|
||||
- [oauth1](https://github.com/meteor/meteor/tree/devel/packages/oauth1)
|
||||
- [oauth2](https://github.com/meteor/meteor/tree/devel/packages/oauth2)
|
||||
- [ordered-dict](https://github.com/meteor/meteor/tree/devel/packages/ordered-dict)
|
||||
- [package-stats-opt-out](https://github.com/meteor/meteor/tree/devel/packages/package-stats-opt-out)
|
||||
- [package-version-parser](https://github.com/meteor/meteor/tree/devel/packages/package-version-parser)
|
||||
- [promise](https://github.com/meteor/meteor/tree/devel/packages/promise)
|
||||
- [random](https://github.com/meteor/meteor/tree/devel/packages/random)
|
||||
- [rate-limit](https://github.com/meteor/meteor/tree/devel/packages/rate-limit)
|
||||
- [react-fast-refresh](https://github.com/meteor/meteor/tree/devel/packages/react-fast-refresh)
|
||||
- [reactive-dict](https://github.com/meteor/meteor/tree/devel/packages/reactive-dict)
|
||||
- [reactive-var](https://github.com/meteor/meteor/tree/devel/packages/reactive-var)
|
||||
- [reload](https://github.com/meteor/meteor/tree/devel/packages/reload)
|
||||
- [reload-safetybelt](https://github.com/meteor/meteor/tree/devel/packages/reload-safetybelt)
|
||||
- [retry](https://github.com/meteor/meteor/tree/devel/packages/retry)
|
||||
- [routepolicy](https://github.com/meteor/meteor/tree/devel/packages/routepolicy)
|
||||
- [server-render](https://github.com/meteor/meteor/tree/devel/packages/server-render)
|
||||
- [service-configuration](https://github.com/meteor/meteor/tree/devel/packages/service-configuration)
|
||||
- [session](https://github.com/meteor/meteor/tree/devel/packages/session)
|
||||
- [sha](https://github.com/meteor/meteor/tree/devel/packages/sha)
|
||||
- [shell-server](https://github.com/meteor/meteor/tree/devel/packages/shell-server)
|
||||
- [socket-stream-client](https://github.com/meteor/meteor/tree/devel/packages/socket-stream-client)
|
||||
- [standard-app-packages](https://github.com/meteor/meteor/tree/devel/packages/standard-app-packages)
|
||||
- [standard-minifier-css](https://github.com/meteor/meteor/tree/devel/packages/standard-minifier-css)
|
||||
- [standard-minifier-js](https://github.com/meteor/meteor/tree/devel/packages/standard-minifier-js)
|
||||
- [standard-minifiers](https://github.com/meteor/meteor/tree/devel/packages/standard-minifiers)
|
||||
- [static-html](https://github.com/meteor/meteor/tree/devel/packages/static-html)
|
||||
- [test-helpers](https://github.com/meteor/meteor/tree/devel/packages/test-helpers)
|
||||
- [test-in-browser](https://github.com/meteor/meteor/tree/devel/packages/test-in-browser)
|
||||
- [test-in-console](https://github.com/meteor/meteor/tree/devel/packages/test-in-console)
|
||||
- [test-server-tests-in-console-once](https://github.com/meteor/meteor/tree/devel/packages/test-server-tests-in-console-once)
|
||||
- [tinytest](https://github.com/meteor/meteor/tree/devel/packages/tinytest)
|
||||
- [tinytest-harness](https://github.com/meteor/meteor/tree/devel/packages/tinytest-harness)
|
||||
- [tracker](https://github.com/meteor/meteor/tree/devel/packages/tracker)
|
||||
- [twitter-config-ui](https://github.com/meteor/meteor/tree/devel/packages/twitter-config-ui)
|
||||
- [twitter-oauth](https://github.com/meteor/meteor/tree/devel/packages/twitter-oauth)
|
||||
- [typescript](https://github.com/meteor/meteor/tree/devel/packages/typescript)
|
||||
- [underscore](https://github.com/meteor/meteor/tree/devel/packages/underscore)
|
||||
- [underscore-tests](https://github.com/meteor/meteor/tree/devel/packages/underscore-tests)
|
||||
- [url](https://github.com/meteor/meteor/tree/devel/packages/url)
|
||||
- [webapp](https://github.com/meteor/meteor/tree/devel/packages/webapp)
|
||||
- [webapp-hashing](https://github.com/meteor/meteor/tree/devel/packages/webapp-hashing)
|
||||
- [weibo-config-ui](https://github.com/meteor/meteor/tree/devel/packages/weibo-config-ui)
|
||||
- [weibo-oauth](https://github.com/meteor/meteor/tree/devel/packages/weibo-oauth)
|
||||
@@ -3,7 +3,7 @@ title: url
|
||||
description: Isomorphic modern/legacy/Node polyfill for WHATWG URL/URLSearchParams.
|
||||
---
|
||||
|
||||
`url` package provides polyfill for the [WHATWG url specification](https://url.spec.whatwg.org/) for legacy browsers or defaults to the global class which is available in modern browsers and Node. It is recomended that you use this package for compatibility with non-modern browsers.
|
||||
`url` package provides polyfill for the [WHATWG url specification](https://url.spec.whatwg.org/) for legacy browsers or defaults to the global class which is available in modern browsers and Node. It is recommended that you use this package for compatibility with non-modern browsers.
|
||||
|
||||
For more information we recommend [reading the MDN articles](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) about it and looking over the [Node API documentation](https://nodejs.org/api/url.html#url_the_whatwg_url_api) for more details as this article covers only basic usage in Meteor.
|
||||
|
||||
|
||||
@@ -13,20 +13,20 @@ This package also allows you to add handlers for HTTP requests.
|
||||
This lets other services access your app's data through an HTTP API, allowing
|
||||
it to easily interoperate with tools and frameworks that don't yet support DDP.
|
||||
|
||||
`webapp` exposes the [connect](https://github.com/senchalabs/connect) API for
|
||||
handling requests through `WebApp.connectHandlers`.
|
||||
`webapp` exposes the [express](https://github.com/expressjs/express) API for
|
||||
handling requests through `WebApp.handlers`.
|
||||
Here's an example that will let you handle a specific URL:
|
||||
|
||||
```js
|
||||
// Listen to incoming HTTP requests (can only be used on the server).
|
||||
WebApp.connectHandlers.use('/hello', (req, res, next) => {
|
||||
WebApp.handlers.use('/hello', (req, res, next) => {
|
||||
res.writeHead(200);
|
||||
res.end(`Hello world from: ${Meteor.release}`);
|
||||
});
|
||||
```
|
||||
|
||||
{% apibox "WebApp.connectHandlers" %}
|
||||
{% apibox "connectHandlersCallback(req, res, next)" %}
|
||||
{% apibox "WebApp.handlers" %}
|
||||
{% apibox "expressHandlersCallback(req, res, next)" %}
|
||||
|
||||
### Serving a Static Landing Page
|
||||
|
||||
@@ -62,36 +62,38 @@ Here's a sample _index.html_ you might use to get started:
|
||||
</html>
|
||||
```
|
||||
|
||||
Then using the connectHandlers method described above serve up your static HTML on app-root/ page load as shown below.
|
||||
Then using the handlers method described above serve up your static HTML on app-root/ page load as shown below.
|
||||
|
||||
```
|
||||
/* global WebApp Assets */
|
||||
import crypto from 'crypto'
|
||||
import connectRoute from 'connect-route'
|
||||
import express from 'express'
|
||||
|
||||
WebApp.connectHandlers.use(connectRoute(function (router) {
|
||||
router.get('/', function (req, res, next) {
|
||||
const buf = Assets.getText('index.html')
|
||||
const router = express.Router()
|
||||
|
||||
if (buf.length > 0) {
|
||||
const eTag = crypto.createHash('md5').update(buf).digest('hex')
|
||||
router.get('/', function (req, res, next) {
|
||||
const buf = Assets.getText('index.html')
|
||||
|
||||
if (req.headers['if-none-match'] === eTag) {
|
||||
res.writeHead(304, 'Not Modified')
|
||||
return res.end()
|
||||
}
|
||||
if (buf.length > 0) {
|
||||
const eTag = crypto.createHash('md5').update(buf).digest('hex')
|
||||
|
||||
res.writeHead(200, {
|
||||
ETag: eTag,
|
||||
'Content-Type': 'text/html'
|
||||
})
|
||||
|
||||
return res.end(buf);
|
||||
if (req.headers['if-none-match'] === eTag) {
|
||||
res.writeHead(304, 'Not Modified')
|
||||
return res.end()
|
||||
}
|
||||
|
||||
return res.end('<html><body>Index page not found!</body></html>')
|
||||
})
|
||||
}))
|
||||
res.writeHead(200, {
|
||||
ETag: eTag,
|
||||
'Content-Type': 'text/html'
|
||||
})
|
||||
|
||||
return res.end(buf)
|
||||
}
|
||||
|
||||
return res.end('<html><body>Index page not found!</body></html>')
|
||||
})
|
||||
|
||||
WebApp.handlers.use(router)
|
||||
```
|
||||
|
||||
There are a couple things to think about with this approach.
|
||||
@@ -160,4 +162,4 @@ WebApp.addUpdatedNotifyHook(({arch, manifest, runtimeConfig}) => {
|
||||
|
||||
{% apibox "WebApp.addUpdatedNotifyHook" %}
|
||||
{% apibox "addUpdatedNotifyHookCallback(options)" %}
|
||||
{% apibox "main" %}
|
||||
{% apibox "main" %}
|
||||
|
||||
@@ -66,7 +66,7 @@ We need to discuss further to decide whether or not to proceed with these implem
|
||||
- New Async Tracker; ([Blog Post](https://blog.meteor.com/new-meteor-js-2-10-and-the-async-tracker-feature-ffdbe817c801))
|
||||
- New Suspense hooks for React + Meteor; ([Blog Post](https://blog.meteor.com/new-suspense-hooks-for-meteor-5391570b3007))
|
||||
- Release Blaze 2.7 supporting async calls; ([Changelog](https://www.blazejs.org/changelog.html))
|
||||
- New Scaffold API / generate command; ([Blog Post](https://blog.meteor.com/new-meteor-2-9-and-the-scaffold-api-8b5b2b2b2b2b))
|
||||
- New Scaffold API / generate command; ([Blog Post](https://blog.meteor.com/new-meteorjs-2-9-and-the-new-scaffold-api-5fcc0f3b1ce5))
|
||||
- Types added to the core; ([Blog Post](https://blog.meteor.com/new-meteor-2-8-1-and-adding-types-to-the-core-8a6ee56f0141))
|
||||
- Update Apollo skeleton NPM dependencies;
|
||||
- MongoDB 6.0 Support; ([Discussion](https://github.com/meteor/meteor/discussions/12092) / [Blog Post](https://blog.meteor.com/new-meteor-2-11-and-the-new-embedded-mongodb-19767076961b))
|
||||
|
||||
@@ -16,7 +16,7 @@ Unexpected mongo exit code 3221225781. Restarting.
|
||||
Can't start Mongo server.
|
||||
```
|
||||
|
||||
You [probably](https://github.com/meteor/meteor/issues/10036#issuecomment-416485306) need to install `Visual C++ Redistributable for Visual Studio`, depending on your Windows and Meteor embbeded version of MongoDB the version of Visual Studio could be different. You can check the version that we are using in our Windows test environment [here](https://github.com/meteor/meteor/blob/devel/appveyor.yml#L10)
|
||||
You [probably](https://github.com/meteor/meteor/issues/10036#issuecomment-416485306) need to install `Visual C++ Redistributable for Visual Studio`, depending on your Windows and Meteor embedded version of MongoDB the version of Visual Studio could be different. You can check the version that we are using in our Windows test environment [here](https://github.com/meteor/meteor/blob/devel/appveyor.yml#L10)
|
||||
|
||||
Starting from MongoDB 4.4.4 we started to use Visual Studio 2019.
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ edit_branch: 'devel'
|
||||
edit_path: 'guide'
|
||||
content_root: 'source'
|
||||
versions:
|
||||
- '2.16'
|
||||
- '2.15'
|
||||
- '2.14'
|
||||
- '2.13'
|
||||
- '2.12'
|
||||
- '2.11'
|
||||
@@ -42,7 +45,7 @@ sidebar_categories:
|
||||
- index
|
||||
- code-style
|
||||
- structure
|
||||
- 2.13-migration
|
||||
- 2.14-migration
|
||||
- 3.0-migration
|
||||
- prepare-meteor-3.0
|
||||
Data:
|
||||
|
||||
1374
guide/package-lock.json
generated
1374
guide/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -22,5 +22,8 @@
|
||||
"clean": "hexo clean",
|
||||
"test": "npm run clean; npm run build",
|
||||
"start": "npm run build && chexo @meteorjs/meteor-hexo-config -- server"
|
||||
},
|
||||
"volta": {
|
||||
"node": "14.21.3"
|
||||
}
|
||||
}
|
||||
|
||||
67
guide/source/2.14-migration.md
Normal file
67
guide/source/2.14-migration.md
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: Migrating to Meteor 2.14
|
||||
description: How to migrate your application to Meteor 2.14.
|
||||
---
|
||||
|
||||
Most of the new features in Meteor 2.14 are either applied directly behind the
|
||||
scenes (in a backwards compatible manner) or are opt-in. For a complete
|
||||
breakdown of the changes, please refer to the [changelog](http://docs.meteor.com/changelog.html).
|
||||
|
||||
|
||||
<h2 id="changes">Changes in Meteor 2.14</h2>
|
||||
|
||||
<h3 id="cordova">Cordova Package</h3>
|
||||
|
||||
Cordova has been updated to v12.0.1 for Android and v7.0.1 for iOS. This
|
||||
requires a few changes to your Cordova project:
|
||||
|
||||
- The `splash-screen` package has removed the `cordova-plugin-splashscreen`
|
||||
is now on `cordova-android` core, so we have removed the dependency from the
|
||||
`splash-screen` package.
|
||||
As a result we are dropping the support for dark mode splash screen on Android.
|
||||
To create this now you need to create two themes on your `config.xml` file.
|
||||
You can follow in their [docs](https://cordova.apache.org/docs/en/latest/core/features/splashscreen/index.html) how to update your splash screen
|
||||
|
||||
|
||||
Your `.mobile-config.js` file should have the following preferences:
|
||||
|
||||
```js
|
||||
|
||||
App.setPreference('android-targetSdkVersion', '33')
|
||||
App.setPreference('android-minSdkVersion', '28')
|
||||
|
||||
```
|
||||
|
||||
<h2 id="older-versions">Migrating from a version older than 2.13?</h2>
|
||||
|
||||
If you're migrating from a version of Meteor older than Meteor 2.13, there may
|
||||
be important considerations not listed in this guide.
|
||||
Please review the older migration guides for details:
|
||||
|
||||
* [Migrating to Meteor 2.13](2.13-migration.html) (from 2.12)
|
||||
* [Migrating to Meteor 2.12](2.12-migration.html) (from 2.11)
|
||||
* [Migrating to Meteor 2.11](2.11-migration.html) (from 2.10)
|
||||
* [Migrating to Meteor 2.10](2.10-migration.html) (from 2.9)
|
||||
* [Migrating to Meteor 2.9](2.9-migration.html) (from 2.8)
|
||||
* [Migrating to Meteor 2.8](2.8-migration.html) (from 2.7)
|
||||
* [Migrating to Meteor 2.7](2.7-migration.html) (from 2.6)
|
||||
* [Migrating to Meteor 2.6](2.6-migration.html) (from 2.5)
|
||||
* [Migrating to Meteor 2.5](2.5-migration.html) (from 2.4)
|
||||
* [Migrating to Meteor 2.4](2.4-migration.html) (from 2.3)
|
||||
* [Migrating to Meteor 2.3](2.3-migration.html) (from 2.2)
|
||||
* [Migrating to Meteor 2.2](2.2-migration.html) (from 2.0)
|
||||
* [Migrating to Meteor 2.0](2.0-migration.html) (from 1.12)
|
||||
* [Migrating to Meteor 1.12](1.12-migration.html) (from 1.11)
|
||||
* [Migrating to Meteor 1.11](1.11-migration.html) (from 1.10.2)
|
||||
* [Migrating to Meteor 1.10.2](1.10.2-migration.html) (from 1.10)
|
||||
* [Migrating to Meteor 1.10](1.10-migration.html) (from 1.9.3)
|
||||
* [Migrating to Meteor 1.9.3](1.9.3-migration.html) (from 1.9)
|
||||
* [Migrating to Meteor 1.9](1.9-migration.html) (from 1.8.3)
|
||||
* [Migrating to Meteor 1.8.3](1.8.3-migration.html) (from 1.8.2)
|
||||
* [Migrating to Meteor 1.8.2](1.8.2-migration.html) (from 1.8)
|
||||
* [Migrating to Meteor 1.8](1.8-migration.html) (from 1.7)
|
||||
* [Migrating to Meteor 1.7](1.7-migration.html) (from 1.6)
|
||||
* [Migrating to Meteor 1.6](1.6-migration.html) (from 1.5)
|
||||
* [Migrating to Meteor 1.5](1.5-migration.html) (from 1.4)
|
||||
* [Migrating to Meteor 1.4](1.4-migration.html) (from 1.3)
|
||||
* [Migrating to Meteor 1.3](1.3-migration.html) (from 1.2)
|
||||
@@ -3,41 +3,4 @@ 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.
|
||||
|
||||
## What's the status of version 3.0?
|
||||
|
||||
**Latest version:** `3.0-alpha.19` <br/>
|
||||
**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.
|
||||
|
||||
## How to prepare for version 3.0?
|
||||
|
||||
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.
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### How to test Meteor 3.0?
|
||||
|
||||
You can create a new Meteor 3.0 project by running the command below:
|
||||
|
||||
```bash
|
||||
meteor create my-new-project --release 3.0-alpha.19
|
||||
```
|
||||
|
||||
### How to update from version 2?
|
||||
|
||||
You can update your Meteor 2.x project by running the command below inside your project folder:
|
||||
|
||||
```bash
|
||||
meteor update --release 3.0-alpha.19
|
||||
```
|
||||
|
||||
### 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?
|
||||
|
||||
Our plan is 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.
|
||||
Please visit [Meteor 3.0 Migration Guide](https://v3-migration-docs.meteor.com/) for our most up-to-date migration guide.
|
||||
|
||||
@@ -4,7 +4,7 @@ description: How to use Meteor's build system to compile your app.
|
||||
discourseTopicId: 19669
|
||||
---
|
||||
|
||||
The Meteor build system is the actual command line tool that you get when you install Meteor. You run it by typing the `meteor` command in your terminal, possibly followed by a set of arguments. Read the [docs about the command line tool](https://docs.meteor.com/commandline.html) or type `meteor help` in your terminal to learn about all of the commands.
|
||||
The Meteor build system is the actual command line tool that you get when you install Meteor. You run it by typing the `meteor` command in your terminal, possibly followed by a set of arguments. Read the [docs about the command line tool](https://docs.meteor.com/cli/) or type `meteor help` in your terminal to learn about all of the commands.
|
||||
|
||||
<h2 id="what-it-does">What does it do?</h2>
|
||||
|
||||
@@ -16,7 +16,7 @@ After executing the `meteor` command to start the build tool you should leave it
|
||||
|
||||
<h3 id="compiles-with-build-plugins">Compiles files with build plugins</h3>
|
||||
|
||||
The main function of the Meteor build tool is to run "build plugins". These plugins define different parts of your app build process. Meteor puts heavy emphasis on reducing or removing build configuration files, so you won't see any large build process config files like you would in Gulp or Webpack. The Meteor build process is configured almost entirely through adding and removing packages to your app and putting files in specially named directories. For example, to get all of the newest stable ES2015 JavaScript features in your app, you add the [`ecmascript` package](http://docs.meteor.com/#/full/ecmascript). This package provides support for ES2015 modules, which gives you even more fine grained control over file load order using ES2015 `import` and `export`. As new Meteor releases add new features to this package you get them for free.
|
||||
The main function of the Meteor build tool is to run "build plugins". These plugins define different parts of your app build process. Meteor puts heavy emphasis on reducing or removing build configuration files, so you won't see any large build process config files like you would in Gulp or Webpack. The Meteor build process is configured almost entirely through adding and removing packages to your app and putting files in specially named directories. For example, to get all of the newest stable ES2015 JavaScript features in your app, you add the [`ecmascript` package](https://docs.meteor.com/packages/ecmascript.html). This package provides support for ES2015 modules, which gives you even more fine grained control over file load order using ES2015 `import` and `export`. As new Meteor releases add new features to this package you get them for free.
|
||||
|
||||
<h4 id="controlling-build-files">Controlling which files to build</h4>
|
||||
|
||||
@@ -224,7 +224,7 @@ For more examples and details on importing styles and using `@imports` with pack
|
||||
|
||||
<h3 id="sass">Sass</h3>
|
||||
|
||||
The best Sass build plugin for Meteor is [`fourseven:scss`](https://atmospherejs.com/fourseven/scss).
|
||||
The best Sass build plugin for Meteor is [`leonardoventurini:scss`](https://atmospherejs.com/leonardoventurini/scss). An alternative to the previous recommended [`fourseven:scss`](https://atmospherejs.com/fourseven/scss) package.
|
||||
|
||||
<h3 id="less">Less</h3>
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ This example from the Todos app defines a schema with a few simple rules:
|
||||
3. We specify the `incompleteCount` is a number, which on insertion is set to `0` if not otherwise specified.
|
||||
4. We specify that the `userId`, which is optional, must be a string that looks like the ID of a user document.
|
||||
|
||||
We're using the SimpleSchema for Meteor related funcitonality, like IDs, but we encourage you to create custom regEx expressions for security reasons, for fields like `email` or `name`. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information.
|
||||
We're using the SimpleSchema for Meteor related functionality, like IDs, but we encourage you to create custom regEx expressions for security reasons, for fields like `email` or `name`. Check out the [Simple Schema docs](https://github.com/longshotlabs/simpl-schema#regex) for more information.
|
||||
|
||||
We attach the schema to the namespace of `Lists` directly, which allows us to check objects against this schema directly whenever we want, such as in a form or [Method](methods.html). In the [next section](#schemas-on-write) we'll see how to use this schema automatically when writing to the collection.
|
||||
|
||||
|
||||
@@ -589,31 +589,35 @@ A pattern for turning a polled REST endpoint looks something like this:
|
||||
```js
|
||||
const POLL_INTERVAL = 5000;
|
||||
|
||||
Meteor.publish('polled-publication', function() {
|
||||
const publishedKeys = {};
|
||||
Meteor.publish('polled-publication', async function() {
|
||||
const publishedKeys = {};
|
||||
|
||||
const poll = () => {
|
||||
// Let's assume the data comes back as an array of JSON documents, with an _id field
|
||||
const data = HTTP.get(REST_URL, REST_OPTIONS);
|
||||
const poll = async () => {
|
||||
// Let's assume the data comes back as an array of JSON documents, with an _id field
|
||||
const response = await fetch(REST_URL, REST_OPTIONS);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
} else {
|
||||
data = await response.json();
|
||||
data.forEach((doc) => {
|
||||
if (publishedKeys[doc._id]) {
|
||||
this.changed(COLLECTION_NAME, doc._id, doc);
|
||||
} else {
|
||||
publishedKeys[doc._id] = true;
|
||||
this.added(COLLECTION_NAME, doc._id, doc);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
data.forEach((doc) => {
|
||||
if (publishedKeys[doc._id]) {
|
||||
this.changed(COLLECTION_NAME, doc._id, doc);
|
||||
} else {
|
||||
publishedKeys[doc._id] = true;
|
||||
this.added(COLLECTION_NAME, doc._id, doc);
|
||||
}
|
||||
await poll();
|
||||
this.ready();
|
||||
|
||||
const interval = Meteor.setInterval(poll, POLL_INTERVAL);
|
||||
|
||||
this.onStop(() => {
|
||||
Meteor.clearInterval(interval);
|
||||
});
|
||||
};
|
||||
|
||||
poll();
|
||||
this.ready();
|
||||
|
||||
const interval = Meteor.setInterval(poll, POLL_INTERVAL);
|
||||
|
||||
this.onStop(() => {
|
||||
Meteor.clearInterval(interval);
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ If you are hosting a webfont as part of your application and serving it via a CD
|
||||
```js
|
||||
import { WebApp } from 'meteor/webapp';
|
||||
|
||||
WebApp.rawConnectHandlers.use(function(req, res, next) {
|
||||
WebApp.rawHandlers.use(function(req, res, next) {
|
||||
if (req._parsedUrl.pathname.match(/\.(ttf|ttc|otf|eot|woff|woff2|font\.css|css)$/)) {
|
||||
res.setHeader('Access-Control-Allow-Origin', /* your hostname, or just '*' */);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ MONGO_URL=mongodb://localhost:27017/myapp ROOT_URL=http://my-app.com PORT=3000 n
|
||||
```
|
||||
|
||||
* `ROOT_URL` is the base URL for your Meteor project
|
||||
* `PORT` is the port at which the application is running
|
||||
* `PORT` is the port at which the application is running
|
||||
* `MONGO_URL` is a [Mongo connection string URI](https://docs.mongodb.com/manual/reference/connection-string/) supplied by the MongoDB provider.
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ Galaxy's UI provides a detailed logging system, which can be invaluable to deter
|
||||
|
||||
If you really want to understand the ins and outs of running your Meteor application, you should use an Application Performance Monitoring (APM) service. There are multiple services designed for Meteor apps:
|
||||
|
||||
- [Meteor APM](https://www.meteor.com/cloud)
|
||||
- [Meteor APM](https://galaxycloud.app/)
|
||||
- [Monti APM](https://montiapm.com/)
|
||||
- [Meteor Elastic APM](https://github.com/Meteor-Community-Packages/meteor-elastic-apm)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Introduction
|
||||
description: This is the guide for using Meteor, a full-stack JavaScript platform for developing modern web and mobile applications.
|
||||
---
|
||||
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.0 is in progress, and it will run on the latest Node.js version. For more information, please consult our [migration guide](https://guide.meteor.com/3.0-migration.html).
|
||||
> Meteor 2.x runs on a deprecated Node.js version (14). Meteor 3.x has been released with support for the latest Node.js LTS version. For more information, please consult our [migration guide](https://v3-migration-docs.meteor.com/) and the [latest docs](https://docs.meteor.com).
|
||||
|
||||
<!-- XXX: note that this content is somewhat duplicated on the docs, and should be updated in parallel -->
|
||||
<h2 id="what-is-meteor">What is Meteor?</h2>
|
||||
@@ -44,11 +44,11 @@ meteor
|
||||
1. The place to get started with Meteor is the [tutorials page](https://www.meteor.com/developers/tutorials).
|
||||
|
||||
1. [Meteor Examples](https://github.com/meteor/examples) is a list of examples using Meteor. You can also include your example with Meteor.
|
||||
|
||||
|
||||
1. Once you are familiar with the basics, the [Meteor Guide](http://guide.meteor.com) covers intermediate material on how to use Meteor in a larger scale app.
|
||||
|
||||
1. Visit the [Meteor discussion forums](https://forums.meteor.com) to announce projects, get help, talk about the community, or discuss changes to core.
|
||||
|
||||
|
||||
1. [Meteor Slack Community](https://join.slack.com/t/meteor-community/shared_invite/enQtODA0NTU2Nzk5MTA3LWY5NGMxMWRjZDgzYWMyMTEyYTQ3MTcwZmU2YjM5MTY3MjJkZjQ0NWRjOGZlYmIxZjFlYTA5Mjg4OTk3ODRiOTc) is the best place to ask (and answer!) technical questions and also meet Meteor developers.
|
||||
|
||||
1. [Atmosphere](https://atmospherejs.com) is the repository of community packages designed especially for Meteor.
|
||||
|
||||
@@ -171,35 +171,35 @@ updateText.run.call({ userId: 'abcd' }, {
|
||||
|
||||
As you can see, this approach to calling Methods results in a better development workflow - you can more easily deal with the different parts of the Method separately and test your code without having to deal with Meteor internals. But this approach requires you to write a lot of boilerplate on the Method definition side.
|
||||
|
||||
<h3 id="validated-method">Advanced Methods with mdg:validated-method</h3>
|
||||
<h3 id="jam-method">Advanced Methods with jam:method</h3>
|
||||
|
||||
To alleviate some of the boilerplate that's involved in correct Method definitions, we've published a wrapper package called `mdg:validated-method` that does most of this for you. Here's the same Method as above, but defined with the package:
|
||||
To alleviate some of the boilerplate that's involved in correct Method definitions, you can use a package called `jam:method` that does most of this for you. Here's the same Method as above, but defined with the package:
|
||||
|
||||
```js
|
||||
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
||||
import { createMethod } from 'meteor/jam:method';
|
||||
|
||||
export const updateText = new ValidatedMethod({
|
||||
export const updateText = createMethod({
|
||||
name: 'todos.updateText',
|
||||
validate: new SimpleSchema({
|
||||
schema: new SimpleSchema({
|
||||
todoId: { type: String },
|
||||
newText: { type: String }
|
||||
}).validator(),
|
||||
run({ todoId, newText }) {
|
||||
const todo = Todos.findOne(todoId);
|
||||
|
||||
}),
|
||||
async run({ todoId, newText }) {
|
||||
const todo = await Todos.findOneAsync(todoId);
|
||||
|
||||
if (!todo.editableBy(this.userId)) {
|
||||
throw new Meteor.Error('todos.updateText.unauthorized',
|
||||
'Cannot edit todos in a private list that is not yours');
|
||||
}
|
||||
|
||||
Todos.update(todoId, {
|
||||
Todos.updateAsync(todoId, {
|
||||
$set: { text: newText }
|
||||
});
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
You call it the same way you call the advanced Method above, but the Method definition is significantly simpler. We believe this style of Method lets you clearly see the important parts - the name of the Method sent over the wire, the format of the expected arguments, and the JavaScript namespace by which the Method can be referenced. Validated methods only accept a single argument and a callback function.
|
||||
You call it the same way you call the advanced Method above, but the Method definition is significantly simpler. We believe this style of Method lets you clearly see the important parts - the name of the Method sent over the wire, the format of the expected arguments, and the JavaScript namespace by which the Method can be referenced.
|
||||
|
||||
<h2 id="errors">Error handling</h2>
|
||||
|
||||
@@ -227,17 +227,13 @@ When the server was not able to complete the user's desired action because of a
|
||||
|
||||
When a Method call fails because the arguments are of the wrong type, it's good to throw a `ValidationError`. This works like `Meteor.Error`, but is a custom constructor that enforces a standard error format that can be read by different form and validation libraries. In particular, if you are calling this Method from a form, throwing a `ValidationError` will make it possible to display nice error messages next to particular fields in the form.
|
||||
|
||||
When you use `mdg:validated-method` with `simpl-schema` as demonstrated above, this type of error is thrown for you.
|
||||
|
||||
Read more about the error format in the [`mdg:validation-error` docs](https://atmospherejs.com/mdg/validation-error).
|
||||
|
||||
<h3 id="handling-errors">Handling errors</h3>
|
||||
|
||||
When you call a Method, any errors thrown by it will be returned in the callback. At this point, you should identify which error type it is and display the appropriate message to the user. In this case, it is unlikely that the Method will throw a `ValidationError` or an internal server error, so we will only handle the unauthorized error:
|
||||
|
||||
```js
|
||||
// Call the Method
|
||||
updateText.call({
|
||||
updateText({
|
||||
todoId: '12345',
|
||||
newText: 'This is a todo item.'
|
||||
}, (err, res) => {
|
||||
@@ -261,7 +257,7 @@ We'll talk about how to handle the `ValidationError` in the section on forms bel
|
||||
|
||||
<h3 id="throw-stub-exceptions">Errors in Method simulation</h3>
|
||||
|
||||
When a Method is called, it usually runs twice---once on the client to simulate the result for Optimistic UI, and again on the server to make the actual change to the database. This means that if your Method throws an error, it will likely fail on the client _and_ the server. For this reason, `ValidatedMethod` turns on undocumented option in Meteor to avoid calling the server-side implementation if the simulation throws an error.
|
||||
When a Method is called, it usually runs twice---once on the client to simulate the result for Optimistic UI, and again on the server to make the actual change to the database. This means that if your Method throws an error, it will likely fail on the client _and_ the server. For this reason, `jam:method` turns on [an option](https://github.com/jamauro/method#options-for-meteorapplyasync) in Meteor to avoid calling the server-side implementation if the simulation throws an error.
|
||||
|
||||
While this behavior is good for saving server resources in cases where a Method will certainly fail, it's important to make sure that the simulation doesn't throw an error in cases where the server Method would have succeeded (for example, if you didn't load some data on the client that the Method needs to do the simulation properly). In this case, you can wrap server-side-only logic in a block that checks for a method simulation:
|
||||
|
||||
@@ -283,13 +279,13 @@ const amountRegEx = /^\d*\.(\d\d)?$/;
|
||||
// This Method encodes the form validation requirements.
|
||||
// By defining them in the Method, we do client and server-side
|
||||
// validation in one place.
|
||||
export const insert = new ValidatedMethod({
|
||||
export const insert = createMethod({
|
||||
name: 'Invoices.methods.insert',
|
||||
validate: new SimpleSchema({
|
||||
schema: new SimpleSchema({
|
||||
email: { type: String, regEx: emailRegEx },
|
||||
description: { type: String, min: 5 },
|
||||
amount: { type: String, regEx: amountRegEx }
|
||||
}).validator(),
|
||||
}),
|
||||
run(newInvoice) {
|
||||
// In here, we can be sure that the newInvoice argument is
|
||||
// validated.
|
||||
@@ -299,7 +295,7 @@ export const insert = new ValidatedMethod({
|
||||
'Must be logged in to create an invoice.');
|
||||
}
|
||||
|
||||
Invoices.insert(newInvoice)
|
||||
Invoices.insertAsync(newInvoice)
|
||||
}
|
||||
});
|
||||
```
|
||||
@@ -355,7 +351,7 @@ Template.Invoices_newInvoice.events({
|
||||
amount: event.target.amount.value
|
||||
};
|
||||
|
||||
insert.call(data, (err, res) => {
|
||||
insert(data, (err, res) => {
|
||||
if (err) {
|
||||
if (err.error === 'validation-error') {
|
||||
// Initialize error object
|
||||
@@ -434,9 +430,9 @@ If we defined this Method in client and server code, as all Methods should be, a
|
||||
|
||||
The client enters a special mode where it tracks all changes made to client-side collections, so that they can be rolled back later. When this step is complete, the user of your app sees their UI update instantly with the new content of the client-side database, but the server hasn't received any data yet.
|
||||
|
||||
If an exception is thrown from the Method simulation, then by default Meteor ignores it and continues to step (2). If you are using `ValidatedMethod` or pass a special `throwStubExceptions` option to `Meteor.apply`, then an exception thrown from the simulation will stop the server-side Method from running at all.
|
||||
If an exception is thrown from the Method simulation, then by default Meteor ignores it and continues to step (2). If you are using `jam:method` or pass a special `throwStubExceptions` [option](https://github.com/jamauro/method#options-for-meteorapplyasync) to `Meteor.apply`, then an exception thrown from the simulation will stop the server-side Method from running at all.
|
||||
|
||||
The return value of the Method simulation is discarded, unless the `returnStubValue` option is passed when calling the Method, in which case it is returned to the Method caller. ValidatedMethod passes this option by default.
|
||||
The return value of the Method simulation is discarded, unless the `returnStubValue` option is passed when calling the Method, in which case it is returned to the Method caller. `jam:method` passes this option by default.
|
||||
|
||||
<h4 id="lifecycle-ddp-message">2. A `method` DDP message is sent to the server</h4>
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ title: Performance improvements
|
||||
description: How to optimize your Meteor application for higher performance when you start growing.
|
||||
---
|
||||
|
||||
This guide focuses on providing you tips and common practices on how to improve performance of your Meteor app (sometimes also called scaling).
|
||||
It is important to note that at the end of the day Meteor is a Node.js app tied closely to MongoDB,
|
||||
so a lot of the problems you are going to encounter are common to other Node.js and MongoDB apps.
|
||||
Also do note that every app is different so there are unique challenges to each, therefore
|
||||
This guide focuses on providing you tips and common practices on how to improve performance of your Meteor app (sometimes also called scaling).
|
||||
It is important to note that at the end of the day Meteor is a Node.js app tied closely to MongoDB,
|
||||
so a lot of the problems you are going to encounter are common to other Node.js and MongoDB apps.
|
||||
Also do note that every app is different so there are unique challenges to each, therefore
|
||||
practices describe in this guide should be used as a guiding posts rather than absolutes.
|
||||
|
||||
This guide has been heavily inspired by [Marcin Szuster's Vazco article](https://www.vazco.eu/blog/how-to-optimize-and-scale-meteor-projects), the official [Meteor Galaxy guide](https://galaxy-guide.meteor.com/),
|
||||
@@ -15,11 +15,11 @@ and talk by Paulo Mogollón's talk at Impact 2022 titled ["First steps on scalin
|
||||
<h2 id="performance-monitoring">Performance monitoring</h2>
|
||||
|
||||
Before any optimization can take place we need to know what is our problem. This is where APM (Application Performance Monitor) comes in.
|
||||
If you are hosting on Galaxy then this is automatically included in the [Professional plan](https://www.meteor.com/cloud/pricing)
|
||||
and you can learn more about in its [own dedicated guide article](https://cloud-guide.meteor.com/apm-getting-started.html).
|
||||
For those hosting outside of Galaxy the most popular solution is to go with [Monti APM](https://montiapm.com/) which shares
|
||||
all the main functionality with Galaxy APM. You can also choose other APM for Node.js, but they will not show you Meteor
|
||||
specific data that Galaxy APM and Monti APM specialize in. For this guide we will focus on showing how to work with Galaxy APM,
|
||||
If you are hosting on Galaxy then this is automatically included in the [Professional plan](https://galaxycloud.app/meteorjs/pricing)
|
||||
and you can learn more about in its [own dedicated guide article](https://cloud-guide.meteor.com/apm-getting-started.html).
|
||||
For those hosting outside of Galaxy the most popular solution is to go with [Monti APM](https://montiapm.com/) which shares
|
||||
all the main functionality with Galaxy APM. You can also choose other APM for Node.js, but they will not show you Meteor
|
||||
specific data that Galaxy APM and Monti APM specialize in. For this guide we will focus on showing how to work with Galaxy APM,
|
||||
which is the same as with Monti APM, for simplicity.
|
||||
|
||||
Once you setup either of those APMs you will need to add a package to your Meteor app to start sending them data.
|
||||
@@ -37,9 +37,9 @@ meteor add montiapm:agent
|
||||
```
|
||||
|
||||
<h3 id="find-issues-apm">Finding issues in APM</h3>
|
||||
APM will start with providing you with an overview of how your app is performing. You can then dive deep into details of
|
||||
publications, methods, errors happening (both on client and server) and more. You will spend a lot of time in the detailed
|
||||
tabs looking for methods and publications to improve and analyzing the impact of your actions. The process, for example for
|
||||
APM will start with providing you with an overview of how your app is performing. You can then dive deep into details of
|
||||
publications, methods, errors happening (both on client and server) and more. You will spend a lot of time in the detailed
|
||||
tabs looking for methods and publications to improve and analyzing the impact of your actions. The process, for example for
|
||||
optimizing methods, will look like this:
|
||||
|
||||
1. Go to the detailed view under the Methods tab.
|
||||
@@ -52,14 +52,14 @@ Not every long-performing method has to be improved. Take a look at the followin
|
||||
* methodX - mean response time 1 515 ms, throughput 100,05/min
|
||||
* methodY - mean response time 34 000 ms, throughput 0,03/min
|
||||
|
||||
At first glance, the 34 seconds response time can catch your attention, and it may seem that the methodY
|
||||
is more relevant to improvement. But don’t ignore the fact that this method is being used only once in
|
||||
At first glance, the 34 seconds response time can catch your attention, and it may seem that the methodY
|
||||
is more relevant to improvement. But don’t ignore the fact that this method is being used only once in
|
||||
a few hours by the system administrators or scheduled cron action.
|
||||
|
||||
And now, let’s take a look at the methodX. Its response time is evidently lower BUT compared to the frequency
|
||||
And now, let’s take a look at the methodX. Its response time is evidently lower BUT compared to the frequency
|
||||
of use, it is still high, and without any doubt should be optimized first.
|
||||
|
||||
It’s also absolutely vital to remember that you shouldn't optimize everything as it goes.
|
||||
It’s also absolutely vital to remember that you shouldn't optimize everything as it goes.
|
||||
The key is to think strategically and match the most critical issues with your product priorities.
|
||||
|
||||
For more information about all the things you can find in Galaxy APM take a look at the Meteor APM section in [Galaxy Guide](https://galaxy-guide.meteor.com/apm-getting-started.html).
|
||||
@@ -71,75 +71,75 @@ At the same this is the most resource intensive part of a Meteor application.
|
||||
Under the hood WebSockets are being used with additional abilities provided by DDP.
|
||||
|
||||
<h3 id="publications-proper-use">Proper use of publications</h3>
|
||||
Since publications can get resource intensive they should be reserved for usage that requires up to date, live data or
|
||||
Since publications can get resource intensive they should be reserved for usage that requires up to date, live data or
|
||||
that are changing frequently and you need the users to see that.
|
||||
You will need to evaluate your app to figure out which situations these are. As a rule of thumb any data that are not
|
||||
required to be live or are not changing frequently can be fetched once via other means and re-fetched as needed,
|
||||
You will need to evaluate your app to figure out which situations these are. As a rule of thumb any data that are not
|
||||
required to be live or are not changing frequently can be fetched once via other means and re-fetched as needed,
|
||||
in most cases the re-fetching shouldn't be necessary.
|
||||
|
||||
But even before you proceed any further there are a few improvements that you can make here.
|
||||
But even before you proceed any further there are a few improvements that you can make here.
|
||||
First make sure that you only get the fields you need, limit the number of documents you send to the client to what you need
|
||||
(aka always set the `limit` option) and ensure that you have set all your indexes.
|
||||
|
||||
<h4 id="publications-methods">Methods over publications</h3>
|
||||
The first easiest replacement is to use Meteor methods instead of publications. In this case you can use the existing publication
|
||||
and instead of returning a cursor you will call `.fetchAsync()` and return the actual data. The same performance improvements
|
||||
The first easiest replacement is to use Meteor methods instead of publications. In this case you can use the existing publication
|
||||
and instead of returning a cursor you will call `.fetchAsync()` and return the actual data. The same performance improvements
|
||||
to get the method work faster apply here, but once called it sends the data and you don't have the overhead of a publication.
|
||||
|
||||
What is crucial here is to ensure that your choice of a front-end framework doesn't call the method every time, but only once
|
||||
What is crucial here is to ensure that your choice of a front-end framework doesn't call the method every time, but only once
|
||||
to load the data or when specifically needed (for example when the data gets updated due to user action or when the user requests it).
|
||||
|
||||
<h4 id="publications-replacements">Publication replacements</h4>
|
||||
Using methods has its limitations and there are other tools that you might want to evaluate as a potential replacement.
|
||||
|
||||
[Grapher](https://github.com/cult-of-coders/grapher) is a favorite answer and allows you to easily blend with another
|
||||
replacement which is [GraphQL](https://graphql.org/) and in particular [Apollo GraphQL](https://www.apollographql.com/),
|
||||
[Grapher](https://github.com/cult-of-coders/grapher) is a favorite answer and allows you to easily blend with another
|
||||
replacement which is [GraphQL](https://graphql.org/) and in particular [Apollo GraphQL](https://www.apollographql.com/),
|
||||
which also has an integration [package](https://atmospherejs.com/meteor/apollo) with Meteor. Finally, you can also go back to using REST as well.
|
||||
|
||||
Do note, that you can mix all of these based on your needs.
|
||||
|
||||
<h3 id="low-observer-reuse">Low observer reuse</h3>
|
||||
Observers are among the key components of Meteor. They take care of observing documents on MongoDB and they notify changes.
|
||||
Observers are among the key components of Meteor. They take care of observing documents on MongoDB and they notify changes.
|
||||
Creating them is an expensive operations, so you want to make sure that Meteor reuses them as much as possible.
|
||||
|
||||
> [Learn more about observers](https://galaxy-guide.meteor.com/apm-know-your-observers.html)
|
||||
|
||||
The key for observer reuse is to make sure that the queries requested are identical. This means that user given values
|
||||
should be standardised and so should any dynamic input like time. Publications for users should check if user is signed in
|
||||
The key for observer reuse is to make sure that the queries requested are identical. This means that user given values
|
||||
should be standardised and so should any dynamic input like time. Publications for users should check if user is signed in
|
||||
first before returning publication and if user is not signed in, then it should instead call `this.ready();`.
|
||||
|
||||
> [Learn more on improving observer reuse](https://galaxy-guide.meteor.com/apm-improve-cpu-and-network-usage)
|
||||
|
||||
<h3 id="redis-oplog">Redis Oplog</h3>
|
||||
|
||||
[Redis Oplog](https://atmospherejs.com/cultofcoders/redis-oplog) is a popular solution to Meteor's Oplog tailing
|
||||
(which ensures the reactivity, but has some severe limitations that especially impact performance). Redis Oplog as name
|
||||
suggests uses [redis](https://redis.io/) to track changes to data that you only need and cache them. This reduces load on
|
||||
[Redis Oplog](https://atmospherejs.com/cultofcoders/redis-oplog) is a popular solution to Meteor's Oplog tailing
|
||||
(which ensures the reactivity, but has some severe limitations that especially impact performance). Redis Oplog as name
|
||||
suggests uses [redis](https://redis.io/) to track changes to data that you only need and cache them. This reduces load on
|
||||
the server and database, allows you to track only the data that you want and only publish the changes you need.
|
||||
|
||||
<h2 id="methods">Methods</h2>
|
||||
|
||||
While methods are listed as one of the possible replacements for publications, they themselves can be made more performant,
|
||||
after all it really depends on what you put inside them and APM will provide you with the necessary insight on which
|
||||
While methods are listed as one of the possible replacements for publications, they themselves can be made more performant,
|
||||
after all it really depends on what you put inside them and APM will provide you with the necessary insight on which
|
||||
methods are the problem.
|
||||
|
||||
<h3 id="heavy-actions">Heavy actions</h3>
|
||||
|
||||
In general heavy tasks that take a lot of resources or take long and block the server for that time should be taken out
|
||||
and instead be run in its own server that focuses just on running those heavy tasks. This can be another Meteor server
|
||||
In general heavy tasks that take a lot of resources or take long and block the server for that time should be taken out
|
||||
and instead be run in its own server that focuses just on running those heavy tasks. This can be another Meteor server
|
||||
or even better something specifically optimized for that given task.
|
||||
|
||||
<h3 id="reoccurring-jobs">Reoccurring jobs</h3>
|
||||
|
||||
Reoccurring jobs are another prime candidate to be taken out into its own application. What this means is that you will have
|
||||
an independent server that is going to be tasked with running the reoccurring jobs and the main application will only add to
|
||||
Reoccurring jobs are another prime candidate to be taken out into its own application. What this means is that you will have
|
||||
an independent server that is going to be tasked with running the reoccurring jobs and the main application will only add to
|
||||
the list and be recipient of the results, most likely via database results.
|
||||
|
||||
<h3 id="rate-limiting">Rate limiting</h3>
|
||||
|
||||
Rate limit your methods to reduce effectiveness of DDOS attack and spare your server. This is also a good practice to
|
||||
ensure that you don't accidentally DDOS your self. For example a user who clicks multiple time on a button that triggers
|
||||
an expensive function. In this example you should also in general ensure that any button that triggers a server event
|
||||
Rate limit your methods to reduce effectiveness of DDOS attack and spare your server. This is also a good practice to
|
||||
ensure that you don't accidentally DDOS your self. For example a user who clicks multiple time on a button that triggers
|
||||
an expensive function. In this example you should also in general ensure that any button that triggers a server event
|
||||
should be disabled until there is a response from the server that the event has finished.
|
||||
|
||||
You can and should rate limit both methods and collections.
|
||||
@@ -154,15 +154,15 @@ These are all applicable, and you should spend some time researching into them a
|
||||
|
||||
<h3 id="mongo-ip-whitelisting">IP whitelisting</h3>
|
||||
|
||||
If your MongoDB hosting provider allows it, you should make sure that you whitelist the IPs of your application servers.
|
||||
If you don't then your database servers are likely to come under attack from hackers trying to brute force their way in.
|
||||
If your MongoDB hosting provider allows it, you should make sure that you whitelist the IPs of your application servers.
|
||||
If you don't then your database servers are likely to come under attack from hackers trying to brute force their way in.
|
||||
Besides the security risk this also impacts performance as authentication is not a cheap operation and it will impact performance.
|
||||
|
||||
See [Galaxy guide](https://galaxy-guide.meteor.com/container-environment.html#network-outgoing) on IP whitelisting to get IPs for your Galaxy servers.
|
||||
|
||||
<h3 id="mongodb-indexes">Indexes</h3>
|
||||
|
||||
While single indexes on one field are helpful on simple query calls, you will most likely have more advance queries with
|
||||
While single indexes on one field are helpful on simple query calls, you will most likely have more advance queries with
|
||||
multiple variables. To cover those you will need to create compound indexes. For example:
|
||||
|
||||
```javascript
|
||||
@@ -177,7 +177,7 @@ Statistics.createIndexAsync(
|
||||
```
|
||||
When creating indexes you should sort the variables in ESR (equity, sort, range) style.
|
||||
Meaning, first you put variables that will be equal to something specific. Second you put variables that sort things,
|
||||
and third variables that provide range for that query.
|
||||
and third variables that provide range for that query.
|
||||
Further you should order these variables in a way that the fields that filter the most should be first.
|
||||
|
||||
Make sure that all the indexes are used and remove unused indexes as leaving unused indexes will have negative impact
|
||||
@@ -187,7 +187,7 @@ on performance as the database will have to still keep track on all the indexed
|
||||
|
||||
To optimize finds ensure that all queries have are indexed. Meaning that any `.find()` variables should be indexed as described above.
|
||||
|
||||
All your finds should have a limit on the return so that the database stops going through the data once it has reached
|
||||
All your finds should have a limit on the return so that the database stops going through the data once it has reached
|
||||
the limit, and you only return the limited number of results instead of the whole database.
|
||||
|
||||
Beware of queries with `n + 1` issue. For example in a database that has cars and car owners. You don't want to get cars,
|
||||
@@ -202,14 +202,14 @@ If you still have issues make sure that you read data from secondaries.
|
||||
|
||||
<h3 id="beware-of-collection-hooks">Beware of collection hooks</h3>
|
||||
|
||||
While collection hooks can help in many cases beware of them and make sure that you understand how they work as they might
|
||||
create additional queries that you might not know about. Make sure to review packages that use them so that they won't
|
||||
While collection hooks can help in many cases beware of them and make sure that you understand how they work as they might
|
||||
create additional queries that you might not know about. Make sure to review packages that use them so that they won't
|
||||
create additional queries.
|
||||
|
||||
<h3 id="mongodb-caching">Caching</h3>
|
||||
|
||||
Once your user base increases you want to invest into query caching like using Redis, Redis Oplog and other.
|
||||
For more complex queries or when you are retrieving data from multiple collections, then you want to use [aggregation](https://www.mongodb.com/docs/manual/aggregation/)
|
||||
For more complex queries or when you are retrieving data from multiple collections, then you want to use [aggregation](https://www.mongodb.com/docs/manual/aggregation/)
|
||||
and save their results.
|
||||
|
||||
<h2 id="scaling">Scaling</h2>
|
||||
@@ -229,13 +229,13 @@ Galaxy has these as well. Learn more about [setting triggers for scaling on Gala
|
||||
|
||||
Setting this is vital, so that your application can keep on running when you have extra people come and then saves you money by scaling down when the containers are not in use.
|
||||
When initially setting these pay a close attention to the performance of your app. you need to learn when is the right time to scale your app so it has enough time to spin up new containers before the existing one get overwhelmed by traffic and so on.
|
||||
There are other points to pay attention to as well. For example if your app is used by corporation you might want to setup that on weekdays the minimum number of containers is going to increase just before the start of working hours and the then decrease the minimum to 1 for after hours and on weekends.
|
||||
There are other points to pay attention to as well. For example if your app is used by corporation you might want to setup that on weekdays the minimum number of containers is going to increase just before the start of working hours and the then decrease the minimum to 1 for after hours and on weekends.
|
||||
|
||||
Usually when you are working on performance issues you will have higher numbers of containers as you optimize your app. It is therefore vital to revisit your scaling setting after each rounds of improvements to ensure that scaling triggers are properly optimized.
|
||||
|
||||
<h2 id="packages">Packages</h2>
|
||||
|
||||
During development, it is very tempting to add packages to solve issue or support some features.
|
||||
This should be done carefully and each package should be wetted carefully if it is a good fit for the application.
|
||||
Besides security and maintenance issues you also want to know which dependencies given package introduces and
|
||||
During development, it is very tempting to add packages to solve issue or support some features.
|
||||
This should be done carefully and each package should be wetted carefully if it is a good fit for the application.
|
||||
Besides security and maintenance issues you also want to know which dependencies given package introduces and
|
||||
as a whole what will be the impact on performance.
|
||||
|
||||
@@ -3,119 +3,4 @@ title: How to migrate to Meteor Async in Meteor 2.x
|
||||
description: How to migrate your application to async methods and be ready to 3.0.
|
||||
---
|
||||
|
||||
In the new Meteor 3.0, Meteor moves its methods/operations to asynchronous. In the past, version 2.x was using Fibers, our promise solution, which is no longer supported since Node 16, and to follow the community standards, we are moving to `async` and `await`.
|
||||
|
||||
Here are a couple of methods that are now async, and you need to refactor them. Instead of findOne, you need to use the suffix Async, findOneAsync, for example:
|
||||
|
||||
Mongo.Collection:
|
||||
- findOneAsync
|
||||
- insertAsync
|
||||
- removeAsync
|
||||
- updateAsync
|
||||
- upsertAsync
|
||||
|
||||
Collection.Cursor:
|
||||
- countAsync
|
||||
- fetchAsync
|
||||
- forEachAsync
|
||||
- mapAsync
|
||||
|
||||
accounts-base:
|
||||
- Meteor.userAsync()
|
||||
|
||||
callback-hook:forEachAsync
|
||||
- forEachAsync
|
||||
|
||||
ddp-server
|
||||
- Meteor.callAsync()
|
||||
|
||||
The complete list of updated methods is listed [here](https://github.com/meteor/meteor/blob/d5c3b2eeafd0ad78ee7e2553f3f269c5c2a2e2a9/docs/generators/changelog/versions/3.0.md#L5-L17).
|
||||
|
||||
If you want to understand better what was changed and the context of Fibers, read these complementary posts:
|
||||
- [2.8](https://grubba.medium.com/new-meteor-2-8-and-the-new-mongodb-async-ap-edbcb853869a?source=user_profile---------9----------------------------) _New Meteor 2.8 and the new MongoDB Async API_
|
||||
- [2.8.1](https://grubba.medium.com/new-meteor-2-8-1-and-adding-types-to-the-core-8a6ee56f0141?source=user_profile---------7----------------------------) _New MeteorJS 2.8.1 and adding types to the core_
|
||||
- [2.9](https://blog.meteor.com/new-meteorjs-2-9-and-the-new-scaffold-api-5fcc0f3b1ce5) _New MeteorJS 2.9 and the new Scaffold API_
|
||||
- [2.10](https://blog.meteor.com/new-meteor-js-2-10-and-the-async-tracker-feature-ffdbe817c801) _New Meteor.js 2.10 and the Async Tracker Feature_
|
||||
- [2.11](https://grubba.medium.com/new-meteor-2-11-and-the-new-embedded-mongodb-19767076961b?source=user_profile---------4----------------------------) _New Meteor 2.11 and the new embedded MongoDB_
|
||||
- [2.12](https://grubba.medium.com/new-meteor-js-2-12-and-the-blaze-2-6-2-release-b72c2a7a593f?source=user_profile---------1----------------------------) _New Meteor.js 2.12 and Blaze 2.6.2 Release_
|
||||
- [2.13](https://grubba.medium.com/new-meteor-js-2-13-node-js-14-21-4-security-patch-and-blaze-2-7-1-release-60134947e4c?source=user_profile---------0----------------------------) _New Meteor.js 2.13, Node.js 14.21.4 security patch and Blaze 2.7.1 release_
|
||||
|
||||
To help Meteor users update their apps to the new Meteor version, you can follow this guide with some insights on how to do it.
|
||||
|
||||
## Use at least Meteor version [2.8](https://blog.meteor.com/new-meteor-2-8-and-the-new-mongodb-async-ap-edbcb853869a)
|
||||
|
||||
We recommend starting the async migration by updating your application to 2.8 or newer, as you can do this progressively. Unlike 3.0, you can simultaneously maintain the same codebase with the new asynchronous and old synchronous behaviors. Ideally, you should update to the latest version of Meteor 2.x and carefully follow each changelog. After you refactor all your code to async in version 2.x, you can more easily update it to version 3.0 by following all the changes listed in its [changelog](https://github.com/meteor/meteor/blob/d5c3b2eeafd0ad78ee7e2553f3f269c5c2a2e2a9/docs/generators/changelog/versions/3.0.md).
|
||||
|
||||
To help with this update, we suggest you use a [codemod](https://www.sitepoint.com/getting-started-with-codemods/) to automate part of the refactoring process. Follow [this script](https://github.com/minhna/meteor-async-migration) created by [minhna](https://github.com/minhna). The project has documentation explaining how to run the script. This codemod should only affect the server side of your application. Starting the update from the front end or back end is a personal choice. While starting from the server side is a valid approach, it is essential to evaluate whether migrating features one by one might be a better strategy. This way, you can resolve errors incrementally and avoid the risk of encountering multiple client-side issues that could break the entire application.
|
||||
|
||||
A helpful feature of the script is that it will refactor some methods to async, such as findOne, count, and other methods from the accounts-base package, such as `Meteor.user()`, and also the function that calls these methods by adding an 'async' before them.
|
||||
|
||||
## Edge cases
|
||||
Depending on your codebase, the codemod may not work in some specific scenarios. We'll list some edge case examples, and if this is the case for your codebase, you'll need to make the changes manually or refactor the codemod.
|
||||
|
||||
### MongoDB methods updates
|
||||
A possible edge case is if you are defining your MongoDB collection using the `meteor/quave:collections` package, the codemod will check if it is a MongoDB collection by checking the form of the imports - this means that when the script reads the import coming from ` quave`, it will not consider this to be a MongoDB collection.
|
||||
|
||||
### Async functions
|
||||
Let's assume your codebase has the same or similar issue listed above. This may imply some problems in refactoring for async functions since the codemod does not correspond to any async method case. This can generate other side effects that imply issues with refactoring forEachAsync, mapAsync, and others.
|
||||
|
||||
### How do we identify those edge cases?
|
||||
To identify these edge cases, you can use the search feature in your IDE to find your methods and start refactoring by running your refactored codemod or updating the code manually. Since it now only affects the server side, after refactoring, you can run your application, observe the errors that will occur in your terminal, and fix them progressively.
|
||||
After refactoring the server side to async, your application will run without errors, and then you can move to the client side.
|
||||
|
||||
## Changes for Blaze projects (at least [2.7](https://www.blazejs.org/changelog#v2702023may23))
|
||||
In Blaze, every HTML file has a related JavaScript file. After refactoring the JavaScript file to async, you will get a Promise wrapping the value instead of the actual value. To present it on your front end, you must unwrap it. Let's see an example:
|
||||
|
||||
```javascript
|
||||
{{#let shouldFlag=isFlagged}}
|
||||
{{#if @pending 'shouldFlag' }}
|
||||
<span class="stat-loading"><span class="icon-loading"></span></span>
|
||||
{{/if}}
|
||||
{{#if @rejected 'shouldFlag' }}
|
||||
<span class="stat-err"><span class="icon-err"></span></span>
|
||||
{{/if}}
|
||||
{{#if @resolved 'shouldFlag' }}
|
||||
<span class="stat-flag"><span class="icon-flag"></span></span>
|
||||
{{/if}}
|
||||
{{/let}}
|
||||
```
|
||||
|
||||
If you don't unwrap the value, you will get an unresolved promise on the front end. You can use Blaze [Async States](https://www.blazejs.org/api/spacebars#Async-states), which uses the Spacebars Meteor package to handle the promise state. With it, you can handle different states and return appropriate content.
|
||||
|
||||
## Changes for React projects
|
||||
We recommend installing the package `react-meteor-data`, which contains hooks for these new asynchronous methods. If you use `useFind` on the server side, with SSR, for example, you will need to use the new suspense/useFind hook. We recommend reading the [New Suspense Hooks for Meteor](https://blog.meteor.com/new-suspense-hooks-for-meteor-5391570b3007) article to understand this package better. Example:
|
||||
|
||||
```javascript
|
||||
const TaskList = () => {
|
||||
useSubscribe("tasks");
|
||||
const tasks = useTracker('tasks',() => TasksCollection.find({}).fetch());
|
||||
return (
|
||||
<ul>
|
||||
{tasks.map((task) => (
|
||||
<Task key={task._id} task={task} />
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
|
||||
export const App = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1>Welcome to Meteor!</h1>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<TaskList />
|
||||
<UserProfile />
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
Note that we're not using the if (loading) anymore. To see a practical project, you can check [simpletasks](https://github.com/fredmaiaarantes/simpletasks/), which already use asynchronous API.
|
||||
|
||||
If you use `Tracker.autorun()`, for example, reading about the tracker with the [async callback function](https://blog.meteor.com/new-meteor-js-2-10-and-the-async-tracker-feature-ffdbe817c801) is also recommended.
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
We hope to make your transition easier with these instructions, references, and tools. You may face some challenges, but remember that you can progressively refactor it. For more detailed updates on Meteor 3.0, please check our [Fibers project board](https://github.com/orgs/meteor/projects/10) and the [Meteor 3.0 PR](https://github.com/meteor/meteor/pull/12359).
|
||||
Please visit [Migrating to Async in Meteor 2.x](https://v3-migration-docs.meteor.com/migrating-to-async-in-v2/) for more up-to-date information on getting your Meteor 2 application ready for Meteor 3.0.
|
||||
@@ -36,9 +36,9 @@ Each of these points will have their own section below.
|
||||
|
||||
<h3 id="allow-deny">Avoid allow/deny</h3>
|
||||
|
||||
In this guide, we're going to take a strong position that using [allow](http://docs.meteor.com/#/full/allow) or [deny](http://docs.meteor.com/#/full/deny) to run MongoDB queries directly from the client is not a good idea. The main reason is that it is hard to follow the principles outlined above. It's extremely difficult to validate the complete space of possible MongoDB operators, which could potentially grow over time with new versions of MongoDB.
|
||||
In this guide, we're going to take a strong position that using [allow](https://docs.meteor.com/api/collections.html#Mongo-Collection-allow) or [deny](https://docs.meteor.com/api/collections.html#Mongo-Collection-deny) to run MongoDB queries directly from the client is not a good idea. The main reason is that it is hard to follow the principles outlined above. It's extremely difficult to validate the complete space of possible MongoDB operators, which could potentially grow over time with new versions of MongoDB.
|
||||
|
||||
There have been several articles about the potential pitfalls of accepting MongoDB update operators from the client, in particular the [Allow & Deny Security Challenge](https://www.discovermeteor.com/blog/allow-deny-security-challenge/) and its [results](https://www.discovermeteor.com/blog/allow-deny-challenge-results/), both on the Discover Meteor blog.
|
||||
There have been several articles about the potential pitfalls of accepting MongoDB update operators from the client, in particular the [Allow & Deny Security Challenge](https://web.archive.org/web/20220705130732/https://www.discovermeteor.com/blog/allow-deny-security-challenge/) and its [results](https://web.archive.org/web/20220819163744/https://www.discovermeteor.com/blog/allow-deny-challenge-results/), both on the Discover Meteor blog.
|
||||
|
||||
Given the points above, we recommend that all Meteor apps should use Methods to accept data input from the client, and restrict the arguments accepted by each Method as tightly as possible.
|
||||
|
||||
@@ -80,9 +80,9 @@ Meteor.methods({
|
||||
|
||||
If someone comes along and passes a non-ID selector like `{}`, they will end up deleting the entire collection.
|
||||
|
||||
<h3 id="validated-method">mdg:validated-method</h3>
|
||||
<h3 id="jam-method">jam:method</h3>
|
||||
|
||||
To help you write good Methods that exhaustively validate their arguments, we've written a wrapper package for Methods that enforces argument validation. Read more about how to use it in the [Methods article](methods.html#validated-method). The rest of the code samples in this article will assume that you are using this package. If you aren't, you can still apply the same principles but the code will look a little different.
|
||||
To help you write good Methods that exhaustively validate their arguments, you can use a community package for Methods that enforces argument validation. Read more about how to use it in the [Methods article](methods.html#jam-method). The rest of the code samples in this article will assume that you are using this package. If you aren't, you can still apply the same principles but the code will look a little different.
|
||||
|
||||
<h3 id="user-id-client">Don't pass userId from the client</h3>
|
||||
|
||||
@@ -116,25 +116,25 @@ The _only_ times you should be passing any user ID as an argument are the follow
|
||||
The best way to make your app secure is to understand all of the possible inputs that could come from an untrusted source, and make sure that they are all handled correctly. The easiest way to understand what inputs can come from the client is to restrict them to as small of a space as possible. This means your Methods should all be specific actions, and shouldn't take a multitude of options that change the behavior in significant ways. The end goal is that you can look at each Method in your app and validate or test that it is secure. Here's a secure example Method from the Todos example app:
|
||||
|
||||
```js
|
||||
export const makePrivate = new ValidatedMethod({
|
||||
export const makePrivate = new createMethod({
|
||||
name: 'lists.makePrivate',
|
||||
validate: new SimpleSchema({
|
||||
listId: { type: String }
|
||||
}).validator(),
|
||||
run({ listId }) {
|
||||
async run({ listId }) {
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('lists.makePrivate.notLoggedIn',
|
||||
'Must be logged in to make private lists.');
|
||||
}
|
||||
|
||||
const list = Lists.findOne(listId);
|
||||
const list = await Lists.findOneAsync(listId);
|
||||
|
||||
if (list.isLastPublicList()) {
|
||||
throw new Meteor.Error('lists.makePrivate.lastPublicList',
|
||||
'Cannot make the last public list private.');
|
||||
}
|
||||
|
||||
Lists.update(listId, {
|
||||
await Lists.updateAsync(listId, {
|
||||
$set: { userId: this.userId }
|
||||
});
|
||||
|
||||
@@ -148,16 +148,16 @@ You can see that this Method does a _very specific thing_ - it makes a single li
|
||||
However, this doesn't mean you can't have any flexibility in your Methods. Let's look at an example:
|
||||
|
||||
```js
|
||||
Meteor.users.methods.setUserData = new ValidatedMethod({
|
||||
Meteor.users.methods.setUserData = new createMethod({
|
||||
name: 'Meteor.users.methods.setUserData',
|
||||
validate: new SimpleSchema({
|
||||
fullName: { type: String, optional: true },
|
||||
dateOfBirth: { type: Date, optional: true },
|
||||
}).validator(),
|
||||
run(fieldsToSet) {
|
||||
Meteor.users.update(this.userId, {
|
||||
async run(fieldsToSet) {
|
||||
return (await Meteor.users.updateAsync(this.userId, {
|
||||
$set: fieldsToSet
|
||||
});
|
||||
}));
|
||||
}
|
||||
});
|
||||
```
|
||||
@@ -200,7 +200,8 @@ if (Meteor.isServer) {
|
||||
|
||||
This will make every Method only callable 5 times per second per connection. This is a rate limit that shouldn't be noticeable by the user at all, but will prevent a malicious script from totally flooding the server with requests. You will need to tune the limit parameters to match your app's needs.
|
||||
|
||||
If you're using validated methods, there's an available [ddp-rate-limiter-mixin](https://github.com/nlhuykhang/ddp-rate-limiter-mixin).
|
||||
If you're using `jam:method`, it comes with built in [rate-limiting](https://github.com/jamauro/method#rate-limiting).
|
||||
|
||||
|
||||
<h2 id="publications">Publications</h2>
|
||||
|
||||
@@ -274,10 +275,10 @@ Publications are not reactive, and they only re-run when the currently logged in
|
||||
|
||||
```js
|
||||
// #1: Bad! If the owner of the list changes, the old owner will still see it
|
||||
Meteor.publish('list', function (listId) {
|
||||
Meteor.publish('list', async function (listId) {
|
||||
check(listId, String);
|
||||
|
||||
const list = Lists.findOne(listId);
|
||||
const list = await Lists.findOneAsync(listId);
|
||||
|
||||
if (list.userId !== this.userId) {
|
||||
throw new Meteor.Error('list.unauthorized',
|
||||
@@ -351,7 +352,7 @@ export const MMR = {
|
||||
|
||||
```js
|
||||
// In a file loaded on client and server
|
||||
Meteor.users.methods.updateMMR = new ValidatedMethod({
|
||||
Meteor.users.methods.updateMMR = new createMethod({
|
||||
name: 'Meteor.users.methods.updateMMR',
|
||||
validate: null,
|
||||
run() {
|
||||
@@ -470,7 +471,7 @@ Generally speaking, all production HTTP requests should go over HTTPS, and all W
|
||||
It's best to handle the redirection from HTTP to HTTPS on the platform which handles the SSL certificates and termination.
|
||||
|
||||
* On [Galaxy](deployment.html#galaxy), enable the "Force HTTPS" setting on a specific domain in the "Domains & Encryption" section of the application's "Settings" tab.
|
||||
* Other deployments *may* have control panel options or may need to be manually configured on the the proxy server (e.g. HAProxy, nginx, etc.). The articles linked above provide some assistance on this.
|
||||
* Other deployments *may* have control panel options or may need to be manually configured on the proxy server (e.g. HAProxy, nginx, etc.). The articles linked above provide some assistance on this.
|
||||
|
||||
In the event that a platform does not offer the ability to configure this, the `force-ssl` package can be added to the project and Meteor will attempt to intelligently redirect based on the presence of the `x-forwarded-for` header.
|
||||
|
||||
@@ -497,7 +498,7 @@ By default, Helmet can be used to set various HTTP headers (see link above). The
|
||||
import helmet from "helmet";
|
||||
|
||||
// Within server side Meter.startup()
|
||||
WebApp.connectHandlers.use(helmet())
|
||||
WebApp.handlers.use(helmet())
|
||||
```
|
||||
|
||||
At a minimum, Meteor recommends users to set the following headers. Note that code examples shown below are specific to Helmet.
|
||||
@@ -517,7 +518,7 @@ By default, Meteor recommends unsafe inline scripts and styles are allowed, sinc
|
||||
import helmet from "helmet";
|
||||
|
||||
// Within server side Meter.startup()
|
||||
WebApp.connectHandlers.use(
|
||||
WebApp.handlers.use(
|
||||
helmet.contentSecurityPolicy({
|
||||
directives: {
|
||||
defaultSrc: ["'self'"],
|
||||
@@ -696,7 +697,7 @@ With Helmet, Frameguard sets the X-Frame-Options header.
|
||||
import helmet from "helmet";
|
||||
|
||||
// Within server side Meter.startup()
|
||||
WebApp.connectHandlers.use(helmet.frameguard()); // defaults to sameorigin
|
||||
WebApp.handlers.use(helmet.frameguard()); // defaults to sameorigin
|
||||
```
|
||||
For more detail please read the following guide: [Frameguard](https://helmetjs.github.io/docs/frameguard/).
|
||||
|
||||
|
||||
@@ -238,9 +238,11 @@ import { Tracker } from 'meteor/tracker';
|
||||
const withDiv = function withDiv(callback) {
|
||||
const el = document.createElement('div');
|
||||
document.body.appendChild(el);
|
||||
let view = null
|
||||
try {
|
||||
callback(el);
|
||||
view = callback(el);
|
||||
} finally {
|
||||
if (view) Blaze.remove(view)
|
||||
document.body.removeChild(el);
|
||||
}
|
||||
};
|
||||
@@ -248,9 +250,10 @@ const withDiv = function withDiv(callback) {
|
||||
export const withRenderedTemplate = function withRenderedTemplate(template, data, callback) {
|
||||
withDiv((el) => {
|
||||
const ourTemplate = isString(template) ? Template[template] : template;
|
||||
Blaze.renderWithData(ourTemplate, data, el);
|
||||
const view = Blaze.renderWithData(ourTemplate, data, el);
|
||||
Tracker.flush();
|
||||
callback(el);
|
||||
return view
|
||||
});
|
||||
};
|
||||
```
|
||||
|
||||
@@ -11,9 +11,9 @@ Meteor supports many view layers.
|
||||
The most popular are:
|
||||
- [React](react.html): official [page](http://reactjs.org/)
|
||||
- [Blaze](blaze.html): official [page](http://blazejs.org/)
|
||||
- [Angular](http://www.angular-meteor.com): official [page](https://angular.io/)
|
||||
- [Angular](angular.html): official [page](https://angular.io/)
|
||||
- [Vue](vue.html): official [page](https://vuejs.org/)
|
||||
- [Svelte](https://www.meteor.com/tutorials/svelte/creating-an-app): official [page](https://svelte.dev/)
|
||||
- [Svelte](svelte.html): official [page](https://svelte.dev/)
|
||||
|
||||
If you are starting with web development we recommend that you use Blaze as it's very simple to learn.
|
||||
|
||||
|
||||
@@ -41,6 +41,12 @@ Meteor's build tool and Pub/Sub API (or Apollo) provides Vue with this API that
|
||||
|
||||
<h3 id="integrating-vue-with-meteor">Integrating Vue With Meteor</h3>
|
||||
|
||||
Creating vue3 app
|
||||
|
||||
```
|
||||
meteor create --vue
|
||||
```
|
||||
|
||||
To start a new project:
|
||||
|
||||
```sh
|
||||
@@ -424,7 +430,7 @@ VueSSR.createApp = function (context) {
|
||||
|
||||
<h3 id="async-data-and-hydration">Async data and Hydration</h3>
|
||||
|
||||
Hydration is the the word for loading state into components on the serverside and then reusing that data on the clientside.
|
||||
Hydration is the word for loading state into components on the serverside and then reusing that data on the clientside.
|
||||
This allows components to fully render their markup on the server and prevents a 're-render' on the clientside when the bundle is loaded.
|
||||
|
||||
[Nuxt](https://nuxtjs.org/) solves this gracefully with a feature called [asyncData](https://nuxtjs.org/guide/async-data).
|
||||
|
||||
@@ -296,6 +296,14 @@ Package.onTest(function(api) {
|
||||
|
||||
From within your test entry point, you can import other files as you would in the package proper.
|
||||
|
||||
You can also use [`mtest`](https://github.com/zodern/mtest) to test your packages like so:
|
||||
|
||||
```bash
|
||||
mtest --package ./ --once 2.14
|
||||
```
|
||||
|
||||
Which helps immensely if you'd like to test your package in CI/CD setup. You can see an example [here](https://github.com/monti-apm/monti-apm-agent/blob/master/.github/workflows/test.yml).
|
||||
|
||||
You can read more about testing in Meteor in the [Testing article](testing.html).
|
||||
|
||||
<h2 id="publishing-atmosphere">Publishing your package</h2>
|
||||
|
||||
12
meteor
12
meteor
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BUNDLE_VERSION=14.21.4.3
|
||||
|
||||
BUNDLE_VERSION=22.18.0.3
|
||||
|
||||
# OS Check. Put here because here is where we download the precompiled
|
||||
# bundles that are arch specific.
|
||||
# Use of : "${ARCH:=$(uname)}" assignment permits users to set their
|
||||
# architecture manually; this is useful for multi-arch systems whose
|
||||
# uname executables may sometimes return different architectures in
|
||||
# uname executables may sometimes return different architectures
|
||||
# in
|
||||
# different contexts.
|
||||
# Ex: ARCH=arm64 meteor ARGS...;
|
||||
UNAME="$(uname)"
|
||||
@@ -31,9 +31,9 @@ if [ "$UNAME" = "Darwin" ] ; then
|
||||
fi
|
||||
elif [ "$UNAME" = "Linux" ] ; then
|
||||
: "${ARCH:=$(uname -m)}"
|
||||
if [ "$ARCH" != "x86_64" ] ; then
|
||||
if [[ "$ARCH" != "x86_64" && "$ARCH" != "aarch64" ]] ; then
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
echo "Meteor only supports x86_64"
|
||||
echo "Meteor only supports x86_64 and aarch64"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -122,6 +122,7 @@ fi
|
||||
|
||||
DEV_BUNDLE="$SCRIPT_DIR/dev_bundle"
|
||||
METEOR="$SCRIPT_DIR/tools/index.js"
|
||||
PROCESS_REQUIRES="$SCRIPT_DIR/tools/node-process-warnings.js"
|
||||
|
||||
# Set the nofile ulimit as high as permitted by the hard-limit/kernel
|
||||
if [ "$(ulimit -Sn)" != "unlimited" ]; then
|
||||
@@ -147,5 +148,6 @@ fi
|
||||
exec "$DEV_BUNDLE/bin/node" \
|
||||
--max-old-space-size=4096 \
|
||||
--no-wasm-code-gc \
|
||||
--require="$PROCESS_REQUIRES"\
|
||||
${TOOL_NODE_FLAGS} \
|
||||
"$METEOR" "$@"
|
||||
|
||||
@@ -48,6 +48,7 @@ SET BABEL_CACHE_DIR=%~dp0\.babel-cache
|
||||
|
||||
"%~dp0\dev_bundle\bin\node.exe" ^
|
||||
--no-wasm-code-gc ^
|
||||
--require="%~dp0\tools\node-process-warnings.js" ^
|
||||
%TOOL_NODE_FLAGS% ^
|
||||
"%~dp0\tools\index.js" %*
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user