Skip to content
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

chore: universal module definition #902

Merged
merged 1 commit into from
Dec 8, 2023
Merged

Conversation

louis-menlo
Copy link
Contributor

@louis-menlo louis-menlo commented Dec 7, 2023

Description

Make the core module UMD-compatible for use on both browser and Node.js platforms. The core should not have knowledge of the window object, which is specific to browsers; it should be a universal module.

This is the first step of sharing modules between our server and extensions.

@github-actions github-actions bot added the type: chore Maintenance, operational label Dec 7, 2023

declare global {
interface Window {
core?: any;
namespace NodeJS {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good. I was thinking the same. The modules we're wrapping & exposing via core are particular to "Node native modules". So this namespace makes a lot more sense to external devs.

Copy link
Contributor

@freelerobot freelerobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff.

@@ -218,7 +218,7 @@ export interface Model {
* Default: "to_download"
* Enum: "to_download" "downloading" "ready" "running"
*/
state: ModelState;
state?: ModelState;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of my concern is Rex's model.json does not provide us default state

@louis-menlo louis-menlo merged commit cfec5f9 into main Dec 8, 2023
2 checks passed
@louis-menlo louis-menlo deleted the chore/umd-core-module branch December 8, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Maintenance, operational
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants