Commit Graph

106 Commits

Author SHA1 Message Date
Leonardo Venturini
eb1da723b9 rename variable (#13224) 2024-07-11 08:41:57 -04:00
denihs
9a3e70f39a Look deeper in the node modules to find more dependencies 2023-07-05 16:10:13 -04:00
denihs
5d0044d57d - fix function types 2023-03-22 13:47:31 -04:00
zodern
c727788332 Rename fibersDisabled to isFibersDisabled 2023-03-06 10:45:29 -06:00
zodern
8babb0c8de Use features to configure async-await plugin 2023-03-03 17:09:19 -06:00
zodern
ae49aa44bb Use __meteor_bootstrap__ to check if fibers enabled 2023-03-03 17:07:23 -06:00
zodern
1e718277fb Remove await's for archinfo.host 2023-01-30 13:55:30 -06:00
Matheus Castro
f116c45038 Remove Fibers from meteor-tools:
- Re-enable caching in meteor-tools.
2023-01-05 18:14:59 -03:00
Matheus Castro
519871dfc4 Remove Fibers from meteor-tools:
- Completely remove promise overload from code.
- Bump dev_bundle version and remove fibers/meteor-promise dependency.
- Bump meteor package promise version.
- Remove some tests that are not needed anymore.
2022-12-25 23:24:46 -03:00
Matheus Castro
170e5d3f6d Remove Fibers from meteor-tools:
- Adapt forkJoin and other files functions to correctly be awaited.
2022-12-22 14:09:27 -03:00
Matheus Castro
855ce036ec Remove Fibers from meteor-tools:
- Adapt Profile to run with both sync and async functions.
2022-12-20 19:20:56 -03:00
Matheus Castro
568c5f05f6 Merge remote-tracking branch 'origin/fibers-optional-no-tla-pkgs' into fibers-optional-no-tla-pkgs
# Conflicts:
#	tools/isobuild/bundler.js
#	tools/meteor-services/service-connection.js
#	tools/utils/buildmessage.js
2022-12-05 17:25:07 -03:00
Matheus Castro
4c68d5342c Remove Fibers for Meteor Tools:
- Adapting the import-scanner to correctly check the files and create the dependency graph.
- Still having errors.
2022-12-05 17:23:54 -03:00
Matheus Castro
b1a6cc0761 Remove Fibers for meteor tools: turns out the package building is still not done. Still need to check why it's failing to require node_modules when evaluating/loading the plugin. 2022-12-04 00:27:50 -03:00
Edimar Cardoso
de04cfe676 Update Node Version, NPM Version and tools to work without Fibers
- Update node version to 18.12.1
- Update npm version to 7.24.2 (last before 8)
- Update commands to use async

---
NPM 8 break changes

Error: The programmatic API was removed in npm v8.0.0
https://github.com/npm/cli/blob/latest/index.js
2022-12-01 10:43:48 -03:00
Matheus Castro
4b31d2b352 Remove Fibers for meteor tools:
- Package building is done, at least I hope so!
2022-11-26 00:09:33 -03:00
Matheus Castro
022a7e9303 Remove Fibers for meteor tools:
- Changing package/compile steps to use async/await.
2022-11-25 20:15:37 -03:00
Denilson
aece11a87f Revert "Revert "Refactoring/Remove unused imports from tools folder"" 2022-07-13 08:37:42 -04:00
Denilson
f8114747cd Revert "Refactoring/Remove unused imports from tools folder" 2022-07-13 08:33:07 -04:00
afrokick
094cb6b322 remove unused imports from tools 2022-07-06 19:27:53 +03:00
Jan Dvorak
b6e127cfc9 Minor tools update
Replace underscore where easy and feasible & other minor modernization that I came across.
2021-06-25 00:36:03 +02:00
Jan Dvorak
456d62eb91 Merge pull request #11411 from meteor/update-meteor-babel
Meteor Babel 7.11.0
2021-05-10 22:15:22 +09:00
Jan Dvorak
3abb6f1512 Fix old import 2021-05-08 14:00:59 +02:00
Jan Dvorak
8ec9f0b7be meteor-babel => @meteorjs/babel 2021-05-07 19:43:37 +02:00
zodern
b0fed062ae Fix env var name 2021-04-26 14:33:19 -05:00
zodern
6038bd5c59 Add cache for reify runtime compiler 2021-04-26 13:57:12 -05:00
Brian Mulhall
c68757a52c remove the xmlbuilder isopack and all references to it in the code 2020-02-25 15:44:44 -05:00
Ben Newman
4fe8af4193 Use require("meteor-babel/register").excludeFile.
The excludeFile API was introduced in meteor-babel@7.8.1:
bfded57377

Modules that are evaluated before meteor-babel/register is configured
should not be transformed by meteor-babel, even if they are imported again
later, after meteor-babel/register has been configured.

If my analysis is correct, this change should prevent the dreaded

  Must export a default export when using ES6 modules.

error, as seen most recently in
https://travis-ci.org/meteor/meteor/builds/638030190
and https://circleci.com/gh/meteor/meteor/40863.
2020-01-16 12:33:54 -05:00
Ben Newman
407b2d17cb Remove eslint and pre-commit hook to fix npm security warnings. 2019-11-14 17:34:29 -05:00
Ben Newman
1cf59867b2 Remove no-longer-necessary noYieldsAllowed wrapper from loadIsopackage. 2019-10-24 19:36:32 -04:00
Paulo Mogollón
2ae2690f3a Convert tools/utils/archinfo.js to TypeScript. (#10624)
* Updated code to use modern JS
* Added types
* Stopped using 2 underscore functions (1 remaining)
2019-07-21 12:01:24 -04:00
Ben Newman
769337551e Convert tools/tool-env/profile.js to TypeScript.
Unfortunately, this conversion triggered an error due to one of the
shortcomings of the Babel implementation of TypeScript:

SyntaxError: /tools/tool-env/profile.ts: Namespace not marked type-only declare. Non-declarative namespaces are only supported experimentally in Babel. To enable and review caveats see: https://babeljs.io/docs/en/babel-plugin-transform-typescript
  278 | }
  279 |
> 280 | export namespace Profile {
      |                  ^
  281 |   export let enabled = !! process.env.METEOR_PROFILE;
  282 |
  283 |   export function time<TResult>(bucket: string, f: () => TResult) {
    at File.buildCodeFrameError (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/core/lib/transformation/file/file.js:261:12)
    at transpileNamespace (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/plugin-transform-typescript/lib/namespace.js:25:25)
    at PluginPass.TSModuleDeclaration (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/plugin-transform-typescript/lib/index.js:271:32)
    at newFn (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitMultiple (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/context.js:85:17)
    at TraversalContext.visit (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/context.js:144:19)
2019-07-06 09:18:35 -04:00
Ben Newman
8958cbc5e9 Convert tools/fs/watch.js to TypeScript. 2019-07-05 17:50:20 -04:00
Ben Newman
5ed64fb1db Remove explicit .js extension from tools/fs/files imports. 2019-07-04 10:32:09 -04:00
Ben Newman
c9ba0f3a22 Install latest Reify runtime in programs/server/main.js.
Also updated meteor-babel in the dev bundle to depend on reify@0.18.1, to
be consistent with the version used by server code.
2019-04-26 18:55:08 -04:00
Ben Newman
798a155c64 Enable Babel-powered TypeScript compilation of meteor/tools.
These changes pave the way for incrementally converting the implementation
of Meteor's command-line tool to TypeScript, which should have profound
benefits for self-documentation via types, as well as substantially
improving navigability and approachability for community contributors.

Just imagine being able to auto-complete the fields of the various
File-like classes currently floating around the codebase, instead of
having to track down their implementations every time. TypeScript was
designed with large projects like Meteor in mind, and it seems
increasingly irresponsible to forgo the benefits of a type system by
relying on the expertise of a few core contributors who know the codebase
inside and out. I am one of those few people, and I am very excited to
have the assistance of a type system, so I can only imagine how
transformative and empowering it will be for everyone else.

If you've ever wanted to get involved in core Meteor development, picking
a few meteor/tools modules to convert to TypeScript is a great way to get
to know that part of the codebase, while also making things easier for
everyone else who interacts with that code in the future.

Because we already compile meteor/tools using Babel, it makes the most
sense to use Babel's @babel/preset-typescript to compile .ts files:
https://babeljs.io/docs/en/next/babel-preset-typescript.html

Using Babel also means we get to keep all of our current advanced
compilation strategies, such as using Reify to compile module syntax:
https://www.npmjs.com/package/reify

Since we're using Babel, the meteor/tools/tsconfig.json file exists mostly
for the benefit of external tools like VSCode, rather than as a source of
truth for compilation behavior.

Despite our existing convention of including explicit .js file extensions
when importing modules, TypeScript and VSCode strongly encourage omitting
the file extension, so the import can be resolved to a .ts file in
development or a .js file when compiled. Although I find this ambiguity
somewhat unfortunate, it makes sense to follow community norms, at least
until Node.js begins supporting .ts modules by default.
2019-04-14 13:06:49 -04:00
Ben Newman
466cda693e Use wrapYieldingFiberMethods from @wry/context. 2019-04-10 18:48:10 -04:00
Ben Newman
5adb7c64ab Wrap Fiber.prototype.{run,throwInto} as well as Fiber.yield.
ddebed9b8a/fibers.js (L97-L100)
2019-04-10 17:14:26 -04:00
Ben Newman
0383f01c63 Update optimism and use noContext to isolate Fiber contexts.
The optimism package no longer knows anything about Fibers, but it does
export various helpers for managing execution contexts, one of which
(noContext) allows us to censor the current context for the duration of a
function call. By wrapping Fiber.yield with noContext, we keep distinct
Fibers from accidentally registering cache dependencies on one another.
2019-04-10 14:42:34 -04:00
Ben Newman
3a18f67ac2 Rely on native Node.js Promise implementation.
There's no reason to use a Promise polyfill in Node.js at this point.
2018-11-03 13:58:48 -04:00
Ben Newman
4a688d7ca9 Show web.browser.legacy rebuild time only when METEOR_PROFILE enabled.
In theory, these delayed rebuilds should not even be noticed, so it
doesn't make sense to draw attention to them.
2018-09-05 17:56:57 -04:00
Ben Newman
09950c403b Update reify npm package to version 0.17.2. 2018-07-31 20:48:25 -04:00
Ben Newman
77ed148614 Use listener API for communication between build/server processes.
Fixes #10073, per
https://github.com/meteor/meteor/issues/10073#issuecomment-405290391

While thinking about this bug, I realized that sending IPC messages to
specific packages in the server process was much less flexible than
sending messages based on an arbitrary topic string, since the topic
string approach allows both `autoupdate` and `dynamic-import` to listen
for the same message.

The topic string approach calls for a listener interface like
`onMessage(topic, callback)`, which elegantly replaces the previous
approach of requiring packages to export a single `onMessage` function.

However, because the `meteor` package does not have access to the module
system, implementing the `onMessage` listener interface in the `meteor`
package would have required exposing an API like `Meteor.onMessage(topic,
callback)`, which has an unpleasant global smell to it. Instead, the
`onMessage` function should be explicitly imported (using the module
system) from a less-generically-named package.

Since I knew I was going to have to move the message dispatch logic out of
the `meteor` package, I decided to create a new package called
`inter-process-messaging` to implement the parent/child components of the
IPC system.
2018-07-16 18:59:50 -04:00
Ben Newman
6407e4dafb Update meteor-babel to version 7.0.0-beta.49-1.
Also switching from babelOptions.sourceMap to babelOptions.sourceMaps,
finally: https://babeljs.io/docs/usage/api/#options
2018-05-25 18:43:13 -04:00
Ben Newman
a8b6accb11 Set .babel-cache directory correctly for command-line tool.
This depends on new functionality in meteor-babel@7.0.0-beta.46-3:
d5d2bbf81e
dea6465daf
2018-05-09 16:16:05 -04:00
Jesse Rosenberger
6f01d18252 Change tool "cleanup" module to use ESM format and remove Underscore. 2017-12-12 17:19:42 +02:00
Ben Newman
1a8efdc31f Merge branch 'devel' into release-1.6 2017-10-02 13:44:25 -04:00
Ben Newman
e85c69680d Combine all isopackets to share transitive dependencies. (#9168)
By my calculations, the sum of the sizes of the individual isopackets was
152MB, and the size of the combined isopacket is now just 36MB. That
remarkable difference goes to show how much duplication of transitive
dependencies was happening before this change.

That's a savings of 116MB for the (uncompressed) size of the meteor-tool
package. In Meteor 1.5.x, the meteor-tool package is about 544MB, but in
Meteor 1.6 it's considerably smaller: 373MB. In other words, this change
should reduce those sizes to 428MB (-21%) and 257MB (-31%), respectively.
2017-10-02 13:41:39 -04:00
Ben Newman
cbacc31dde Fix inline source maps in meteor/tools code. 2017-07-22 10:38:15 -04:00
Ben Newman
bd5370dda9 Fix mistaken usage of require(reify/lib/runtime).enable.
Related fix in meteor-babel@0.24.4:
786194734c
2017-07-22 09:17:05 -04:00