Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Allow more than one input file for Prepack #776

Closed
wants to merge 1 commit into from
Closed

Allow more than one input file for Prepack #776

wants to merge 1 commit into from

Conversation

hermanventer
Copy link
Contributor

We usually need at least two files: 1) the environmental model and 2) the bundle to be Prepacked.
In general, there is no good reason to not allow as many files as the caller wants.

To make this not be a breaking chance, I've added a new API for this: prepackSources.

Further complications result from working around a bug in Babel and not increasing the module cycle length for Flow.

if (!serialized) {
throw new FatalError();
}
return serialized;
}

/* deprecated: pelase use prepackString instead. */
Copy link
Contributor

Choose a reason for hiding this comment

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

spelling

initializeGlobals(realm);

if (options.serialize || !options.residual) {
let serializer = new Serializer(
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation looks fine. Prettier will fix that too...

sourceMapContents: JSON.stringify(serialized.map) }];
let result = realm.$GlobalEnv.executePartialEvaluator(residualSources, options);
if (result instanceof AbruptCompletion) throw result;
return (result: any);
Copy link
Contributor

Choose a reason for hiding this comment

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

This any-cast makes me sad. Is it really needed?

Copy link
Contributor Author

@hermanventer hermanventer Jul 3, 2017

Choose a reason for hiding this comment

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

It is, due to a bug/limitation in Flow. I'll change this to a $FlowFixMe comment.

@facebook-github-bot
Copy link

@hermanventer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants