-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Aurelia 2 support #709
Comments
I have yet to even try Aurelia 2 and I have no clue what needs to be done to upgrade my lib to support Au2. What would be great is that someone creates a PR with the required changes or at least explain what needs to be done to migrate a plugin to Au2. |
@MaximBalaganskiy I also published all the Wikis to a new Documentation website by using GitBook (kinda got the idea from Aurelia Docs actually) However, I still have to update all the demos, I guess I'll delete most of them and keep only WebPack since I guess RequireJS is out the door with Au2, I wish that Aurelia 2 would have better Vite support in the future. |
@ghiscoding Nice! Appreciate your effort! Au2 future is getting brighter with this plugin :) |
@MaximBalaganskiy It's getting late and I'll check that a bit more tomorrow but for now, I have to manually change it into my |
Try "." |
try specifuying the subfolder where github puts it, i think I've done that before with mdc lib. |
this sux if we now have to do that, it was working fine in Au1 |
Did you try switching to hash urls? This definitely works for MDC au2 bridge RouterConfiguration.customize({ useUrlFragmentHash: true, useHref: false }) |
nope still the same result with a slash and I tried your suggestion with |
I have this in html tempalte file <base href=""> |
that didn't work for me but maybe I was something different in my webpack config that keeps adding the slash |
Have a look at my demo app, may be something can be picked https://github.com/aurelia-ui-toolkits/aurelia-mdc-web/tree/v2/packages/app |
ahhh I found the issue, in my index.html, there a static base href defined, when even though I thought that it was added by WebPack, that wasn't the case...oops |
so you also have a base href defined in yours but you set it to empty. another thing that is different is that you are using I guess that's the default template that the new Au2 CLI produces, I'll convert it back to .ejs then Thanks for the help EDIT yup that worked fine after converting it back to |
@MaximBalaganskiy |
sorry, wrong branch |
I might have released v7 a little too early, oh well... I was thinking about possibly using pnpm workspaces in the future to properly |
I think you're not building the plugin correctly. You cannot just tsc everything and copy html, not with AU2. |
The way I had it in my initial conversion branch is the right way to do it. |
hmm I reverted some code in this commit because all the Types were missing, does that previous include the code you were expecting then? It still seems like tsc build though |
It was in the very first branch where I basically started a new plugin with CLI. |
Also, a hint, add this file to your projects to avoid TS html errors |
Here is that very first branch https://github.com/MaximBalaganskiy/aurelia-slickgrid/tree/au2 |
ok great that's helpful, I think I'll definitely have to go with the pnpm workspace to make sure it all works correctly. Thanks a lot for all these infos |
Not sure about |
So I went ahead and started migrating to pnpm workspaces (I've opened a new PR), the reason is mostly because when using the with WebPack I'm getting this error with esbuild I'm getting this error The next step I've done was to look at cloning the old commit you've referenced and trying it out, which is this commit and you said it works, but that's not entirely true, it does work running it from the - import * as Plugin from "../src/index";
+ import * as Plugin from "../dist/index"; // use build from dist
Aurelia
.register(I18nConfiguration, Plugin, RouterConfiguration.customize({ useHref: false }), Example19DetailView, Example19Preload)
.register(DecimalValueConverter, StringifyValueConverter, DateFormatValueConverter)
.app(MyApp)
.start(); with this I'm getting the exact same error as above with my code that is up to date, I'm getting |
This seems to have something to do with duplicate Aurelia imports. |
Managed to get it working but.... had to switch to vite |
If you give me permission to this branch I can push my current working code. |
Another option is to build with tsc and enable aurelia loader for the plugin in the consumer app. Currently node modules are excluded from html rule, you'll need to add an exception for the plugin folder |
Hi there, I added you as contributor so you should have access now (I don't know how else to give branch access). I do like Vite, so if we need Vite to get it working that's totally fine with me but is it just for creating/building the Plugin or does the end user also need Vite? I thought Au2 didn't support Vite yet? I stopped using WebPack and switched to Vite in my other projects
I'm not sure I want to go back to Gulp really, I dropped that long time ago when npm scripts became more popular. What did you use it for anyway? I'll take a look after work to your Gulp usage
Is that again for the Plugin build only or for the end user? I really don't know what to do, so all the help you can give me is more than appreciated. I'd really like to finish this before Christmas :D |
I'll push the vite option then. The consumer can keep using webpack, that'll work. |
I've reopened the issue since it's not fixed yet and you can reference it in your upcoming PR. Hey so I just saw that Sayan posted his own small datagrid on Aurelia discourse and taking a look at his build scripts, it looks like he's using TypeScript build directly with extra HTML/CSS files and that's about it, he's doesn't have any extra build scripts using WebPack or anything else. From his "build:ts": "tsc",
"build:other": "cpx ./src/**/*.{html,css} ./dist",
"build": "run-p build:ts build:other", I think 1 difference that I saw is that he's not using plugin directly but he has a Going back to using pure TypeScript would be easier, but a Vite build would work too. As long as I'm getting it to work, that's the ultimate goal I guess :D but it's helpful to look at how a core team member does it. Perhaps it's just my folders and files that is different and should be adjusted? |
Simple compilation works, but requires a loader configuration in a consumer app. There's no way around this - au2 compiles html into js |
ah yeah looking at Sayan's lib on unpkg, he does have html files in the |
In this simple.case we can just add a template in vm file |
Yeah so can we just use code like this? @customElement({
name: 'app-loader',
template: '<p>Loading...</p>'
}) will that code be native without requiring an html loader? |
Yes |
I'm submitting a Feature request
Are there plans to upgrade to Aurelia 2?
The text was updated successfully, but these errors were encountered: