-
Notifications
You must be signed in to change notification settings - Fork 89
Conversation
31ba9f6
to
2d87cda
Compare
Exciting stuff, couple of questions
|
Until this gets published as the npm package, user's could install it from Git: $ npm install --save-dev cloudflare/workers-types#master {
"devDependencies": {
"@cloudflare/workers-types": "cloudflare/workers-types#master"
}
} Then remove
This is to make the differentiation between classes that exist at runtime and structs that are just there for typing. Whilst this is definitely a breaking change, it's far from the only one (some things have been renamed, and some things have been removed that shouldn't have been there in the first place). This would have to be a major version bump anyways so I think it's ok. |
Very cool 🎉 Yeah it looks to me like the class MyStorage extends DurableObjectStorage {
//
} This would be allowed/okay according to the types, but unlike true abstract classes (like This definitely warrants a new major version release, as it also requires tsconfig changes. @koeninger because of the major version bump, existing users will only get the new types of they manually update. This is common/expected throughout the ecosystem wrt types |
@mrbbot Couple things / questions:
|
7b02e2e
to
cc9c0b1
Compare
➡️ Sure!
🔎 Yep, I've included
📚 Done! |
cc9c0b1
to
ee4d8e5
Compare
Ohh.... this is so cool. I changed my Merge.. Merge.. Merge! |
Do we want to use dates for releases, so it's easier for tools to grab types for a compatibility date? (e.g. |
e6a971f
to
ee7b33e
Compare
Co-authored-by: Luke Edwards <luke.edwards05@gmail.com>
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.
This looks great!
@Electroid I like the versioning idea & we should do that to accommodate the internal release process. I have notes from @mrbbot to hand off to @vlovich
We can do the version changes separately from this PR
Using the new version is causing an error when installing with
Maybe this doesn't conform to the semantic versioning format allowed in packages? |
I've run into this on other projects. It has an issue with leading 0's. |
Linking releases to compatibility dates is a good idea, but I think we should do it via npm dist-tags rather than hijacking the |
We'd have to do it without leading zeros. Semver (at least on npm) sorts by the numerical value, not by traditional character value sorting. ( My hesitation with dist tags is that it kinda means we have two versioning schemes. And then we have to manually decide if every new release is semver major/minor/patch...or ignore semver entirely. |
Removing the leading |
33cd391
to
6b1dee9
Compare
Cool, I've removed the leading |
Can I merge this? Would be a nice thing to announce this week alongside birthday week (and I want to use the types so badly haha). |
92acd1b
to
4a47809
Compare
Go for it @threepointone! 😃 Just updated the changelog with the correct version. |
Merged! I'll do a major release later today/tomorrow, once I figure out how... |
@threepointone Any idea when the release will happen? |
Hopefully this coming week. |
declare abstract class DurableObjectState { | ||
waitUntil(promise: Promise<void>): void; | ||
readonly id: DurableObjectId | string; | ||
readonly storage?: DurableObjectStorage; |
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.
Is storage potentially undefined here? 🤔
What should workers do if storage is undefined?
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.
As far as I know this is just leaking a bit of implementation detail, you should be able to assume that storage is defined. I'll add a pr to override that type.
Types are now automatically generated with releases by parsing the runtime's source code, and merging in overrides/docs defined in this repository (for generics, overloads, comments, etc).
webworker
no longer needs to (and shouldn't) be included in tsconfiglib
.The final merged AST that's used to render the TypeScript types,
workers.json
, is also included in the repository. This could be used to generate bindings for other languages that compile to WebAssembly. Rust output is coming soon.Closes: #55, #75, #76, #81, #84, #96, #97, #100, #101, #102, #105, #106, #107, #108