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

Generation: Add generation for external files #465

Merged
merged 7 commits into from
Jan 9, 2018

Conversation

DanielMSchmidt
Copy link
Contributor

@DanielMSchmidt DanielMSchmidt commented Dec 18, 2017

This PR allows us to get the source code of espressos APIs (which are not checked in to this project) and generate code from them. I used it for three actions, other ones will be quick wins (by adding the String type)

Copy link
Member

@rotemmiz rotemmiz left a comment

Choose a reason for hiding this comment

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

👏

module.exports = function downloadEspresso(fullyQualifiedClass) {
const tmpDir = os.tmpdir();
const path = fullyQualifiedClass.replace(/\./g, "/");
const fileContent = downloadFileSync(
Copy link
Member

Choose a reason for hiding this comment

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

I suggest you use concurrency here, this may take long time downloading files individually. I know there are a few download managers on npm that do exactly that.

Copy link
Contributor Author

@DanielMSchmidt DanielMSchmidt Dec 20, 2017

Choose a reason for hiding this comment

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

Isn't that a premature optimization? I mean this code is only executed while generating code 🤷‍♂️ Do you have a good opportunity at hand?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I gave it a try, but it made the code unnecessarily complicated to read, while I don't see this big speedup opportunities (we are talking about maybe 10 file in total, I guess). I would like to leave it this simple, but feel free to add the download package in 👍

Copy link
Member

Choose a reason for hiding this comment

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

cool, had no idea were talking about 10 files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

recounted, it's two 😆

@@ -18,6 +18,7 @@
"devDependencies": {
"babel-generator": "^6.25.0",
"babel-types": "^6.25.0",
"download-file-sync": "^1.0.4",
Copy link
Member

Choose a reason for hiding this comment

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

You're not using 'download' dependency anywhere, am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed that 👍

@DanielMSchmidt DanielMSchmidt force-pushed the add-generation-for-external-files branch from 30749f7 to 5906084 Compare December 21, 2017 14:19
@DanielMSchmidt DanielMSchmidt force-pushed the add-generation-for-external-files branch from 5906084 to e518fe0 Compare January 6, 2018 19:34
@DanielMSchmidt DanielMSchmidt changed the title Add generation for external files Generation: Add generation for external files Jan 7, 2018
@DanielMSchmidt DanielMSchmidt force-pushed the add-generation-for-external-files branch from e518fe0 to 3fb0c54 Compare January 8, 2018 06:29
@DanielMSchmidt DanielMSchmidt force-pushed the add-generation-for-external-files branch from 3fb0c54 to 5e7e76e Compare January 9, 2018 18:20
@DanielMSchmidt DanielMSchmidt force-pushed the add-generation-for-external-files branch from 5e7e76e to 708c85a Compare January 9, 2018 18:22
@DanielMSchmidt
Copy link
Contributor Author

@rotemmiz Tests seem green ✅

66 passing (5m)
4 pending

@rotemmiz rotemmiz merged commit e79a087 into master Jan 9, 2018
@rotemmiz rotemmiz deleted the add-generation-for-external-files branch January 9, 2018 19:05
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants