Giter Club home page Giter Club logo

Comments (17)

jwx avatar jwx commented on July 25, 2024 1

To be clear: the router in Aurelia 2 doesn't use or require the <base> tag.

from new.

3cp avatar 3cp commented on July 25, 2024

You are not supposed to put relative path inside <base>. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

What you have is different issue I think.

from new.

xenoterracide avatar xenoterracide commented on July 25, 2024

ionic-team/capacitor#1037 I'm open to alternative fixes, since I've provided reproduction steps, but what is currently there does not work

from new.

3cp avatar 3cp commented on July 25, 2024

I think I am wrong about <base>.

The base URL to be used throughout the document for relative URLs. Absolute and relative URLs are allowed.

But in Aurelia, we have to use absolute path inside <base> to support routes.

Because inside a front-end route http://localhost/product/1, <base href="./"> does not work for us.

from new.

3cp avatar 3cp commented on July 25, 2024

If the app and unit tests and cypress tests all work as expected, I guess this repo might not correct place to fix your electron setup. But I have no much experience on electron anyway, I might be wrong.

from new.

3cp avatar 3cp commented on July 25, 2024

The <base href="./"> is not a fix. As I said, it will break Aurelia app with pushState routes, unless @jwx did something different from Aurelia 1.

from new.

xenoterracide avatar xenoterracide commented on July 25, 2024

pushState (if I understand you correctly) does not work in electron see aurelia/aurelia#852

from new.

3cp avatar 3cp commented on July 25, 2024

But we cannot use your fix because this repo is mainly to support Aurelia app (majority of users will use router), not electron.

from new.

3cp avatar 3cp commented on July 25, 2024

Since you knew why to make your setup work, you can mutate the app after it was generated. I guess simply remove <base> element will work for you too.

from new.

xenoterracide avatar xenoterracide commented on July 25, 2024

I'm using router, currently it seems fine, but maybe I don't have the right thing done, I don't have a route like product/1 for example. I see someone also suggesting '' maybe that is the better fix. I'll try it.

My app needs to support ALL of the platforms and things like product/1 will need to work in all of them.

from new.

3cp avatar 3cp commented on July 25, 2024

My example is for when use click a menu to <a href="another/page"> from /product/1 page, the <base href="./"> will tell browser to route to /product/another/page (or /product/1/another/page I am not sure), not /another/page (<base href="/"> will give that correct result).

You need to test your other base fix for the above case.

from new.

xenoterracide avatar xenoterracide commented on July 25, 2024

<base href=""> works too, if that's any better

from new.

xenoterracide avatar xenoterracide commented on July 25, 2024

we can leave this open for now, @jwx has some insight here as well... all I really have right now is that href="/" causes issues other SPA platforms

curious, what happens if you serve an app root at http://localhost/foo and you're using / will that still work correctly?

from new.

3cp avatar 3cp commented on July 25, 2024

I tested <base href=""> in au1, it broke the reload if I reload a page with some route /not/root, it might be due to I use lots of bare url resources link in my app.

from new.

3cp avatar 3cp commented on July 25, 2024

Let's follow up this issue in the aurelia/aurelia#852, might be an opportunity to remove <base> from au2's router requirement. Actually I never heard about <base> tag before using Aurelia.

from new.

xenoterracide avatar xenoterracide commented on July 25, 2024

I don't actually think that's the right place to discuss this as it confuses the issue, since there are 2 separate issues. In discord I got this from @jwx

Jurgen: Right. So 1) the au2 router doesn't use so that can safely be removed

and doing that works for me

from new.

3cp avatar 3cp commented on July 25, 2024

Great! Let's just remove it!

from new.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.