Closed sotojn closed 1 month ago
We may want to consider updating from typescript
5.2.2 to **5.3.***.
There is missing types that won't allow for the use of with
until we move to at least 5.3
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html
Here's the reasoning on why not to use with: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#simplifying_scope_management
I think we just need a new way to import json
files. I think this is the "new" way after not being able to require them at some point.
A possible solution would be to just get rid of json all together. As of right now those json files just hold schema objects for elasticsearch indicies. We could instead change the json files to ts files that export the schema, then just import them where needed. This should be cross compatible with nodes 18, 20, and 22.
we have no real reason to stick with json in this regards, I think what @sotojn suggested would be easiest, by just changing them into full .ts files that export an object. We should have less clashing with new/chaning features that way
This is resolved in the PR above, now in release v1.8.0
.
When trying to build a docker image using node 22.2.0, I come across this error:
Also to note when we run
node -e "import('teraslice')"
in node 18 and 20, we get the followingExperimentalWarning
logs.Node 22.2.0 documentation on the topic can be read here. It states:
https://nodejs.org/api/esm.html#import-attributes
The code in question is located here: https://github.com/terascope/teraslice/blob/aaeb0e9129d802f298bb04acc0f44b04617dafdf/packages/teraslice/src/lib/storage/backends/elasticsearch_store.ts#L13-L17
If I try to change the
assert
keyword towith
as stated in the documentation, I get the error:Is there a better way we can import
json
files without this?Also this is blocking issue #3605