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: astro island urls missing assetsPrefix in SSR mode #6862

Merged
merged 4 commits into from
Apr 17, 2023

Conversation

jcdogo
Copy link
Contributor

@jcdogo jcdogo commented Apr 17, 2023

Changes

Testing

We added a test to astro/test/astro-assets-prefix.test.js.

it('react component astro-island should import from assetsPrefix', async () => {
	const request = new Request('https://example.com/custom-base/');
	const response = await app.render(request);
	expect(response.status).to.equal(200);
	const html = await response.text();
	const $ = cheerio.load(html);
	const island = $('astro-island');
	expect(island.attr('component-url')).to.match(assetsPrefixRegex);
	expect(island.attr('renderer-url')).to.match(assetsPrefixRegex);
});

A similar test case already existed for the SSG case, but not for SSR. I just copied and adapted the test case for SSR. When the test case was added for SSR, it was failing until we implemented the fix.

Docs

This change should not really affect the user's behavior since it is a bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Apr 17, 2023

🦋 Changeset detected

Latest commit: b9589fa

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Apr 17, 2023
@bluwy bluwy merged commit 1f26994 into withastro:main Apr 17, 2023
@bluwy
Copy link
Member

bluwy commented Apr 17, 2023

Thanks for the fix!

@astrobot-houston astrobot-houston mentioned this pull request Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assetsPrefix is not prepended to astro island component-url and renderer-url
3 participants