-
Notifications
You must be signed in to change notification settings - Fork 3
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
[WIP] Setup angular template for embark #2
base: master
Are you sure you want to change the base?
Conversation
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.
Hi @iamonuwa
I did the following and got an error:
embark new angulartest --template iamonuwa/embark-angular-template
cd angulartest
embark run --nodashboard
Error:
./app/main.ts
Module not found: Error: Can't resolve './app/app.module' in '/Users/iurimatias/Projects/tmp/test3/angulartest/app'
resolve './app/app.module' in '/Users/iurimatias/Projects/tmp/test3/angulartest/app'
using description file: /Users/iurimatias/Projects/tmp/test3/angulartest/package.json (relative path: ./app)
Field 'browser' doesn't contain a valid alias configuration
using description file: /Users/iurimatias/Projects/tmp/test3/angulartest/package.json (relative path: ./app/app/app.module)
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.wasm doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.json doesn't exist
as directory
/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module doesn't exist
[/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module]
[/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.wasm]
[/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.mjs]
[/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.js]
[/Users/iurimatias/Projects/tmp/test3/angulartest/app/app/app.module.json]
@ ./app/main.ts 3:0-45 10:41-50
@ multi ./app/main.ts
./app/main.ts
Module not found: Error: Can't resolve './environments/environment' in '/Users/iurimatias/Projects/tmp/test3/angulartest/app'
resolve './environments/environment' in '/Users/iurimatias/Projects/tmp/test3/angulartest/app'
using description file: /Users/iurimatias/Projects/tmp/test3/angulartest/package.json (relative path: ./app)
Field 'browser' doesn't contain a valid alias configuration
using description file: /Users/iurimatias/Projects/tmp/test3/angulartest/package.json (relative path: ./app/environments/environment)
@iurimatias thank you for the review. I'll fix this issue |
@iamonuwa @iurimatias just as an FYI: Turns out this is also an issue in @iamonuwa let us know how it goes! |
For reference, I created embarklabs/embark-typescript-template#2 @iamonuwa if you get this fixed, you eliminate two issues in one go! :) |
@PascalPrecht can we use gitter to chat? Shoot me a message there. @iamonuwa |
I'll use babel-loader inside the webpack.config.js to work on this. |
@iamonuwa sorry it's late here so I'll have to keep it short. Could you actually reproduce the issue or did the compilation work for you? We noticed that this may only occur in embark versions <= 3.2.x, so if you're working with the latest stable release, it might be possible those errors don't show up for you. The reason for that is because in 3.2.x, embark uses the webpack config from your dapp as supposed to its internal one. However if it does work with 3.1.x (I'm gonna verify this tomorrow morning), then this could be a good pointer for where to start looking! |
@PascalPrecht you are right. Am finding it difficult to reproduce the error on 3.1.x |
@iurimatias this is my terminal embark version 3.2.0-develop |
Oh that's a different error indeed. Can you remove |
@PascalPrecht I don't have .embark directory |
Hm.. your output says though that it listens to Can you verify once more please? |
@PascalPrecht just saw that, was looking at the my computer root directory |
Yes, sorry for not being too clear about that! |
Yeah, I guess the fault should be from me. |
@PascalPrecht still same error. I cannot reproduce @iurimatias error locally |
Okay, this is a different thing then. Can you scaffold a dapp newly with your template and embark being on 3.2.0-develop? |
@PascalPrecht, if I get you correctly, you need me to setup a new dApp with the requirements specified on the bounty? |
Oh sorry, what I meant was doing the exact steps that @iurimatias did here #2 (review) Remember that you've done your work on 3.1.x so to reproduce this it'd help to scaffold a new app using your template while using embark 3.2.x. Does that help? |
I've also just noticed that 3.1.10 (latest official release) doesn't actually come with a |
@PascalPrecht ATM, I still can't reproduce that error. |
@iamonuwa I was able to get past the error I reported by using then it breaks with this instead, which is something that needs changes to the template as part of the PR:
|
@iurimatias I'll look at it again |
@iamonuwa this option should get you there! https://www.typescriptlang.org/docs/handbook/decorators.html :) |
The module imports problem can likely be fixed by implementing the same changes to |
@PascalPrecht @iurimatias please review |
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.
Hey @iamonuwa
thanks for the update and we're getting there! I ran your branch locally and it turns out that stuff is still in flux. Did you actually tried running this to see whether things are working?
Here are some pointers:
@babel/plugin-proposal-decorators
is missing as a module, making it impossble to runembark run
- The patch applied to
base.resolve.extensions
needs to happen earlier in the config algorithm. If you try running the template the way it is right now, you'll notice that we still run into module resolution errors - Having all the above fixed, the code will compile, however at runtime it doesn't look as bright yet. It seems like Angular isn't bootstrapping. Again, please verify that you changes are working :)
Apart from that I left some minor comments inline for help and guidance.
import { environment } from './environments/environment'; | ||
if (environment.production) { | ||
enableProdMode(); | ||
} |
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.
It looks like we have some wrong indentation here.
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.
LGTM
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.
Sorry, I'm not sure I follow.. but maybe I wasn't clear enough. I wanted to point out that there's some wrong formatting, the }
being indented, which probably shouldn't be.
@@ -0,0 +1,3 @@ | |||
import '@angular/platform-browser'; | |||
import '@angular/platform-browser-dynamic'; | |||
import '@angular/core'; |
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 believe this file isn't needed. It doesn't seem to be imported anywhere. Can you verify this @iamonuwa ?
] | ||
], | ||
[ | ||
'@babel/plugin-proposal-decorators', { |
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.
Running this code will result in an error that @babel/plugin-proposal-decorators
is missing.
This needs to be added to package.json
'.wasm', '.mjs', '.js', '.json', | ||
// typescript extensions | ||
'.ts', '.tsx' | ||
]; |
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.
Defining those extensions here actually won't take any effect as base
is being used before it gets extended here. Please ensure it's base
is in shape before it's used for creating dev and prod environments.
@iamonuwa any updates? we're looking forward for this template |
@iurimatias I can't reproduce this error. Seems like I'll stop work if its urgent |
@iamonuwa not urgent! :) But we'd like to get your changes in. Unfortunately, we need to make sure that everything works first. Did you test this template locally and got a working app running with this code? If yes, can you provide steps on how to reproduce this? Because I'm unable to make this work. Thanks @iamonuwa ! |
Great @PascalPrecht. I'll do a video recording today |
@iamonuwa Looking forward to it! |
@iamonuwa - Frank from Gitcoin here, is there any followup on this PR? |
@iurimatias please review
Fixes #1