-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Add compiler option to allow module types to be checked in non module output files #41567
Comments
This exists: - import type MyModel from './MyModel';
+ type MyModel = import('./MyModel').default;
const test: MyModel = {};
test.propertyInModel = 1; // works and has intellisense
// test.propertyNotInModel = 1; throws compile error! There are a couple problems here. The first is a misconception about the purpose of So the question becomes, how do I reference types from a module in a script? And the answer is, and has always been, the The problem is determining the scope of top-level declarations in the file. Suppose we had a directive like This is why I’m skeptical of a directive or compiler option that would “simply” let you use imports in a file but emit a script. Maybe there’s something we could do for Web Workers specifically. But I would like to understand how bad of a solution the |
@andrewbranch Cheers, that's a good workaround for #41562 and I've closed it. As an alternate syntax workaround that works, thanks for letting me know I can import types like that, though I still think it's somewhat confusing and that there is a valid use case for a compiler option/directive.
Who would do that? I'm not writing an API or public library. I think this directive would be a very bad idea in the situation you describe, but this is a web worker - it's going to fail if you load it with This wouldn't be for common practice, this would be so that in the corner case where we knew the output JS would be loaded in a certain way we could ensure that TS knows not to break that. Think like The problem isn't that TS forces
It's top level scope can't be shared with other scripts, in a worker it's a whole new entry point (from the point of view of bundlers). Take the case where we can use A very common practice with web workers is passing data back and forth - the main JS passes an entity across using
Thinking on this... far more useful (in the specific context of workers) would be a |
My point is that there is literally nowhere you’re telling TypeScript that this file is exclusively targeted for a web worker. (In fact, if you’re getting
We resisted introducing
Again, TypeScript does not know anything about your workers or bundlers—people do still use scripts with shared global scope.
This is already what you would get if you compiled your web worker files with a tsconfig that had |
@andrewbranch I think this might be how we're using TS, which could be completely wrong...
This is fine if my entire project is exclusively DOM (with ES module In practice I'm using workers as kind of background threads - something is slow in the UI and causes jank/dropped frames, so I split it out into a worker and call it with Comlink (or something similar). In a large web application I have many files that need to be treated as web workers, arranged near the code that calls them and that they work closely with. So this leads to lots and lots of
Exactly! It doesn't know so it assumes. Now that assumption may be best practice and it may be the right call 99% of the time, but there's no way to opt out of it in the times when it isn't.
I agree again. I hate using it and every time is technical debt I know needs fixing. But it's still a really useful thing to have in your toolbox. |
I've been a lurker in this issue and its previous iterations, but from what I understand, wouldn't #13135 solve the entire problem here? Suppose you could do type { T1, T2, T3 } = typeof import("./other-file"); this should preserve the non-moduleness of the file but give you a relatively elegant way to re-use many types from other files without importing them. |
@AlCalzone #13135 would be an alternate fix to #41562 and would be one possible solution here. However, give that we already have |
The more I think about this, the more I believe it’s not a problem. @KeithHenry, you needed a way to use module types in non-module files, which exists. You replied
But I never heard a case for why there is a valid use case for anything further, beyond “I still think it’s somewhat confusing.” The intricacies of module systems is definitely one of the most confusing parts of TypeScript, but even if it’s unintuitive, there are rules and they are working as intended. That means the solution I gave you is not just “an alternative syntax workaround,” it is a different tool with different semantics, and if you’re aware of the rules around modules and the fact that ImportTypeNodes exist, you can put the pieces together and come to that solution. We might have a docs/learning problem here, but that doesn’t mean we need a new compiler option that would further complicate the already confusing module rules. The other tool that I would propose we can make useful here is fixing
I suspect you could work this out so that all workers are compiled under one tsconfig and all browser code is compiled under another, without too much fuss later. I’m somewhat sympathetic to the idea that setting up the correct config for web workers is tedious, but we’re currently talking about an issue of capability and correctness. |
I tried In my use case I have some files that are specifically for the |
@andrewbranch I really like this idea! |
Does this mean that it's possible today? We had a TypeScript project with Service Worker source code and as of TypeScript 4.x I see no way or even hack to make it possible to leverage TS types while developing while also outputting valid code for a service worker. This is what we used previously, until // @ts-ignore
import {} from "."
declare const self: ServiceWorkerGlobalScope The above does still make TypeScript use the correct types during development, but there appears to be no way to get it to compile correctly. Because this came as a bit of a surprise during a huge upgrade to TypeScript 4.1, we had to quickly remove all TypeScript compilation from our service worker codebase (luckily small), so now it's just plain JavaScript with JSDoc for typing. The alternative solution for others running into this (assuming there's not already something better) might be to have a script remove the The hack above comes from this issue: #14877 |
@blixt it sounds like you would benefit from my |
I don't know what was decided to do with this. But according to this issue 16577:
So, if we are to believe those comments then the So, considering what was said on other threads about not changing the JavaScript. This change in TypeScript breaks it promise that we can just write the JS the way it should be at runtime, and tell TS how to interpret that. |
My case is the following:
and it is not working: it's the same for the generated d.ts file and the source .ts file. So as I see, I have the following options: A) I go down some unknown road to use the import / export in production that I do not need at all, because I'm forced to do it I think it is worrying that such simple solutions (try out a feature with the right tooling) is intentionally made overcomplicated by the authors themselves. It's working against being the developer experience inclusive, from my point of view it's getting harder and harder to keep up with this overengineered stuff, even for experienced devs, let alone beginners.. |
@kbalint it sounds like you need - type HubConnection = typeof import("../typed/src/HubConnection").HubConnection;
+ type HubConnection = import("../typed/src/HubConnection").HubConnection; |
I've read all Andrew Branch's defenses of this change, but I still think the behavior that led to this was user-hostile given that there is no reasonable in-product workaround that seems to work for all cases. That said, it's not difficult to remove the offending line in a post-compile step with this: sed -i '/export {}/d' .js It's just a shame that we have to resort to that. I hope that the |
There is some work in flight to begin making sense of The new |
Actually, it seems like this was discussed at #47724 and the conclusion was “Ugh.” |
Using type-only imports in a file with global script scope. :-) It's not the end of the world. I'll keep removing the export via sed and move on with my life. |
I don’t understand. If you just use the syntax
vs. what you’re doing now, where
What am I missing here? How is the latter scenario better? |
If I recall correctly, it has been a while. Is that |
Just wanted to throw my 2c in that this is also ruining our enterprise project for the same reasons. Stuff like this is why in future projects I went back to normal JS and only incorporating types with JSDoc comments. It's wordy but you don't have to deal with your entire production pipeline screeching to a halt because a TS update broke perfectly valid TS code. JS will always be properly supported, but not TS, React, etc etc. All sorts of projects are ruined by opinionated decision-makers who think they know what their customers want and correcting for them instead of trusting our intelligence... TS should be a 'dumb' tool that does the job it's set out to do and nothing more, not a smart one that's trying to 'figure out' what we want for us. Additionally, there's issues with the proposed import("") workaround. This works: import A from 'a';
type B = A.B; But this does not: type A = import("a") // Module 'a' does not refer to a type, but is used as a type here. Did you mean 'typeof import('a')'? Sure: type A = typeof import("a")
type B = A.B // 'A' only refers to a type, but is being used as a namespace here. |
No need to add an extra compiler option. There’s already a |
We want TS changed to always force an |
Soon it will be 2 year anniversary since devs break a lot of working code with just 1 update. For 2 years they couldn't come up with any trade-off to solve our problem, well-done Microsoft 🤪 |
this critical issue is among many examples why "TS is just JS but better!" or "TS is a superset of JS" is simply untrue. I have since moved back to JS and now use JSDoc comments to leverage types where I want them, only where I want them. |
At this point I just use Yeah, it was an unfortunate decision which was made which broke the assurances they made to the users of This change was based off of a tooling problem with a different compilation tool so it seems like a weird decision to me. I still don't understand why they made that decision. But at the same time, I've made plenty of mistakes in my coding life, but I try to own my mistakes though. |
…tion with separate typechecking works around bugs in TS compiler: @see microsoft/TypeScript#41567
…tion with separate typechecking works around bugs in TS compiler: @see microsoft/TypeScript#41567
commit b0b0b33 Author: pospi <[email protected]> Date: Sat May 20 11:39:24 2023 +1000 update applet_config tests to test SensemakerService adapter logic as well as zome calls commit 41643f2 Author: pospi <[email protected]> Date: Sat May 20 11:38:54 2023 +1000 connect AppAgentInterface in test harness spinup for use in SensemakerService connection commit ebd52ca Author: pospi <[email protected]> Date: Sat May 20 10:41:24 2023 +1000 made client optional for constructing SensemakerStore and overriding service, mostly for test mocking commit a3db438 Author: pospi <[email protected]> Date: Sat May 20 10:33:19 2023 +1000 more typing fixes for tests commit 99af6d0 Author: pospi <[email protected]> Date: Sat May 20 10:10:45 2023 +1000 typing & serialisation pass at core API bindings, all hashes are now managed in base64 commit 5b85d02 Merge: 27ee8a2 5ad4868 Author: pospi <[email protected]> Date: Sat May 20 08:43:18 2023 +1000 Merge remote-tracking branch 'origin/develop' into feature/sensemaker-composable-streams (partial, test typing work needs followthrough) commit 5ad4868 Author: Wesley Finck <[email protected]> Date: Tue May 9 08:37:26 2023 -0600 add pub key equality tests in addition to vec length commit c7f6c02 Author: Wesley Finck <[email protected]> Date: Tue May 9 08:22:17 2023 -0600 add agent related tests commit 27ee8a2 Author: pospi <[email protected]> Date: Tue May 9 12:48:27 2023 +1000 remove unused imports in test commit 69fff13 Author: pospi <[email protected]> Date: Tue May 9 12:47:18 2023 +1000 update tests & runner to use string-based API for Assessment data commit cdc207b Author: pospi <[email protected]> Date: Tue May 9 11:53:04 2023 +1000 add Assessment loading tests for Sensemaker dashboard APIs commit f8d4e56 Author: pospi <[email protected]> Date: Mon May 8 19:15:19 2023 +1000 progressively simulate timestamps 1s into the future to give comparison ops something to do commit 2491d37 Author: pospi <[email protected]> Date: Mon May 8 19:14:54 2023 +1000 debug output fixes commit 3045426 Author: pospi <[email protected]> Date: Mon May 8 19:14:35 2023 +1000 update Assessment loading tests to test indexed dimension loading API commit c55eab0 Author: pospi <[email protected]> Date: Mon May 8 17:16:45 2023 +1000 sensemaker convenience filtering API tests commit bb27148 Author: pospi <[email protected]> Date: Mon May 8 17:16:33 2023 +1000 allow override of Assessment timestmaps when mocking commit 3d8f31e Author: pospi <[email protected]> Date: Sat May 6 08:28:33 2023 +1000 add tests for Assessment filtering commit c695c9d Author: pospi <[email protected]> Date: Sat May 6 08:22:04 2023 +1000 make mockAssessment filler args more terse commit 4f71c98 Author: pospi <[email protected]> Date: Sat May 6 08:21:49 2023 +1000 fix hash mocking method commit 6f625c8 Author: pospi <[email protected]> Date: Fri May 5 11:22:53 2023 +1000 update test expectation per new assertion method commit 47d31ec Author: pospi <[email protected]> Date: Fri May 5 11:22:24 2023 +1000 improve Rx test runner: compare against latest stream frames only, better comparison output commit 98a0b8b Author: pospi <[email protected]> Date: Wed May 3 14:13:01 2023 +1000 update test description commit 52b87c1 Author: pospi <[email protected]> Date: Wed May 3 14:12:18 2023 +1000 should only emit latest values when asked commit bf2b135 Author: pospi <[email protected]> Date: Wed May 3 13:33:20 2023 +1000 expect all prior states in second stream loading assertion commit bbc1fab Author: pospi <[email protected]> Date: Wed May 3 13:08:32 2023 +1000 test should assert two values published through stream during init, since Assessments notify separately commit e9c493d Author: pospi <[email protected]> Date: Wed May 3 12:46:01 2023 +1000 update test to load multiple Assessments initially (which also seems to be failing with BehaviorSubject) commit 4257b47 Merge: 0e7b5c0 f943452 Author: pospi <[email protected]> Date: Mon May 1 10:17:26 2023 +1000 Merge branch 'feature/sensemaker-composable-streams' of github.com:neighbour-hoods/sensemaker-lite into feature/sensemaker-composable-streams commit 0e7b5c0 Author: pospi <[email protected]> Date: Mon May 1 10:15:59 2023 +1000 move rx TestScheduler init into shared module and improve output of test failures commit f943452 Author: Wesley Finck <[email protected]> Date: Sun Apr 30 13:15:53 2023 -0600 add specific test scripts for client or sensemaker commit bf58e1c Author: pospi <[email protected]> Date: Sun Apr 30 19:12:42 2023 +1000 update test expectations to match revised internal logic for resourceAssessments() commit dba3fe2 Author: pospi <[email protected]> Date: Sun Apr 30 18:56:06 2023 +1000 change assessment test for additional readability of mocked data relationships commit 250ada9 Author: pospi <[email protected]> Date: Fri Apr 28 16:39:16 2023 +1000 fix test assertions not comparing ES6 Set & Map in emitted values correctly commit b6b1a68 Author: pospi <[email protected]> Date: Fri Apr 28 15:51:03 2023 +1000 extend Assessment loading tests to verify progressive additions to SensemakerStore commit 3a7dbaf Author: pospi <[email protected]> Date: Fri Apr 28 15:50:07 2023 +1000 implement some interfaces to update mocked API data during test process commit bbbdca4 Author: pospi <[email protected]> Date: Fri Apr 28 14:07:32 2023 +1000 first simple test for Assessment loading functionality commit 830e54a Author: pospi <[email protected]> Date: Fri Apr 28 14:07:08 2023 +1000 add test mocking helpers for SensemakerStore client API unit tests commit 5436685 Author: pospi <[email protected]> Date: Fri Apr 28 13:11:34 2023 +1000 update package manifests to switch to PNPM, fixing Typescript type incompatibility errors commit 552cf6f Author: pospi <[email protected]> Date: Fri Apr 28 12:55:24 2023 +1000 target tests compilation to latest ESModule spec commit b5fd021 Author: pospi <[email protected]> Date: Tue Apr 25 17:01:30 2023 +1000 change test commands & config to use tsx/ESBuild packages for compilation with separate typechecking works around bugs in TS compiler: @see microsoft/TypeScript#41567 commit 2c7d340 Author: pospi <[email protected]> Date: Tue Apr 25 16:47:13 2023 +1000 fix helper imports commit 97058f7 Author: pospi <[email protected]> Date: Tue Apr 25 16:43:54 2023 +1000 define types to pass compiler checks commit 969bad0 Author: pospi <[email protected]> Date: Tue Apr 25 16:43:30 2023 +1000 remove test runner workaround, fix TS config and reorganise test deps for direct compat with Tape commit 0a97ab9 Author: Wesley Finck <[email protected]> Date: Mon Apr 17 16:44:13 2023 -0600 remove unused dependency from tests module commit 3305e21 Author: Wesley Finck <[email protected]> Date: Thu Apr 13 16:46:57 2023 -0600 update tests to include testing of the average computation along with timestamps in assessment commit f3e5cf0 Author: Wesley Finck <[email protected]> Date: Fri Apr 7 11:02:08 2023 -0600 return assessment from run_method commit a2fca1f Author: Wesley Finck <[email protected]> Date: Wed Apr 5 16:46:32 2023 -0600 change get_assessments_for_resource to take in a vec of resource_ehs and multiple dimension_ehs, along with necessary client changes commit b23ddc4 Author: Wesley Finck <[email protected]> Date: Mon Feb 27 14:22:35 2023 -0600 global replacement of with commit bcb4062 Author: Tatsuya Sato <[email protected]> Date: Fri Feb 24 18:32:22 2023 +0900 update package json commit 04b2e02 Author: Tatsuya Sato <[email protected]> Date: Fri Feb 24 00:08:37 2023 +0900 fix bugs emerged from merging commit c30c71e Merge: a621e90 b9cb983 Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 23:56:46 2023 +0900 Merge remote-tracking branch 'origin/dashboard-view' into damien-review-batch-1 commit a621e90 Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 18:56:33 2023 +0900 fix tests commit 5ade37f Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 18:20:51 2023 +0900 fix tests for ranges commit c34337c Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 15:02:57 2023 +0900 rename must_publish_dataset to requires_validation commit afe1f81 Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 02:26:09 2023 +0900 more renames to resource def in ts files commit 0069f8b Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 02:10:09 2023 +0900 rename resource type to resource def in test commit e644b3d Author: Wesley Finck <[email protected]> Date: Tue Feb 14 16:21:18 2023 -0600 update dependencies in tests commit 3fba658 Author: Tatsuya Sato <[email protected]> Date: Mon Feb 13 00:28:47 2023 +0900 fix test commit 8bc4586 Author: Tatsuya Sato <[email protected]> Date: Sun Feb 12 23:21:03 2023 +0900 bump tryorama and holochain js client commit b9cb983 Author: Wesley Finck <[email protected]> Date: Fri Jan 27 18:38:58 2023 -0600 include role_name in applet config, so when fetching config associated with a resource_type_eh can know which cell to bridge call to resolve resource_eh, along with passing tests and updated type defs commit f919e0b Merge: 1dc8351 9a997c5 Author: Wesley Finck <[email protected]> Date: Fri Jan 27 16:38:14 2023 -0600 Merge branch 'develop' into dashboard-view commit 1dc8351 Author: Wesley Finck <[email protected]> Date: Fri Jan 27 16:25:24 2023 -0600 basic bridge call to fetch provider resource with passing tests and updated ts types commit 1d81250 Author: Wesley Finck <[email protected]> Date: Thu Jan 26 12:33:32 2023 -0600 added get_all_assesments zome function for dashboard view commit 9a997c5 Author: Wesley Finck <[email protected]> Date: Thu Jan 26 10:18:30 2023 -0600 encodeHashToBase64 instead of serializeHash commit f7ab6f5 Merge: be4939c 1ccef6d Author: Wesley Finck <[email protected]> Date: Thu Jan 26 10:04:31 2023 -0600 Merge branch 'develop' into load-additional-configuration commit 1ccef6d Author: Wesley Finck <[email protected]> Date: Wed Jan 25 14:35:39 2023 -0600 update test dependencies and drop deprecated modules commit be4939c Author: Tatsuya Sato <[email protected]> Date: Wed Jan 25 17:12:01 2023 +0800 test passing for the new configuration format commit 4dcf550 Author: Tatsuya Sato <[email protected]> Date: Wed Jan 25 15:50:26 2023 +0800 fix test commit 521ccc2 Author: Tatsuya Sato <[email protected]> Date: Wed Jan 25 12:49:12 2023 +0800 fix test commit 72046cd Merge: 3d6fc07 d15ed20 Author: Tatsuya Sato <[email protected]> Date: Tue Jan 24 16:01:03 2023 +0800 Merge remote-tracking branch 'origin/beta-rc.2' into load-additional-configuration commit d15ed20 Author: Wesley Finck <[email protected]> Date: Wed Jan 18 11:18:45 2023 -0600 change pause duration and add types to ensure passing tests commit 9e4a9b2 Author: Wesley Finck <[email protected]> Date: Tue Jan 17 20:25:42 2023 -0600 working InstallAppRequest and change pause duration for passing SM entry type CRUD tests commit b1c0433 Author: Wesley Finck <[email protected]> Date: Tue Jan 17 18:41:20 2023 -0600 WIP: flatted install app input for location commit be9bf68 Author: Wesley Finck <[email protected]> Date: Tue Jan 17 18:32:14 2023 -0600 WIP: bumping tests to beta-rc.2 commit 3d6fc07 Author: tatssato <[email protected]> Date: Mon Jan 16 14:34:16 2023 +0800 implement add_config function commit 3371070 Author: Wesley Finck <[email protected]> Date: Tue Jan 10 15:39:58 2023 -0600 updated package-lock commit da8d46d Author: Wesley Finck <[email protected]> Date: Mon Jan 9 13:27:57 2023 -0600 update dependencies for testing commit 4da710e Author: Wesley Finck <[email protected]> Date: Mon Jan 9 13:21:53 2023 -0600 update field to resource_types and cultural_context commit 9647318 Author: Wesley Finck <[email protected]> Date: Fri Jan 6 15:50:11 2023 -0600 change appletConfig subtypes to BTreeMap instead of vec commit 3c02b9f Author: Wesley Finck <[email protected]> Date: Fri Jan 6 14:39:21 2023 -0600 register applet config commit f7c2874 Author: Wesley Finck <[email protected]> Date: Wed Dec 28 21:40:49 2022 -0800 include author pubkey in assessment struct commit 432bdd1 Author: Wesley Finck <[email protected]> Date: Wed Dec 28 20:33:38 2022 -0800 add zome function to get all assessments along a dimension for a given resource entry hash commit 809fa42 Author: Tatsuya Sato <[email protected]> Date: Sat Dec 10 19:52:06 2022 +0800 working configuration with passing tryorama test commit 39024b9 Author: Tatsuya Sato <[email protected]> Date: Sat Dec 10 00:39:33 2022 +0800 WIP on test commit d473d1e Author: tatssato <[email protected]> Date: Fri Dec 9 19:14:37 2022 +0800 create sample config in tyorama commit 3cf0d8f Author: tatsuya sato <[email protected]> Date: Mon Dec 5 17:42:29 2022 +0800 wip commit 03d3191 Author: Wesley Finck <[email protected]> Date: Fri Nov 25 09:36:24 2022 -0800 uncomment other tests commit e61c988 Author: Wesley Finck <[email protected]> Date: Fri Nov 25 09:29:52 2022 -0800 better error handling of comparing incompatible range value types commit 25c2b83 Author: Wesley Finck <[email protected]> Date: Fri Nov 25 08:54:28 2022 -0800 fixed ordering, now works in both ascending and descending order commit b344658 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 20:29:33 2022 -0800 BiggerThan threshold kind working in tests commit 78f1ce3 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 17:18:49 2022 -0800 create cultural context entry in test commit bd91424 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 13:36:57 2022 -0800 create 3 posts and compute objective assessments for each commit e94f0b5 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 08:20:59 2022 -0800 initial outline of test approach commit 8a407e9 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 07:52:26 2022 -0800 fixed context serde commit 2dbf7f5 Merge: 0b65895 45c4a63 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 07:47:43 2022 -0800 Merge branch 'develop' into progenitor-pattern-test commit 45c4a63 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 07:16:37 2022 -0800 end test process commit 0b65895 Author: tatssato <[email protected]> Date: Thu Nov 24 14:52:38 2022 +0800 uncomment commit 8aabc4a Author: tatssato <[email protected]> Date: Thu Nov 24 14:41:41 2022 +0800 wip on test commit 0cf7321 Author: Wesley Finck <[email protected]> Date: Tue Nov 22 18:44:16 2022 -0800 run method to compute object assessment on a resource commit 7f0847a Author: Wesley Finck <[email protected]> Date: Tue Nov 22 18:27:29 2022 -0800 create method entry commit 638d297 Author: Wesley Finck <[email protected]> Date: Tue Nov 22 17:32:54 2022 -0800 fixed dna properties for progenitor pattern commit add1d66 Author: tatsuya sato <[email protected]> Date: Tue Nov 22 13:40:45 2022 +0800 wip test commit bb5b44c Author: tatsuya sato <[email protected]> Date: Mon Nov 21 15:41:18 2022 +0800 change dna path in test commit 418ac07 Author: Wesley Finck <[email protected]> Date: Thu Nov 17 12:19:54 2022 -0800 index dimensions with path and get all dimensions commit 14aebdd Author: Wesley Finck <[email protected]> Date: Thu Nov 17 09:32:45 2022 -0800 create resource type in test commit ce1faed Author: Wesley Finck <[email protected]> Date: Thu Nov 17 08:59:28 2022 -0800 create assessment on a provided entry commit 84be061 Author: Wesley Finck <[email protected]> Date: Thu Nov 17 08:30:40 2022 -0800 added test_provider_dna and include in test commit b59bce7 Author: Wesley Finck <[email protected]> Date: Wed Nov 16 20:50:18 2022 -0800 create dimension with passing test commit 2e2fdb4 Author: Wesley Finck <[email protected]> Date: Wed Nov 16 12:04:15 2022 -0800 definedall entry types commit e281fbe Author: Julio Holon <[email protected]> Date: Sat Nov 12 16:16:04 2022 -0300 initial commit
commit b0b0b33 Author: pospi <[email protected]> Date: Sat May 20 11:39:24 2023 +1000 update applet_config tests to test SensemakerService adapter logic as well as zome calls commit 41643f2 Author: pospi <[email protected]> Date: Sat May 20 11:38:54 2023 +1000 connect AppAgentInterface in test harness spinup for use in SensemakerService connection commit ebd52ca Author: pospi <[email protected]> Date: Sat May 20 10:41:24 2023 +1000 made client optional for constructing SensemakerStore and overriding service, mostly for test mocking commit a3db438 Author: pospi <[email protected]> Date: Sat May 20 10:33:19 2023 +1000 more typing fixes for tests commit 99af6d0 Author: pospi <[email protected]> Date: Sat May 20 10:10:45 2023 +1000 typing & serialisation pass at core API bindings, all hashes are now managed in base64 commit 5b85d02 Merge: 27ee8a2 5ad4868 Author: pospi <[email protected]> Date: Sat May 20 08:43:18 2023 +1000 Merge remote-tracking branch 'origin/develop' into feature/sensemaker-composable-streams (partial, test typing work needs followthrough) commit 5ad4868 Author: Wesley Finck <[email protected]> Date: Tue May 9 08:37:26 2023 -0600 add pub key equality tests in addition to vec length commit c7f6c02 Author: Wesley Finck <[email protected]> Date: Tue May 9 08:22:17 2023 -0600 add agent related tests commit 27ee8a2 Author: pospi <[email protected]> Date: Tue May 9 12:48:27 2023 +1000 remove unused imports in test commit 69fff13 Author: pospi <[email protected]> Date: Tue May 9 12:47:18 2023 +1000 update tests & runner to use string-based API for Assessment data commit cdc207b Author: pospi <[email protected]> Date: Tue May 9 11:53:04 2023 +1000 add Assessment loading tests for Sensemaker dashboard APIs commit f8d4e56 Author: pospi <[email protected]> Date: Mon May 8 19:15:19 2023 +1000 progressively simulate timestamps 1s into the future to give comparison ops something to do commit 2491d37 Author: pospi <[email protected]> Date: Mon May 8 19:14:54 2023 +1000 debug output fixes commit 3045426 Author: pospi <[email protected]> Date: Mon May 8 19:14:35 2023 +1000 update Assessment loading tests to test indexed dimension loading API commit c55eab0 Author: pospi <[email protected]> Date: Mon May 8 17:16:45 2023 +1000 sensemaker convenience filtering API tests commit bb27148 Author: pospi <[email protected]> Date: Mon May 8 17:16:33 2023 +1000 allow override of Assessment timestmaps when mocking commit 3d8f31e Author: pospi <[email protected]> Date: Sat May 6 08:28:33 2023 +1000 add tests for Assessment filtering commit c695c9d Author: pospi <[email protected]> Date: Sat May 6 08:22:04 2023 +1000 make mockAssessment filler args more terse commit 4f71c98 Author: pospi <[email protected]> Date: Sat May 6 08:21:49 2023 +1000 fix hash mocking method commit 6f625c8 Author: pospi <[email protected]> Date: Fri May 5 11:22:53 2023 +1000 update test expectation per new assertion method commit 47d31ec Author: pospi <[email protected]> Date: Fri May 5 11:22:24 2023 +1000 improve Rx test runner: compare against latest stream frames only, better comparison output commit 98a0b8b Author: pospi <[email protected]> Date: Wed May 3 14:13:01 2023 +1000 update test description commit 52b87c1 Author: pospi <[email protected]> Date: Wed May 3 14:12:18 2023 +1000 should only emit latest values when asked commit bf2b135 Author: pospi <[email protected]> Date: Wed May 3 13:33:20 2023 +1000 expect all prior states in second stream loading assertion commit bbc1fab Author: pospi <[email protected]> Date: Wed May 3 13:08:32 2023 +1000 test should assert two values published through stream during init, since Assessments notify separately commit e9c493d Author: pospi <[email protected]> Date: Wed May 3 12:46:01 2023 +1000 update test to load multiple Assessments initially (which also seems to be failing with BehaviorSubject) commit 4257b47 Merge: 0e7b5c0 f943452 Author: pospi <[email protected]> Date: Mon May 1 10:17:26 2023 +1000 Merge branch 'feature/sensemaker-composable-streams' of github.com:neighbour-hoods/sensemaker-lite into feature/sensemaker-composable-streams commit 0e7b5c0 Author: pospi <[email protected]> Date: Mon May 1 10:15:59 2023 +1000 move rx TestScheduler init into shared module and improve output of test failures commit f943452 Author: Wesley Finck <[email protected]> Date: Sun Apr 30 13:15:53 2023 -0600 add specific test scripts for client or sensemaker commit bf58e1c Author: pospi <[email protected]> Date: Sun Apr 30 19:12:42 2023 +1000 update test expectations to match revised internal logic for resourceAssessments() commit dba3fe2 Author: pospi <[email protected]> Date: Sun Apr 30 18:56:06 2023 +1000 change assessment test for additional readability of mocked data relationships commit 250ada9 Author: pospi <[email protected]> Date: Fri Apr 28 16:39:16 2023 +1000 fix test assertions not comparing ES6 Set & Map in emitted values correctly commit b6b1a68 Author: pospi <[email protected]> Date: Fri Apr 28 15:51:03 2023 +1000 extend Assessment loading tests to verify progressive additions to SensemakerStore commit 3a7dbaf Author: pospi <[email protected]> Date: Fri Apr 28 15:50:07 2023 +1000 implement some interfaces to update mocked API data during test process commit bbbdca4 Author: pospi <[email protected]> Date: Fri Apr 28 14:07:32 2023 +1000 first simple test for Assessment loading functionality commit 830e54a Author: pospi <[email protected]> Date: Fri Apr 28 14:07:08 2023 +1000 add test mocking helpers for SensemakerStore client API unit tests commit 5436685 Author: pospi <[email protected]> Date: Fri Apr 28 13:11:34 2023 +1000 update package manifests to switch to PNPM, fixing Typescript type incompatibility errors commit 552cf6f Author: pospi <[email protected]> Date: Fri Apr 28 12:55:24 2023 +1000 target tests compilation to latest ESModule spec commit b5fd021 Author: pospi <[email protected]> Date: Tue Apr 25 17:01:30 2023 +1000 change test commands & config to use tsx/ESBuild packages for compilation with separate typechecking works around bugs in TS compiler: @see microsoft/TypeScript#41567 commit 2c7d340 Author: pospi <[email protected]> Date: Tue Apr 25 16:47:13 2023 +1000 fix helper imports commit 97058f7 Author: pospi <[email protected]> Date: Tue Apr 25 16:43:54 2023 +1000 define types to pass compiler checks commit 969bad0 Author: pospi <[email protected]> Date: Tue Apr 25 16:43:30 2023 +1000 remove test runner workaround, fix TS config and reorganise test deps for direct compat with Tape commit 0a97ab9 Author: Wesley Finck <[email protected]> Date: Mon Apr 17 16:44:13 2023 -0600 remove unused dependency from tests module commit 3305e21 Author: Wesley Finck <[email protected]> Date: Thu Apr 13 16:46:57 2023 -0600 update tests to include testing of the average computation along with timestamps in assessment commit f3e5cf0 Author: Wesley Finck <[email protected]> Date: Fri Apr 7 11:02:08 2023 -0600 return assessment from run_method commit a2fca1f Author: Wesley Finck <[email protected]> Date: Wed Apr 5 16:46:32 2023 -0600 change get_assessments_for_resource to take in a vec of resource_ehs and multiple dimension_ehs, along with necessary client changes commit b23ddc4 Author: Wesley Finck <[email protected]> Date: Mon Feb 27 14:22:35 2023 -0600 global replacement of with commit bcb4062 Author: Tatsuya Sato <[email protected]> Date: Fri Feb 24 18:32:22 2023 +0900 update package json commit 04b2e02 Author: Tatsuya Sato <[email protected]> Date: Fri Feb 24 00:08:37 2023 +0900 fix bugs emerged from merging commit c30c71e Merge: a621e90 b9cb983 Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 23:56:46 2023 +0900 Merge remote-tracking branch 'origin/dashboard-view' into damien-review-batch-1 commit a621e90 Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 18:56:33 2023 +0900 fix tests commit 5ade37f Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 18:20:51 2023 +0900 fix tests for ranges commit c34337c Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 15:02:57 2023 +0900 rename must_publish_dataset to requires_validation commit afe1f81 Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 02:26:09 2023 +0900 more renames to resource def in ts files commit 0069f8b Author: Tatsuya Sato <[email protected]> Date: Thu Feb 23 02:10:09 2023 +0900 rename resource type to resource def in test commit e644b3d Author: Wesley Finck <[email protected]> Date: Tue Feb 14 16:21:18 2023 -0600 update dependencies in tests commit 3fba658 Author: Tatsuya Sato <[email protected]> Date: Mon Feb 13 00:28:47 2023 +0900 fix test commit 8bc4586 Author: Tatsuya Sato <[email protected]> Date: Sun Feb 12 23:21:03 2023 +0900 bump tryorama and holochain js client commit b9cb983 Author: Wesley Finck <[email protected]> Date: Fri Jan 27 18:38:58 2023 -0600 include role_name in applet config, so when fetching config associated with a resource_type_eh can know which cell to bridge call to resolve resource_eh, along with passing tests and updated type defs commit f919e0b Merge: 1dc8351 9a997c5 Author: Wesley Finck <[email protected]> Date: Fri Jan 27 16:38:14 2023 -0600 Merge branch 'develop' into dashboard-view commit 1dc8351 Author: Wesley Finck <[email protected]> Date: Fri Jan 27 16:25:24 2023 -0600 basic bridge call to fetch provider resource with passing tests and updated ts types commit 1d81250 Author: Wesley Finck <[email protected]> Date: Thu Jan 26 12:33:32 2023 -0600 added get_all_assesments zome function for dashboard view commit 9a997c5 Author: Wesley Finck <[email protected]> Date: Thu Jan 26 10:18:30 2023 -0600 encodeHashToBase64 instead of serializeHash commit f7ab6f5 Merge: be4939c 1ccef6d Author: Wesley Finck <[email protected]> Date: Thu Jan 26 10:04:31 2023 -0600 Merge branch 'develop' into load-additional-configuration commit 1ccef6d Author: Wesley Finck <[email protected]> Date: Wed Jan 25 14:35:39 2023 -0600 update test dependencies and drop deprecated modules commit be4939c Author: Tatsuya Sato <[email protected]> Date: Wed Jan 25 17:12:01 2023 +0800 test passing for the new configuration format commit 4dcf550 Author: Tatsuya Sato <[email protected]> Date: Wed Jan 25 15:50:26 2023 +0800 fix test commit 521ccc2 Author: Tatsuya Sato <[email protected]> Date: Wed Jan 25 12:49:12 2023 +0800 fix test commit 72046cd Merge: 3d6fc07 d15ed20 Author: Tatsuya Sato <[email protected]> Date: Tue Jan 24 16:01:03 2023 +0800 Merge remote-tracking branch 'origin/beta-rc.2' into load-additional-configuration commit d15ed20 Author: Wesley Finck <[email protected]> Date: Wed Jan 18 11:18:45 2023 -0600 change pause duration and add types to ensure passing tests commit 9e4a9b2 Author: Wesley Finck <[email protected]> Date: Tue Jan 17 20:25:42 2023 -0600 working InstallAppRequest and change pause duration for passing SM entry type CRUD tests commit b1c0433 Author: Wesley Finck <[email protected]> Date: Tue Jan 17 18:41:20 2023 -0600 WIP: flatted install app input for location commit be9bf68 Author: Wesley Finck <[email protected]> Date: Tue Jan 17 18:32:14 2023 -0600 WIP: bumping tests to beta-rc.2 commit 3d6fc07 Author: tatssato <[email protected]> Date: Mon Jan 16 14:34:16 2023 +0800 implement add_config function commit 3371070 Author: Wesley Finck <[email protected]> Date: Tue Jan 10 15:39:58 2023 -0600 updated package-lock commit da8d46d Author: Wesley Finck <[email protected]> Date: Mon Jan 9 13:27:57 2023 -0600 update dependencies for testing commit 4da710e Author: Wesley Finck <[email protected]> Date: Mon Jan 9 13:21:53 2023 -0600 update field to resource_types and cultural_context commit 9647318 Author: Wesley Finck <[email protected]> Date: Fri Jan 6 15:50:11 2023 -0600 change appletConfig subtypes to BTreeMap instead of vec commit 3c02b9f Author: Wesley Finck <[email protected]> Date: Fri Jan 6 14:39:21 2023 -0600 register applet config commit f7c2874 Author: Wesley Finck <[email protected]> Date: Wed Dec 28 21:40:49 2022 -0800 include author pubkey in assessment struct commit 432bdd1 Author: Wesley Finck <[email protected]> Date: Wed Dec 28 20:33:38 2022 -0800 add zome function to get all assessments along a dimension for a given resource entry hash commit 809fa42 Author: Tatsuya Sato <[email protected]> Date: Sat Dec 10 19:52:06 2022 +0800 working configuration with passing tryorama test commit 39024b9 Author: Tatsuya Sato <[email protected]> Date: Sat Dec 10 00:39:33 2022 +0800 WIP on test commit d473d1e Author: tatssato <[email protected]> Date: Fri Dec 9 19:14:37 2022 +0800 create sample config in tyorama commit 3cf0d8f Author: tatsuya sato <[email protected]> Date: Mon Dec 5 17:42:29 2022 +0800 wip commit 03d3191 Author: Wesley Finck <[email protected]> Date: Fri Nov 25 09:36:24 2022 -0800 uncomment other tests commit e61c988 Author: Wesley Finck <[email protected]> Date: Fri Nov 25 09:29:52 2022 -0800 better error handling of comparing incompatible range value types commit 25c2b83 Author: Wesley Finck <[email protected]> Date: Fri Nov 25 08:54:28 2022 -0800 fixed ordering, now works in both ascending and descending order commit b344658 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 20:29:33 2022 -0800 BiggerThan threshold kind working in tests commit 78f1ce3 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 17:18:49 2022 -0800 create cultural context entry in test commit bd91424 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 13:36:57 2022 -0800 create 3 posts and compute objective assessments for each commit e94f0b5 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 08:20:59 2022 -0800 initial outline of test approach commit 8a407e9 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 07:52:26 2022 -0800 fixed context serde commit 2dbf7f5 Merge: 0b65895 45c4a63 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 07:47:43 2022 -0800 Merge branch 'develop' into progenitor-pattern-test commit 45c4a63 Author: Wesley Finck <[email protected]> Date: Thu Nov 24 07:16:37 2022 -0800 end test process commit 0b65895 Author: tatssato <[email protected]> Date: Thu Nov 24 14:52:38 2022 +0800 uncomment commit 8aabc4a Author: tatssato <[email protected]> Date: Thu Nov 24 14:41:41 2022 +0800 wip on test commit 0cf7321 Author: Wesley Finck <[email protected]> Date: Tue Nov 22 18:44:16 2022 -0800 run method to compute object assessment on a resource commit 7f0847a Author: Wesley Finck <[email protected]> Date: Tue Nov 22 18:27:29 2022 -0800 create method entry commit 638d297 Author: Wesley Finck <[email protected]> Date: Tue Nov 22 17:32:54 2022 -0800 fixed dna properties for progenitor pattern commit add1d66 Author: tatsuya sato <[email protected]> Date: Tue Nov 22 13:40:45 2022 +0800 wip test commit bb5b44c Author: tatsuya sato <[email protected]> Date: Mon Nov 21 15:41:18 2022 +0800 change dna path in test commit 418ac07 Author: Wesley Finck <[email protected]> Date: Thu Nov 17 12:19:54 2022 -0800 index dimensions with path and get all dimensions commit 14aebdd Author: Wesley Finck <[email protected]> Date: Thu Nov 17 09:32:45 2022 -0800 create resource type in test commit ce1faed Author: Wesley Finck <[email protected]> Date: Thu Nov 17 08:59:28 2022 -0800 create assessment on a provided entry commit 84be061 Author: Wesley Finck <[email protected]> Date: Thu Nov 17 08:30:40 2022 -0800 added test_provider_dna and include in test commit b59bce7 Author: Wesley Finck <[email protected]> Date: Wed Nov 16 20:50:18 2022 -0800 create dimension with passing test commit 2e2fdb4 Author: Wesley Finck <[email protected]> Date: Wed Nov 16 12:04:15 2022 -0800 definedall entry types commit e281fbe Author: Julio Holon <[email protected]> Date: Sat Nov 12 16:16:04 2022 -0300 initial commit
…tion with separate typechecking works around bugs in TS compiler: @see microsoft/TypeScript#41567
Search Terms:
import type
,export {}
Suggestion
In #41513 and #41562 projects are broken by a design change to always include
export {};
in the JS output ifimport
orimport type
is in the TS source, regardless of whether it is in the JS output. This is a breaking change for a lot of developers and painful to fix (and by fix I mean practically get the output of our TS project to run in browsers, not necessarily adhere to ECMA spec compliance and best possible practice).However,
export {};
considered desirable:Please could we have a new compiler option to not force all files that in any way use ES modules to always have to include
export {};
in the JS output.I'm not sure of the best way for this to be applied, but the goal would be
This could be:
import type
to not implicitly convert output to a module, (my preference because it still avoids any output JS havingimport
withoutexport
, which caused Consider emittingexport {}
in all ambiguous module output #38696) orexport {};
to all modules, or//@directive
we add to a file to express our intent to not output a module, orreference type ...
TS-only syntax to signal that we want to use the definition but not output a moduleWhatever is easiest to code and causes least friction/confusion for the community.
Use Cases
I have a large TS project that uses numerous web workers, a service worker and web components that load side effects.
In the first two cases including
export {};
breaks the resulting JS, as these workers are not modules and are not intended to produce module loaded JS output.In the case of side effect web components no
export
is expected (they usecustomElements.define
) so it's just wasted bytes, but it doesn't break anything. Across a project with a lot of components the manyexport {};
that will never be referenced by anything adds up.In addition during migration between different reference types it may be extremely beneficial to not strictly enforce adherence to one type or the other, at least while not in production. Any modules = all must be modules effectively makes this migration harder, even if it is a sound best practice.
Examples
I have a model
MyModel.d.ts
.In
worker.ts
I want TS to check my code against this model:I want to use the JS output this with a worker in another file:
This worked in 3.8, but fails in 4.0 due to #41562
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: