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

Clean sourcemaps from static output #12749

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Clean sourcemaps from static output #12749

merged 3 commits into from
Dec 16, 2024

Conversation

matthewp
Copy link
Contributor

Changes

  • During cleanup be sure to remove any .map files created from server JavaScript output. Otherwise these are left in and expose server source code to the client.

Testing

  • Added a new test to our basics fixture.

Docs

N/A, bug fix

Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: c9eda23

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 Dec 16, 2024
@matthewp
Copy link
Contributor Author

!preview clean-sm

Copy link
Contributor

Snapshots have been released for the following packages:

  • astro@experimental--clean-sm
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--clean-sm 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/db
🦋  info npm info @astrojs/alpinejs
🦋  info npm info @astrojs/markdoc
🦋  info npm info @astrojs/mdx
🦋  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/vue
🦋  info npm info @astrojs/web-vitals
🦋  info npm info @astrojs/internal-helpers
🦋  info npm info @astrojs/markdown-remark
🦋  info npm info @astrojs/studio
🦋  info npm info @astrojs/telemetry
🦋  info npm info @astrojs/underscore-redirects
🦋  info npm info @astrojs/upgrade
🦋  info astro is being published because our local version (0.0.0-clean-sm-20241216182429) has not been published on npm
🦋  warn @astrojs/prism is not being published because version 3.2.0 is already published on npm
🦋  warn @astrojs/rss is not being published because version 4.0.10 is already published on npm
🦋  warn create-astro is not being published because version 4.11.0 is already published on npm
🦋  warn @astrojs/db is not being published because version 0.14.4 is already published on npm
🦋  warn @astrojs/alpinejs is not being published because version 0.4.0 is already published on npm
🦋  warn @astrojs/markdoc is not being published because version 0.12.3 is already published on npm
🦋  warn @astrojs/mdx is not being published because version 4.0.2 is already published on npm
🦋  warn @astrojs/partytown is not being published because version 2.1.2 is already published on npm
🦋  warn @astrojs/preact is not being published because version 4.0.0 is already published on npm
🦋  warn @astrojs/react is not being published because version 4.1.0 is already published on npm
🦋  warn @astrojs/sitemap is not being published because version 3.2.1 is already published on npm
🦋  warn @astrojs/solid-js is not being published because version 5.0.0 is already published on npm
🦋  warn @astrojs/svelte is not being published because version 7.0.1 is already published on npm
🦋  warn @astrojs/tailwind is not being published because version 5.1.3 is already published on npm
🦋  warn @astrojs/vue is not being published because version 5.0.2 is already published on npm
🦋  warn @astrojs/web-vitals is not being published because version 3.0.1 is already published on npm
🦋  warn @astrojs/internal-helpers is not being published because version 0.4.2 is already published on npm
🦋  warn @astrojs/markdown-remark is not being published because version 6.0.1 is already published on npm
🦋  warn @astrojs/studio is not being published because version 0.1.2 is already published on npm
🦋  warn @astrojs/telemetry is not being published because version 3.2.0 is already published on npm
🦋  warn @astrojs/underscore-redirects is not being published because version 0.4.0 is already published on npm
🦋  warn @astrojs/upgrade is not being published because version 0.4.2 is already published on npm
🦋  info Publishing "astro" at "0.0.0-clean-sm-20241216182429"
🦋  success packages published successfully:
🦋  astro@0.0.0-clean-sm-20241216182429
🦋  Creating git tag...
🦋  New tag:  astro@0.0.0-clean-sm-20241216182429
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/db, @astrojs/internal-helpers, @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/studio, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/upgrade, @astrojs/vercel, @astrojs/vue, @astrojs/web-vitals, @benchmark/adapter, @benchmark/timer, astro, create-astro
• Running build in 29 packages
• Remote caching enabled
::group::@astrojs/telemetry:build
cache miss, executing bd16f7e761b30930

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

::endgroup::
::group::@astrojs/prism:build
cache miss, executing dc61de02b788bd39

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

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

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

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

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

