-
Notifications
You must be signed in to change notification settings - Fork 13
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
Using Femto as a library #47
Comments
This means that Femto would be a requirement for Fable now. Should Fable stop if Femto detects an invalid configuration? If Femto is embedded in Fable, how will the user launch Femto resolution mechanism? |
Yes, Femto would be a Fable dependency. But for now I'm just thinking to make it a very soft one and we can see if it's worth to tighten the integration later. Something like:
|
We could make Fable call the Femto CLI so the user can invoke the Femto CLI himself if needed. And activate Femto using a
That's where I have a problem. Unless Fable output the warning in the webpack log so the user got the info easily. Because if this is at the beginning it can be out of sight for example, Fable compile more than 60 files in my project and so if it's logged at the beginning I can miss the message. |
Thanks @alfonsogarciacaro happy to hear from you, it's been a while 😄 We can publish it as a library but I would need expose the functions that don't log anything to the console and instead generate just the required resolution actions (already there). There is also the option to include the compiled binaries and call it as an external CLI tool the same way you call Fable but extra information you get back from Femto if #17 (JSON output) is fixed. Another option is to call The only problem I see now is that compile times will blow up because Femto fetches the npm versions per library from the npm registry to compare the required ranges against the installed ones which takes on my machine 1s - 1.5s per package so it adds up for a large project with many dependencies especially because you don't need to check the dependencies you need every time you compile your app (The counter argument is that you do this only once before starting webpack dev server) |
BTW Femto does |
I discovered today that resolving one package version takes around 0.7 seconds which means if we have 10 packages to will take 7 seconds to complete. These results are calculated using So I am not sure if this is a good idea to run Femto from Fable. I think it should be the user who runs |
@alfonsogarciacaro Any feedback on this issue? I agree @MangelMaxime that it is probably not a very good idea to run femto on every compilation and that running it by hand will most likely be the easiest route (now even easier with |
Yeah, if it's going to make the build slower and the warnings can easily get out of sight probably it's not worth it. I'll close the issue, thanks a lot for your answers! |
This is an awesome tool! Thanks and congratulations to you both @Zaid-Ajaj and @MangelMaxime!
Did you get feedback about people using it? I'm assuming it's probably much easier for users if Femto is run automatically by Fable instead of adding an extra build step... Yes, I know I said I didn't want to add this kind of features to Fable, but if you maintain the tool and Fable just needs to call it, I'm happy with it 😉
Would it be possible to also include the option of referencing and calling Femto as a library. Fable could call it after running
dotnet restore
and display warnings to the user if something is found.The text was updated successfully, but these errors were encountered: