-
Notifications
You must be signed in to change notification settings - Fork 56
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
[native_assets_cli] Consider dynamically injecting verifiers that run after build()
/ link()
methods called user-provided closure
#1628
Comments
Ah you came up with an idea to achieve this! I was also thinking that instead of |
build()
/ link()
methods called user-provided closurebuild()
/ link()
methods called user-provided closure
I didn't want to do that, because a normal |
I still believe that the Here's a few reasons why I'm convinced of this:
So despite my idea of how we could do it, I still think we shouldn't do it: Follow the single-responsibility design principle: Validation is the responsibility of one component, which is the bundling tool. |
I believe when the output is erroneous, the easiest way for users to triage the errors is to step through their hook execution with a debugger. I believe it's better to report errors early instead of letting them propagate. But let's disagree and commit... #notPlanned |
We cannot have validation for temporary asset types (that only live between build and link) in embedders, because embedders don't know about those. So if we want to support validation for those, we should consider implementing this. |
If we allow arbitrary asset types between build & link then even the current system cannot do any validation between those (i.e. it's unrelated to #1623) I'd say that's something the asset type support and the linker have to agree / deal with - as the bundling tool really doesn't care about the data that flows from build hooks to link hooks, it only cares about the final assets it has to deal with (and embed in the application bundle). |
With the recent refactoring to make the CLI extensible, we removed the verification happening inside the hook, now only the invoker of the hook does the verification.
We could restore this regression by dynamically injecting verifier methods in the extension methods, e.g.
output.codeAssets.add()
could install avalidateCodeAssetBuildOutput
verifier into aSet<>
that thebuild
implementation will then run.The text was updated successfully, but these errors were encountered: