- Refactor screenshot functionality into testable utility functions
- Add comprehensive test suite to catch regressions early
- Ensure functionality doesn't break unexpectedly without notification
--patch-1
based on review, make throw error naturally
---------
Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
The relevant dependencies were lost in previous cleanups. This situation
caused the screenshot function to fail.
This PR properly cleans up the functional function and restores its
operation.
---------
Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Inspired by #2819, #2829, and
https://github.com/pakornv/fresh-plugin-tailwindcss, I made minimal
modifications to the plugin-tailwind, I originally intended to update
based on #2829, but I was informed by the system that I couldn't push.
Due to the breaking changes in Tailwind v4, some PostCSS plugins are no
longer required. Additionally, I updated the syntax in the /www
directory. The /www directory now uses the updated plugin supported by
Tailwind v4.I think this has made initial progress.
# What This PR Solves
The Tailwind plugin has been updated to support Tailwind v4, and it is
currently functioning well both in the repository's www directory and in
the initialized project which for test.
## --patch-1
### 1. Dependency Optimization
- Removed `cssnano` dependency, using Tailwind v4's built-in
optimization(Based on @csvn 's suggestion)
- Removed `autoprefixer` dependency
- Updated `tailwind-plugin` version number
### 2. Build Configuration Adjustments
- Added `--node-modules-dir` parameter to `/www` task for Tailwind v4
support (Based on @marvinhagemeister 's suggestion)
- Added `--allow-scripts` parameter to enable `@tailwindcss/oxide`
execution
### 3. Code Adaptation
- Modified Tailwind-related code in `/www` to support Tailwind v4
- Updated dependency configuration in `deno.json`
### 4. Feature Restoration
- Added `imagescript` and `astral` dependencies to restore screenshot
functionality lost in previous PR updates
- Fixed the issue where the `tailwind-plugin` dependency was incorrectly
pointing to the JSR package instead of the local repository source code
in previous PR.
## --patch-2
- Upgraded Tailwind CSS to the latest version.
- Removed unnecessary dependencies.
- Enabled CSS minification by default when Fresh is in production mode.
- Updated docs/canary/examples/migration-guide.md to support the new
Tailwind plugin format.
- Updated init/src/init.ts to support the new Tailwind version and
plugin version, use new `@import "tailwindcss"`, and generate the new
plugin format.
- Updated init/src/init_test.ts: tests now expect `css` to match
`/tailwindcss/` instead of `/@tailwind/`.
- Removed plugin-tailwindcss/src/types.ts as it is no longer needed, and
updated plugin-tailwindcss/src/mod.ts and www/dev.ts to support the new
format.
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
## --patch-3
Addressing @marvinhagemeister feedback, this patch reverts the
unintended loss of PR #2960's changes caused by merge conflicts.
## --patch-4
I initialized a project according to the migration documentation and
used @fresh/update to test whether the plugin works properly with
v2-alpha-34. The results show that it works fine.
- The plugin is published at
jsr:@freshpress/fresh-plugin-tailwind@0.0.1-alpha.8.
- The test project is published at
https://github.com/SisyphusZheng/fresh-project-test/tree/main/fresh-project.
# How Testing Was Conducted
## Local Environment Testing
1. Environment Cleanup
```bash
rm -rf ./.cache/deno deno.lock node_modules
```
2. Test Execution
```bash
deno task www
```
3. Result Verification
- Checked functionality in local `/www` environment
- Confirmed all features working properly
## Code Inspection
- Passed `deno task ok` check
## This forked /www website is hosted and running on GitHub Codespaces,
with support for the latest code changes. You can check it out at:
https://silver-trout-pjr4jw7xx5x9299x6-8000.app.github.dev/
---------
Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: deno-deploy[bot] <75045203+deno-deploy[bot]@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
The benefits of these changes are:
1. Managing and updating dependencies is easier. One only needs to run
`deno outdated` at the root, instead of in each workspace.
2. The versions of dependencies across workspaces is kept consistent.
Closes#2788
We initialized new projects with `@preact/signals@2.x` but Fresh itself
was using `1.x`. There shall only ever be one version.
Kinda makes me wish Deno had some sort of `peerDependencies`.
Fixes https://github.com/denoland/fresh/issues/2962
due to resolves the `NotFound: No such file or directory` error in the
`www/utils/screenshot.ts` script, which was caused by improper file path
construction. This error prevented screenshots from being saved
correctly. close#2919
-- update --patch1
## Current Status
- Using npm:puppeteer for webpage screenshots
- npm lifecycle script warnings present
- deno-puppeteer is no longer maintained
- npm:puppeteer still has compatibility issues
## References
- [astral](https://github.com/lino-levan/astral): Browser automation
library designed for Deno
-
[deno-puppeteer#92](https://github.com/lucacasonato/deno-puppeteer/issues/92):
Recent discussion about deno-puppeteer
## Changes Made
1. Dependency Replacement
- Replaced npm:puppeteer with jsr:@astral/astral
- Removed npm lifecycle script warnings
2. Dependency Management Optimization
- Centralized all imports in deno.json
- Using jsr: and URL imports
## Testing Steps
1. Run screenshot command:
```bash
deno task screenshot https://google.com google
```
2. Check output:
- Verify no npm warnings
- Validate generated image files:
- ./www/static/showcase/google2x.jpg
- ./www/static/showcase/google1x.jpg
- Confirm image quality
3. Run complete test suite:
```bash
deno task ok
```
- Ensure all tests pass
4. Verify functionality:
- Screenshot feature works correctly
- Image processing (2x/1x) functions properly
---------
Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
- Added CSS vars for dark/light colors.
- Added dark/light theme toggle as Island
Fixes#2648
---------
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit adds some useful automatic instrumentation for when users
are using `--unstable-otel`:
- Fresh renames the span for incoming HTTP requests to `$METHOD $ROUTE`
and the `http.route` attribute is added.
- Fresh creates a span around FS route handlers, showing whether they
returned a response or data.
- Fresh creates a span around async components, showing how long they
took to execute.
- Fresh adds a span around preact rendering, showing how long rendering
takes.
- Fresh adds a span around static file serving, showing how long it took
and whether there were requests without a cache bust key.
We can improve this in the future with more telemetry, such as metrics.
Just adding in my Deno Fresh project. "WTF Is Congress Doing Now?" is a
non-partisan up-to-date source of bills introduced congress. Information
includes bill metadata, sponsors, links to affected codes and links to
PDF copies of bills.
Hi everyone
Fresh seemed like a really interesting framework, so I wanted to
contribute in some way.
So, i created this mini-game to showcase the capabilities of Deno and
Fresh.
Although it's currently just a beta but i'm considering increasing the
complexity of the game in the future.
I hope you'll give me the opportunity to set an example and maybe even
inspire someone to create something even bigger.
Thx!
Hello fresh team! 👋🍋
I was poking around the fresh canary version and thought I'd try it out
by updating my showcase app, Deno Paste. Super pleased with the canary
updates so far, by the way. Really looking forward to the 2.0 release!
Anyway, while making the update, I decided to rename the title of the
app from "Deno Paste" to "Denopaste" and make some UI changes. Included
here are the updates to the `showcase.json` and some new screenshots.
Thanks!
Hello!
Thank you to everyone who created this amazing tool. I started from
scratch with Fresh to rebuild this blog. The result is fantastic, it's
very fast and clean. So, I thought I should share it with more people.
Thanks!
Hello, Deno team!
I have created a service using Fresh and would like you to register with
showcase.
[Pile-Up](https://pile-up.deno.dev/)
Best regards.
Added `aria-hidden="true"` to all decorative icons and illustrations.
If there are any questions, suggestions or anything, please let me know
:)
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
Ran into an issue where we weren't responding with the correct status
code and passed response headers. This was a bit of a rabbit hole and it
was caused by us wrapping to more error handling middlewares than
necessary.