::endgroup::
::group::create-astro:build
cache miss, executing 3729d417710e4634

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

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

> @astrojs/markdown-remark@6.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 f8021880f0ae879e

> astro@0.0.0-clean-sm-20241216182429 build /home/runner/work/astro/astro/packages/astro
> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" --copy-wasm && tsc


> astro@0.0.0-clean-sm-20241216182429 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"

::endgroup::
::group::@benchmark/timer:build
cache miss, executing 2486362042738a39

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

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

> @astrojs/partytown@2.1.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 8fbf8ad79ec31510

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

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

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

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

> @astrojs/svelte@7.0.1 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::
::group::@astrojs/sitemap:build
cache miss, executing 8fb48434bf224fe0

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

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

> @astrojs/vue@5.0.2 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/markdoc:build
cache miss, executing 257a77e663b86bef

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

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

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

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

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

::endgroup::
::group::@benchmark/adapter:build
cache miss, executing 1e2bf8197fead956

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

::endgroup::
::group::@astrojs/studio:build
cache miss, executing a03314940c1b8597

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

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

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

::endgroup::
::group::@astrojs/react:build
cache miss, executing 8d8386b635e17abc

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

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

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

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

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

::endgroup::
::group::@astrojs/db:build
cache miss, executing 857f19e0d9d63f5b

> @astrojs/db@0.14.4 build /home/runner/work/astro/astro/packages/db
> astro-scripts build "src/**/*.ts" && tsc && pnpm types:virtual


> @astrojs/db@0.14.4 types:virtual /home/runner/work/astro/astro/packages/db
> tsc -p ./tsconfig.virtual.json

::endgroup::
::group::@astrojs/web-vitals:build
cache miss, executing 781c68c307d4d46b

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

::endgroup::

 Tasks:    25 successful, 25 total
Cached:    0 cached, 25 total
  Time:    46.212s 

Copy link

codspeed-hq bot commented Dec 16, 2024

CodSpeed Performance Report

Merging #12749 will not alter performance

Comparing clean-sm (c9eda23) with main (a793557)

Summary

✅ 4 untouched benchmarks

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Changes to the logic LGTM!

Would be great to have a test that verifies that client-side sourcemaps still exist.

@matthewp
Copy link
Contributor Author

@natemoo-re there is, here: https://github.com/withastro/astro/pull/12749/files#diff-2861f147bef21ee8136a61bc560555091af92a8c0b95be1549a041efad2d99d9R20

@matthewp matthewp merged commit 039d022 into main Dec 16, 2024
16 checks passed
@matthewp matthewp deleted the clean-sm branch December 16, 2024 19:19
@astrobot-houston astrobot-houston mentioned this pull request Dec 16, 2024
@natemoo-re
Copy link
Member

@matthewp ah perfect, thanks! I misread that assert call.

matthewp added a commit that referenced this pull request Dec 16, 2024
* Clean sourcemaps from static output

* Add changeset

* Update test to look at frontend sourcemaps
matthewp added a commit that referenced this pull request Dec 16, 2024
* Clean sourcemaps from static output

* Add changeset

* Update test to look at frontend sourcemaps
ematipico pushed a commit that referenced this pull request Dec 18, 2024
* Revert "fix custom `assetFileNames` issue (#12449)" (#12746)

* Revert "fix custom `assetFileNames` issue (#12449)"

This reverts commit e6b8017.

This change caused source maps to be left in the client folder, exposing them into the server.

* Add changeset

* Clean sourcemaps from static output (#12749)

* Clean sourcemaps from static output

* Add changeset

* Update test to look at frontend sourcemaps

* Revert "fix custom `assetFileNames` issue (#12449)" (#12746)

* Revert "fix custom `assetFileNames` issue (#12449)"

This reverts commit e6b8017.

This change caused source maps to be left in the client folder, exposing them into the server.

* Add changeset

* Clean sourcemaps from static output (#12749)

* Clean sourcemaps from static output

* Add changeset

* Update test to look at frontend sourcemaps

* [ci] format

* fix build

* Skip experimental cc tests

* remove unused params
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.

2 participants