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

Ensure appEntrypoint is referenced in Vue components #9490

Merged
merged 8 commits into from
Jan 5, 2024

Conversation

natemoo-re
Copy link
Member

Changes

  • Closes Astro doesn't bundle imports from Vue appEntrypoint during build #6827, closes PLT-1346
  • Fixes bundling for styles referenced in the Vue integration's appEntrypoint file.
  • Rather than hacking Astro's internals to treat the virtual entrypoint as a special file, this PR adds a side-effectual import to every .vue component. It may not be the cleanest method, but this does allow Astro to associate styles referenced by the appEntrypoint with pages where Vue components are rendered.
  • This is probably fine to release as a patch

Testing

New test suite added for dev and build behavior

Tested manually, too

Docs

N/A, bug fix only

Copy link

changeset-bot bot commented Dec 20, 2023

🦋 Changeset detected

Latest commit: 66ac8b1

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 pkg: vue Related to Vue (scope) pkg: integration Related to any renderer integration (scope) pr: docs A PR that includes documentation for review labels Dec 20, 2023
@vincerubinetti
Copy link

Nice! Thanks for the fix. Looked at the code but wouldn't be able to make sense of it without more study.

Just double check that it works/errors consistently between dev and prod, as I think that's the most important thing 😇

@lilnasy
Copy link
Contributor

lilnasy commented Dec 20, 2023

!preview 9490

Copy link
Contributor

Snapshots have been released for the following packages:

  • @astrojs/vue@experimental--9490
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--9490 tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info astro
🦋  info npm info @astrojs/prism
🦋  info npm info @astrojs/rss
🦋  info npm info create-astro
🦋  info npm info @astrojs/alpinejs
🦋  info npm info @astrojs/lit
🦋  info npm info @astrojs/markdoc
🦋  info npm info @astrojs/mdx
🦋  info npm info @astrojs/node
🦋  info npm info @astrojs/partytown
🦋  info npm info @astrojs/preact
🦋  info npm info @astrojs/react
🦋  info npm info @astrojs/sitemap
🦋  info npm info @astrojs/solid-js
🦋  info npm info @astrojs/svelte
🦋  info npm info @astrojs/tailwind
🦋  info npm info @astrojs/vercel
🦋  info npm info @astrojs/vue
🦋  info npm info @astrojs/internal-helpers
🦋  info npm info @astrojs/markdown-remark
🦋  info npm info @astrojs/telemetry
🦋  info npm info @astrojs/underscore-redirects
🦋  info npm info @astrojs/upgrade
🦋  warn astro is not being published because version 4.0.7 is already published on npm
🦋  warn @astrojs/prism is not being published because version 3.0.0 is already published on npm
🦋  warn @astrojs/rss is not being published because version 4.0.1 is already published on npm
🦋  warn create-astro is not being published because version 4.6.0 is already published on npm
🦋  warn @astrojs/alpinejs is not being published because version 0.3.1 is already published on npm
🦋  warn @astrojs/lit is not being published because version 4.0.0 is already published on npm
🦋  warn @astrojs/markdoc is not being published because version 0.8.1 is already published on npm
🦋  warn @astrojs/mdx is not being published because version 2.0.2 is already published on npm
🦋  warn @astrojs/node is not being published because version 7.0.2 is already published on npm
🦋  warn @astrojs/partytown is not being published because version 2.0.2 is already published on npm
🦋  warn @astrojs/preact is not being published because version 3.0.1 is already published on npm
🦋  warn @astrojs/react is not being published because version 3.0.8 is already published on npm
🦋  warn @astrojs/sitemap is not being published because version 3.0.3 is already published on npm
🦋  warn @astrojs/solid-js is not being published because version 3.0.2 is already published on npm
🦋  warn @astrojs/svelte is not being published because version 5.0.2 is already published on npm
🦋  warn @astrojs/tailwind is not being published because version 5.0.4 is already published on npm
🦋  warn @astrojs/vercel is not being published because version 6.1.0 is already published on npm
🦋  info @astrojs/vue is being published because our local version (0.0.0-9490-20231220205454) has not been published on npm
🦋  warn @astrojs/internal-helpers is not being published because version 0.2.1 is already published on npm
🦋  warn @astrojs/markdown-remark is not being published because version 4.0.1 is already published on npm
🦋  warn @astrojs/telemetry is not being published because version 3.0.4 is already published on npm
🦋  warn @astrojs/underscore-redirects is not being published because version 0.3.3 is already published on npm
🦋  warn @astrojs/upgrade is not being published because version 0.2.1 is already published on npm
🦋  info Publishing "@astrojs/vue" at "0.0.0-9490-20231220205454"
🦋  success packages published successfully:
🦋  @astrojs/vue@0.0.0-9490-20231220205454
🦋  Creating git tag...
🦋  New tag:  @astrojs/vue@0.0.0-9490-20231220205454
Build Log

> root@0.0.0 build /home/runner/work/astro/astro
> turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*"

• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/upgrade, @astrojs/vercel, @astrojs/vue, @benchmark/timer, astro, create-astro
• Running build in 26 packages
• Remote caching enabled
::group::@astrojs/prism:build
cache miss, executing 4c62f7ed62ed24e4

> @astrojs/prism@3.0.0 build /home/runner/work/astro/astro/packages/astro-prism
> astro-scripts build "src/**/*.ts" && tsc -p ./tsconfig.json

