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

Questions about the project structure #26

Open
fdcastel opened this issue Oct 30, 2015 · 2 comments
Open

Questions about the project structure #26

fdcastel opened this issue Oct 30, 2015 · 2 comments

Comments

@fdcastel
Copy link
Contributor

This project is an excellent resource for new users. However, there are several things that I think should be better explained or refactored.

I tried to browse the topics on http://websharper.com/docs hoping to get some answers, but to no avail. What about to make an article about the build process? ;)

Some questions:

  1. The "src/" folder contains "bin/" and "obj/" subfolders (!?).

This certainly is not right. Maybe it could be called "app/" or something else? Or, better yet, to move the generated assets to another folder outside "src/" ? ("build/", probably?)

  1. The build process generates output in TWO different folders ("src/Content/" and "build/"). Why? Also, why the "build/" folder have no binaries and only client-side assets (js, css, html)?

I understand that "src/Content/" should be kept updated during debug time. However, shouldn't the build/ folder have everything needed to run the application, except the sources (e.g. for a "xcopy deploy")?

  1. The application uses "style.css" and some images from "files/" folder. The "style.css" is copied to "build/" folder. But the "files/" folder aren't? All the static assets shouldn't be handled the same way?

Also, there is some kind of "registration" procedure for asset files? I mean: some way to tell the build process that these files are needed to deploy?

BTW: WebSharper.UI.Next.Samples.css is always empty (0 bytes). What is it for? How can I add some content to it? At first glance I expected it to have the content of "style.css" and every other .css put in "src/" folder (like several other web frameworks do today).

  1. What is "WebSharper.UI.Next.Samples.head.html" for? I understand the need for separating ".js" and ".head.js". But, why the ".html"?

  2. Any reason to keep the old nuget package restore instead the new one? https://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore

@Tarmil
Copy link
Contributor

Tarmil commented Oct 30, 2015

One important thing to note is that this is a Single-Page Application, so the contents of the build folder is indeed all that is needed to run it. This project doesn't run any code on the server side; if it did, we couldn't deploy it to github.io. For a Client-Server Application, you would additionally copy the bin folder and Web.config to build, and that would be enough. The obj folder is simply intermediary build files, you can ignore it.

For the files folder, I believe this is an oversight, thanks for signaling it!

For WebSharper.UI.Next.Samples.css: this file contains the styles embedded in dependencies. For example, if you reference WebSharper.UI.Next.Formlets, then the contents of the embedded Formlet.css will be included. If you want to include your own file as a dependency, you can follow this procedure.

The .head.html file is basically a fragment that you can copy into index.html instead of the script link to .head.js if you find it cleaner. The .head.js file is just document.write("contents_of_.head.html").

For package restore, we do actually use the new restore. The reason why NuGet.exe is present in the repository is to be able to run on AppVeyor.

@fdcastel
Copy link
Contributor Author

Great! Thank you very much for the explanations, Tarmil. It is much clearer to me, now.

I know WebSharper for a while, but just now I'm having the chance to take a deeper look at it. It's a fantastic piece of work, guys! Congrats! :)

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

No branches or pull requests

2 participants