Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Manifest validation needed #86

Open
irae opened this issue Mar 7, 2017 · 6 comments
Open

Manifest validation needed #86

irae opened this issue Mar 7, 2017 · 6 comments

Comments

@irae
Copy link
Collaborator

irae commented Mar 7, 2017

Making a manifest is hard enough, without validation is super hard for someone not familiar with mendel internals.

For instance, there is a "outlet" requirement on the "bundle". If you don't match exactly with an existing outlet plugin by id you will get an error deep down on inside the compiler chain. Instead we should warn at boot of the pipeline.

Al required fields should be there, al folders should exist, all references by ID should validate and all modules should be loaded successfully before we start mendel. I think having validation will pay off in the long run better than having a installation script, since people start projects simple and add stuff as they progress.

@irae
Copy link
Collaborator Author

irae commented Mar 7, 2017

Very related to #82

@stephanwlee stephanwlee added this to the Mendel v2 milestone Mar 7, 2017
@irae irae removed this from the Mendel v2 - From beta to final milestone Apr 16, 2017
@irae
Copy link
Collaborator Author

irae commented May 13, 2017

Ha! I forgot I already knew about this.

I believe the way to go is to recover mendel-postprocess-manifest. It used to be a file inside mendel-browserify and the sorting and validation is still unused files on mendel-development-middleware.

It should be easy to make mendel-outlet-manifest incorporate the architecture and we could instead of forcing to uglify have this done per configuration, opening the architecture to have people use babily if they so prefer instead of uglify.

Either way, it should be easy to have sorting and validation added back because the data structures are still the same. mendel-manifest-uglify being used without changes proves this is the case.

@irae
Copy link
Collaborator Author

irae commented Jun 8, 2017

closed by #130

@irae irae closed this as completed Jun 8, 2017
@irae
Copy link
Collaborator Author

irae commented Jun 9, 2017

I reverted PR #130 and we will be working on this again. No harm done as I didn't push this versions to npm yet.

@irae irae reopened this Jun 9, 2017
@irae
Copy link
Collaborator Author

irae commented Jun 9, 2017

Older validation was breaking because we don't support the notion of "external" on the mendel-pipeline right now.

We do support:

  • "expose": when a module is included on a bundle but made available to other bundles by a given name

We do not support:

  • "external": When I modules is not on a given bundle, but we expect it to be available on a different bundle.

This has the same underlying issue we saw when @muralikr and @anuragdamle decided to shasum in mendel-generator-prune and later decided they would not use "prune" anymore. The reason was: mendel-generator-prune didn't have enough information to avoid compressing IDs on bundles that had external sources.

In "browser-pack" or in browserify land we used to mark externals with "boolean false" which is different from undefined or something else:

https://github.com/yahoo/mendel/blob/aca231e37b1f56fed5dd14a5ec969eb7830868b8/packages/mendel-manifest-extract-bundles/manifest-extract.js#L102

This was easy to miss when moving to mendel v3. I think it is likelly we need to have our own way of conveying "externality" of deps.

@irae
Copy link
Collaborator Author

irae commented Jun 9, 2017

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

No branches or pull requests

2 participants