::endgroup::
::group::@astrojs/telemetry:build
cache miss, executing cc156f1cadee13c9

> @astrojs/telemetry@3.0.4 build /home/runner/work/astro/astro/packages/telemetry
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/upgrade:build
cache miss, executing 179905e48019f429

> @astrojs/upgrade@0.2.1 build /home/runner/work/astro/astro/packages/upgrade
> astro-scripts build "src/index.ts" --bundle && tsc

::endgroup::
::group::create-astro:build
cache miss, executing 7058a3ca45129433

> create-astro@4.6.0 build /home/runner/work/astro/astro/packages/create-astro
> astro-scripts build "src/index.ts" --bundle && tsc

::endgroup::
::group::@astrojs/internal-helpers:build
cache miss, executing c9547c3dc40ded12

> @astrojs/internal-helpers@0.2.1 build /home/runner/work/astro/astro/packages/internal-helpers
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@astrojs/markdown-remark:build
cache miss, executing 4551e15d792fbc4e

> @astrojs/markdown-remark@4.0.1 build /home/runner/work/astro/astro/packages/markdown/remark
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::astro:build
cache miss, executing 830aa99cb24bc1c0

> astro@4.0.7 build /home/runner/work/astro/astro/packages/astro
> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild


> astro@4.0.7 prebuild /home/runner/work/astro/astro/packages/astro
> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts"


> astro@4.0.7 postbuild /home/runner/work/astro/astro/packages/astro
> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm"

::endgroup::
::group::@astrojs/alpinejs:build
cache miss, executing fe7ef027101f9b3a

> @astrojs/alpinejs@0.3.1 build /home/runner/work/astro/astro/packages/integrations/alpinejs
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/partytown:build
cache miss, executing d90605e8bfc6bb53

> @astrojs/partytown@2.0.2 build /home/runner/work/astro/astro/packages/integrations/partytown
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/underscore-redirects:build
cache miss, executing 80eb9d4e91d8cad3

> @astrojs/underscore-redirects@0.3.3 build /home/runner/work/astro/astro/packages/underscore-redirects
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@astrojs/rss:build
cache miss, executing 4f8df4fbbf79fe40

> @astrojs/rss@4.0.1 build /home/runner/work/astro/astro/packages/astro-rss
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/react:build
cache miss, executing 2796de269ce27d98

> @astrojs/react@3.0.8 build /home/runner/work/astro/astro/packages/integrations/react
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/lit:build
cache miss, executing 33d67f48fa93784d

> @astrojs/lit@4.0.0 build /home/runner/work/astro/astro/packages/integrations/lit
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/solid-js:build
cache miss, executing 85b250d6957a6c28

> @astrojs/solid-js@3.0.2 build /home/runner/work/astro/astro/packages/integrations/solid
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/node:build
cache miss, executing be61213df7ddc200

> @astrojs/node@7.0.2 build /home/runner/work/astro/astro/packages/integrations/node
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/preact:build
cache miss, executing fa080855bc6a8321

> @astrojs/preact@3.0.1 build /home/runner/work/astro/astro/packages/integrations/preact
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vercel:build
cache miss, executing 5b2b46f36c07d0ca

> @astrojs/vercel@6.1.0 build /home/runner/work/astro/astro/packages/integrations/vercel
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@benchmark/timer:build
cache miss, executing 69c2db2374156537

> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/mdx:build
cache miss, executing d35df4d11efd1c29

> @astrojs/mdx@2.0.2 build /home/runner/work/astro/astro/packages/integrations/mdx
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/sitemap:build
cache miss, executing 5ef53802f1ce094d

> @astrojs/sitemap@3.0.3 build /home/runner/work/astro/astro/packages/integrations/sitemap
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/markdoc:build
cache miss, executing 384bae21375128bf

> @astrojs/markdoc@0.8.1 build /home/runner/work/astro/astro/packages/integrations/markdoc
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vue:build
cache miss, executing fad1e19c55c4e7b4

> @astrojs/vue@0.0.0-9490-20231220205454 build /home/runner/work/astro/astro/packages/integrations/vue
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::
::group::@astrojs/tailwind:build
cache miss, executing 2281f815e8b59969

> @astrojs/tailwind@5.0.4 build /home/runner/work/astro/astro/packages/integrations/tailwind
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/svelte:build
cache miss, executing f87023f9b03741bf

> @astrojs/svelte@5.0.2 build /home/runner/work/astro/astro/packages/integrations/svelte
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::

 Tasks:    24 successful, 24 total
Cached:    0 cached, 24 total
  Time:    47.705s 

@lilnasy
Copy link
Contributor

lilnasy commented Dec 20, 2023

@vincerubinetti You can help us confirm by trying this preview release.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Looks good to me!

packages/integrations/vue/src/index.ts Outdated Show resolved Hide resolved
packages/integrations/vue/src/index.ts Outdated Show resolved Hide resolved
packages/integrations/vue/src/index.ts Outdated Show resolved Hide resolved
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Looks great!

@natemoo-re natemoo-re merged commit a1c3166 into main Jan 5, 2024
13 checks passed
@natemoo-re natemoo-re deleted the fix/vue-app-entrypoint-css branch January 5, 2024 19:30
@astrobot-houston astrobot-houston mentioned this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: vue Related to Vue (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Astro doesn't bundle imports from Vue appEntrypoint during build
6 participants