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

fix(goto): preserve search parameters in URL #46

Merged
merged 1 commit into from
Sep 9, 2024
Merged

fix(goto): preserve search parameters in URL #46

merged 1 commit into from
Sep 9, 2024

Conversation

vjo
Copy link
Contributor

@vjo vjo commented Sep 9, 2024

What is the current behavior?

It is not possible to navigate to a URL including search parameters because they are stripped by the goto override.

Therefor, this test fails:

import { expect } from '@playwright/test';
import { test } from '@stencil/playwright';

test('Playwright', async ({ page }) => {
  const url = 'https://playwright.dev/?key=val';
  await page.goto(url);

  expect(page.url()).toBe(url); // ❌
});

There is no obvious reasons for removing the search parameters from the URL in the goto method.

GitHub Issue Number: #45

What is the new behavior?

Search parameters in the URL are preserved.

Does this introduce a breaking change?

I would like to say no, but potentially (?)

We should not rely on goto stripping the parameters but it's possible someone could have write tests expecting this behavior.

Testing

I made sure the above test works locally but it does not seem that we have unit test for these "helpers"

@vjo vjo requested a review from a team as a code owner September 9, 2024 08:45
@tanner-reits tanner-reits self-requested a review September 9, 2024 13:24
Copy link
Contributor

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vjo I believe this is a safe change to make. Stripping the params was lingering behavior that got missed as we ported this helper from the implementation in Ionic Framework. Sorry about that!

@tanner-reits tanner-reits added this pull request to the merge queue Sep 9, 2024
Merged via the queue into stenciljs:main with commit 7de694a Sep 9, 2024
3 checks passed
@vjo
Copy link
Contributor Author

vjo commented Sep 9, 2024

@tanner-reits awesome, thank you for accepting this patch.
The team and I have been a bit confused when we started a new feature using search params 😅
All good now.

Do you know what is the schedule for the next release?

@tanner-reits
Copy link
Contributor

@vjo Yep! I'm gonna try to get a release out this week!

@vjo
Copy link
Contributor Author

vjo commented Sep 9, 2024

@tanner-reits great, thank you.

@vjo vjo deleted the vjo/fix-goto-triming branch September 9, 2024 17:20
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

Successfully merging this pull request may close these issues.

2 participants