forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core-utils to ESM default #2
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make core-utils source (not test) ECMAScript compilable Change util scripts to be explicitly CommonJS This allows core-utils package to use "type": "module" by only changing build settings.
with CommonJS secondary support
jason-ha
commented
Dec 21, 2023
"bench": "mocha --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js", | ||
"bench:profile": "mocha --v8-prof --v8-logfile=profile.log --v8-no-logfile-per-isolate --timeout 999999 --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js && node --prof-process profile.log > profile.txt && rimraf profile.log && echo See results in profile.txt", | ||
"build": "fluid-build . --task build", | ||
"build:commonjs": "fluid-build . --task commonjs", | ||
"build:commonjs": "tsc-multi --config ./tsc-multi.cjs.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the fluid build system well enough. This task does not get run if I don't invoke it explicitly.
jason-ha
pushed a commit
that referenced
this pull request
Apr 30, 2024
…re, runtime, Loader in versioned tests (microsoft#20650) An extraction from microsoft#20621 Reason for changes These tests explode when I change interface between DDS & DataStore Description These tests are not written correctly. They mix arbitrary version of DDS with the latest version of FluidDataStoreRuntime (through TestFluidObjectFactory). We never supported such mixes - version of DDS has to match version or data store! Using matching TestFluidObjectFactory is easy, but then we start running into somewhat similar problem of mixing FluidDataStoreRuntime & ContainerRuntime. We support only N/N-1 mixes here, and nothing more. So we have to use the version provided by test framework, thus you see some dance above CodeLoader to get right factory. And while we are at it, it would be great for the test to use Loader version provided by test framework, not latest version. This breaks for old versions as the way test is written it works only for latest structure of the document. Previously test framework was running a ton of combos, but most of them were actually the same, as even when it was supplied different versions of loader, we were using only latest version of loader. So, the right fix here - use loader version provided by framework but skip all the tests that use old version of the loader, thus getting same result, but with fewer iterations (and faster tests). As part of fixing it, use proper back-compat compatible ways to get to entry points at loader & runtime layers.
jason-ha
pushed a commit
that referenced
this pull request
May 10, 2024
## Description This makes 3 changes to Tree.is: 1. calling Tree.is(node, SchemaNotUsedInTreeSchema) is no longer an error. This undocumented edge case could have been problematic, and is inconsistent since it would not fire if node was not a TreeNode. 2. Tree.is now takes in ImplicitAllowedTypes, making cases like Tree.is(x, [schema.number, schema.string]) valid. THis is more performant and more concise then doing two separate checks and ORing them together. This also allows checking a node against an ImplicitAllowedTypes pulled from a FieldSchema which could be handy for some generic code. 3. The implementation of Tree.schema and Tree.is have been rewritten to not rely on flex-schema as much, and fast path non-TreeNode inputs. This should make it more maintainable and more performant. Interestingly `#2` above is the only case that couldn't be covered by `instanceof` (assuming TypeScript 5.3): we could make `instanceof` do all narrowing currently done with Tree.is, except for this new case. The presence of this case thus seems to motivate keeping `Tree.is` if for no reason other than it can support this additional pattern which `instancof` cannot.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 1: improvement(client): core-utils imports explicit paths
Make core-utils source (not test) ECMAScript compilable
Change util scripts to be explicitly CommonJS
This allows core-utils package to use "type": "module" by only changing build settings.
Commit 2: feat(client): core-utils as ESM package
with CommonJS secondary support