-
Notifications
You must be signed in to change notification settings - Fork 425
Conversation
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.
Looks great! Thanks for doing this work. I have just some small requests...
src/prepack-options.js
Outdated
import type { ErrorHandler } from "./errors.js"; | ||
import type { SerializerOptions, RealmOptions } from "./options"; | ||
|
||
export type Compatibility = "browser" | "jsc-600-1-4-17" | "node-source-maps" | "node-cli"; |
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.
Don't redefine, import from "./options";
src/prepack-options.js
Outdated
import type { SerializerOptions, RealmOptions } from "./options"; | ||
|
||
export type Compatibility = "browser" | "jsc-600-1-4-17" | "node-source-maps" | "node-cli"; | ||
export const CompatibilityValues = ["browser", "jsc-600-1-4-17", "node-source-maps", "node-cli"]; |
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.
Dead, please remove.
src/prepack-options.js
Outdated
return { | ||
compatibility, | ||
debugNames, | ||
errorHandler: errorHandler, |
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.
simplify to errorHandler,
src/prepack-options.js
Outdated
let result: SerializerOptions = { | ||
delayInitializations, | ||
delayUnsupportedRequires, | ||
initializeMoreModules: speculate, |
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.
Another silly naming discrepancy that should be addressed eventually. If that's harmonized, then the Options
datatype could be truly the union SerializerOptions | RealmOptions | PartialEvaluatorOptions
, right?
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.
good call 👍
src/prepack-options.js
Outdated
export type Compatibility = "browser" | "jsc-600-1-4-17" | "node-source-maps" | "node-cli"; | ||
export const CompatibilityValues = ["browser", "jsc-600-1-4-17", "node-source-maps", "node-cli"]; | ||
|
||
export type Options = {| |
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.
You could rename this type to PrepackOptions
, or CombinedPrepackOptions
, to make it a bit more clear what this type represents.
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.
let's pick PrepackOptions
Awesome! @cblappert, do you think this might break any internal tooling? |
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.
Looks great, I'll do the import as I'll have to rename the arguments internally as well.
@cblappert has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
prepack-options.js
filePartialEvaluatorOptions
type which contains onlysourceMaps
#841