-
Notifications
You must be signed in to change notification settings - Fork 88
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
Update full option #363
Update full option #363
Conversation
I've added Azure deployment support to the Full option as well as put in the renaming you suggested so now the client / server / sample folders, project files and namespaces will all respect the name used when creating the template. |
This is what the generated template looks like https://github.com/CompositionalIT/safe-full-test |
I'm not sure if the naming of the folders (based on app name) is a good idea. I'm not sure what value it brings. Namespacing and the project files, yes. Not sure about the folders. |
looking at this now - will write down notes for myself and share them when finished |
Remoting doesn't require polyfills, it uses XMLHttpRequest under the hood which is supported everywhere |
@Zaid-Ajaj Great. Sorry, I did a poor job of explaining. These are two separate features that we want to include in the template. But good to know we don't need wg-fetch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
Couple of questions / comments:
- I understand that the PR already contains Farmer support in its desired final shape?
- I'll rebase my changes on top of this when it's merged so that other changes that I feel should be added are there
- Adding tests to full template - you can add them, or I can do it together with the rebase
- For the tests to be there, I would change the counter example to the sample todo list as discussed
- I'd leave folder names as they were (Shared, Server, Client) and let template engine rename only project / solution files
- If we removing "RELEASE NOTES" and Devcontainer, we need to describe that features in docs, will add a comment to the other issue
"devDependencies": { | ||
"@babel/core": "^7.6.4", | ||
"@babel/plugin-transform-runtime": "^7.6.2", | ||
"@babel/preset-env": "^7.9.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is preset-env the only change in NPM dependencies between default and minimal? Should we review other dependencies as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should - I would suggest someone that knows more than I do about webpack and babel though!
"@babel/runtime": "^7.6.3", | ||
"babel-loader": "^8.0.5", | ||
"copy-webpack-plugin": "^5.1.1", | ||
"core-js": "^3.3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I once saw warnings about core-js
versions - did you encounter that as well? Should we double check it?
@theimowski Happy for you to add in the tests on top of this if you want once this PR is merged? Just so I understand - in terms of tests, will this be the plumbing around the tests plus maybe one or two tests themselves? Or something more? Again, I think we should keep the template focused on reducing boilerplate - the educational content can go into the docs. Regarding the todo app - I would say it would be better to make that a separate sample app - and I'm happy to do the work for that if needed - where we can really go to town on the testing etc.. I think the template should just contain the projects and FAKE tasks etc. required for the testing. |
And yes, that's correct re: Farmer. It all works. |
Ok I'll add the tests once this PR is merged. To sum up, additional stuff for the tests would be (inspired by @Zaid-Ajaj template):
|
@theimowski that works for me re: call. I'm just concerned that we're adding more code than might be needed for the template and this could be better served with documentation. Of the bullet points, I agree with every one except the first one - I don't (personally) mind that the test is "useless" because the objective (IMHO!) is putting the plumbing in place, not showing how to write tests. IMHO. |
Just tried out the full option from fc82885 and |
Hmmmmm. Let me check that.
…On Tue, 2 Jun 2020, 22:16 Tomasz Heimowski, ***@***.***> wrote:
Just tried out the full option from fc82885
<fc82885>
and dotnet fake build -t run doesn't work - Client fails to compile
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#363 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANTANIEVWZ4SX6LJQIEU3TRUVM2XANCNFSM4NOX53JQ>
.
|
@theimowski just tested. Indeed it failed the first time I ran it - it couldn't find the Counter type (from the Shared project). I ran it again and it worked. Obviously this is not desirable, so we need to either find out why Fable sometimes fails with project references, or go back to the shared file approach. cc: @MangelMaxime @theprash @Zaid-Ajaj |
Here's the full build log. I've noticed that the build log below is missing the compilation of the PS C:\Users\Isaac\Source\Repos\safetest> dotnet fake build -t run
Extracted Paket.Restore.targets to: C:\Users\Isaac\Source\Repos\safetest\.paket\Paket.Restore.targets (Can be disabled with PAKET_SKIP_RESTORE_TARGETS=true)
Starting full restore process.
run run
Building project with version: LocalBuild
Shortened DependencyGraph for Target Run:
<== Run
<== InstallClient
<== Clean
The running order is:
Group - 1
- Clean
Group - 2
- InstallClient
Group - 3
- Run
Starting target 'Clean'
Finished (Success) 'Clean' in 00:00:00.0101546
Starting target 'InstallClient'
C:\Users\Isaac\Source\Repos\safetest\src\Client> "C:\Program Files\nodejs\npm.cmd" install (In: false, Out: false, Err: false)
> core-js@3.6.5 postinstall C:\Users\Isaac\Source\Repos\safetest\src\Client\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
added 815 packages from 428 contributors and audited 816 packages in 29.966s
25 packages are looking for funding
run `npm fund` for details
found 2 vulnerabilities (1 low, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
Finished (Success) 'InstallClient' in 00:00:34.6370679
Starting target 'Run'
C:\Users\Isaac\Source\Repos\safetest\src\Client> "C:\Program Files\nodejs\npm.cmd" run start (In: false, Out: false, Err: false)
C:\Users\Isaac\Source\Repos\safetest\src\Server> "C:\Program Files\dotnet\dotnet.EXE" watch run (In: false, Out: false, Err: false)
> @ start C:\Users\Isaac\Source\Repos\safetest\src\Client
> webpack-dev-server
watch : Started
Bundling for development...
i 「wds」: Project is running at http://0.0.0.0:8080/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\Isaac\Source\Repos\safetest\src\Client\public
fable-compiler 2.4.22
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\Isaac\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Hosting environment: Production
Content root path: C:\Users\Isaac\Source\Repos\safetest\src\Server
Now listening on: http://0.0.0.0:8085
Application started. Press Ctrl+C to shut down.
fable: Compiled safetest.Client.fsproj
fable: Compiled Client.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Box.fs
fable: Compiled .fable\Fable.React.5.3.6\Fable.React.Props.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\cmd.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Heading.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Form\Control.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Form\Field.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Button.fs
fable: Compiled .fable\Fulma.2.7.0\Layouts\Container.fs
fable: Compiled .fable\Fulma.2.7.0\Layouts\Column.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\program.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Remoting.fs
fable: Compiled .fable\Fulma.2.7.0\Layouts\Hero.fs
fable: Compiled .fable\Fable.Elmish.Debugger.3.2.0\Fable.Import.RemoteDev.fs
fable: Compiled .fable\Fulma.2.7.0\Components\Navbar.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Form\Input.fs
fable: Compiled .fable\Fable.Elmish.HMR.4.0.1\hmr.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Extra.fs
fable: Compiled .fable\Fable.Elmish.HMR.4.0.1\common.fs
fable: Compiled .fable\Fable.Elmish.Debugger.3.2.0\debugger.fs
fable: Compiled .fable\Fable.Elmish.React.3.0.1\react.fs
fable: Compiled .fable\Fulma.2.7.0\Common.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Types.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Encode.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Decode.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Types.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\prelude.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\ring.fs
fable: Compiled .fable\Fable.Elmish.React.3.0.1\common.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Proxy.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\TypeInfo.Converter.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Http.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\SimpleJson.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\Json.Converter.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\TypeInfo.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\Json.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\TypeCheck.fs
fable: Compiled .fable\Fable.Parsimmon.4.1.0\Parsimmon.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\Parser.fs
× 「wdm」: Hash: 0f1be318f25227f9ac24
Version: webpack 4.42.0
Time: 35108ms
Built at: 06/02/2020 23:15:36
Asset Size Chunks Chunk Names
app.js 4.18 MiB app [emitted] app
index.html 442 bytes [emitted]
vendors~app.js 4.62 MiB vendors~app [emitted] vendors~app
Entrypoint app = vendors~app.js app.js
[0] multi (webpack)-dev-server/client?http://0.0.0.0:8080 (webpack)/hot/dev-server.js ./safetest.Client.fsproj 52 bytes {app} [built]
[./Client.fs] 20.9 KiB {app} [not cacheable] [built] [10 errors]
[./node_modules/strip-ansi/index.js] 161 bytes {vendors~app} [built]
[./node_modules/webpack-dev-server/client/index.js?http://0.0.0.0:8080] (webpack)-dev-server/client?http://0.0.0.0:8080 4.29 KiB {vendors~app} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {vendors~app} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {vendors~app} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {vendors~app} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {vendors~app} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {vendors~app} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {vendors~app} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {app} [built]
[./node_modules/webpack/hot/dev-server.js] (webpack)/hot/dev-server.js 1.59 KiB {vendors~app} [built]
[./node_modules/webpack/hot/emitter.js] (webpack)/hot/emitter.js 75 bytes {vendors~app} [built]
[./node_modules/webpack/hot/log-apply-result.js] (webpack)/hot/log-apply-result.js 1.27 KiB {vendors~app} [built]
[./safetest.Client.fsproj] 28 bytes {app} [built]
+ 374 hidden modules
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(10,14): (10,21) error FSHARP: The type 'Counter' is not defined. (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(15,29): (15,36) error FSHARP: The type 'Counter' is not defined. (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(20,38): (20,43) error FSHARP: The value, namespace, type or module 'Route' is not defined. Maybe you want one of the following:
round
Role (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(21,32): (21,43) error FSHARP: The type 'ICounterApi' is not defined. Maybe you want one of the following:
IContext (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(22,24): (22,52) error FSHARP: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. (code 72)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(30,32): (30,37) error FSHARP: The record label 'Value' is not defined. (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(33,45): (33,50) error FSHARP: The record label 'Value' is not defined. (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(43,30): (43,43) error FSHARP: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. (code 72)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(7,6): (7,14) error FSHARP: The namespace or module 'safetest' is not defined. (code 39)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
ERROR in ./Client.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/Isaac/Source/Repos/safetest/src/Client/Client.fs(80,69): (80,74) error FSHARP: This expression was expected to have type
'obj option'
but here has type
'Model' (code 1)
@ ./safetest.Client.fsproj 1:0-28 1:0-28
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./index.html] 545 bytes {0} [built]
[./node_modules/lodash/lodash.js] 528 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
i 「wdm」: Failed to compile.
Application is shutting down...
watch : Shutdown requested. Press Ctrl+C again to force exit.
Gracefully shutting down..
Press ctrl+c again to force quit
Terminate batch job (Y/N)? Killing all processes that are created by FAKE and are still running.
Trying to kill process 'dotnet' (Id = 10960)
Finished (Failed) 'Run' in 00:02:25.8831688
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0032210
InstallClient 00:00:34.6364551
Run 00:02:25.8824128 (Process exit code '-1' <> 0. Command Line: C:\Program Files\nodejs\npm.cmd run start)
Total: 00:03:00.6936037
Status: Failure
---------------------------------------------------------------------
Hint: Could not find a version in your paket.dependencies file, consider adding 'version 5.241.2' at the top of your dependencies file (C:\Users\Isaac\Source\Repos\safetest\paket.dependencies).
Read https://github.com/fsharp/FAKE/issues/2193 for details.
Performance:
- Cli parsing: 319 milliseconds
- Packages: 860 milliseconds
- Creating Runtime Graph: 88 milliseconds
- Retrieve Assembly List: 902 milliseconds
- Script compiling: 5 seconds
- Script analyzing: 363 milliseconds
- Script running: 3 minutes
- Script cleanup: 6 milliseconds
- Runtime: 3 minutes, 10 seconds Running immediately after again, same command. Notice how fable: Compiled safetest.Client.fsproj
fable: Compiled Client.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Box.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\cmd.fs
fable: Compiled .fable\Fable.React.5.3.6\Fable.React.Props.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Heading.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Form\Control.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Button.fs
fable: Compiled .fable\Fulma.2.7.0\Layouts\Container.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\program.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Form\Field.fs
fable: Compiled .fable\Fulma.2.7.0\Layouts\Column.fs
fable: Compiled .fable\Fulma.2.7.0\Components\Navbar.fs
fable: Compiled .fable\Fulma.2.7.0\Elements\Form\Input.fs
fable: Compiled .fable\Fable.Elmish.Debugger.3.2.0\Fable.Import.RemoteDev.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Remoting.fs
fable: Compiled .fable\Fable.Elmish.HMR.4.0.1\hmr.fs
fable: Compiled .fable\Fulma.2.7.0\Layouts\Hero.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Extra.fs
fable: Compiled ..\Shared\Shared.fs
fable: Compiled .fable\Fable.Elmish.Debugger.3.2.0\debugger.fs
fable: Compiled .fable\Fable.Elmish.HMR.4.0.1\common.fs
fable: Compiled .fable\Fable.Elmish.React.3.0.1\react.fs
fable: Compiled .fable\Fulma.2.7.0\Common.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Types.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Encode.fs
fable: Compiled .fable\Thoth.Json.4.0.0\Decode.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Types.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\prelude.fs
fable: Compiled .fable\Fable.Elmish.3.0.6\ring.fs
fable: Compiled .fable\Fable.Elmish.React.3.0.1\common.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Proxy.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\TypeInfo.Converter.fs
fable: Compiled .fable\Fable.Remoting.Client.5.12.0\Http.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\SimpleJson.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\Json.Converter.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\Json.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\TypeInfo.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\TypeCheck.fs
fable: Compiled .fable\Fable.Parsimmon.4.1.0\Parsimmon.fs
fable: Compiled .fable\Fable.SimpleJson.3.9.0\Parser.fs |
And the Client project is as follows: <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<DefineConstants>FABLE_COMPILER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="index.html" />
<None Include="package.json" />
<None Include="package-lock.json" />
<None Include="webpack.config.js" />
<None Include="paket.references" />
<Compile Include="Client.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\safetest.Shared.fsproj" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project> |
Interestingly it works fine for minimal |
@theimowski I believe that this brings the "full" template up to the expectation of the matrix options based on this repo from @theprash.
It includes Fable Remoting and Polyfills through separate lock files (although not wg-fetch - do we need this for Fable Remoting @Zaid-Ajaj). It also removes Thoth Fetch for this version of the template.
It also follows the pattern in the template so that you can still actually build the template and get intellisense (most of the time!).
The only thing I want to add is Farmer support for a deployment which should be quite simple.
@theimowski I will try to add tests to the "full" version (based on the work you've done) but aside from that I think that we might well be done. I'm happy to create a sample repo for the todo app if you like - this is something we could build on over time adding e.g. a proper stateful db etc. - might be good as an alternative to the Bookstore.
What do you think?