closes https://github.com/denoland/fresh/issues/2319
The issue is because `imports.ts` wasn't changed before releasing. I
thought I would go through and bump some other versions as well. This
handles everything except the esbuild stuff and `tests/`.
Of particular note is the change to
`tests/fixture_plugin/routes/test.tsx`. Note how I do this:
```diff
- async GET(_req, ctx: HandlerContext<unknown, { test: string }>) {
+ async GET(_req, ctx: FreshContext<{ test: string }, unknown>) {
```
I find it strange and confusing that the order of the type parameters
has "changed". This makes it impossible to do a simple search and
replace, because people now have to change order as well.
Most of the types have been declared as `<T, S>`, i.e. data before
state:
* `PageProps<T = any, S = Record<string, unknown>>`
* `RouteContext<T = any, S = Record<string, unknown>>`
* `Handler<T = any, State = Record<string, unknown>>`
* `Handlers<T = any, State = Record<string, unknown>> `
* `AsyncRoute<T = any, S = Record<string, unknown>>`
* `PageComponent<T = any, S = Record<string, unknown>> `
* `AsyncLayout<T = any, S = Record<string, unknown>>`
And then `FreshContext` comes around like
```
export interface FreshContext<
State = Record<string, unknown>,
// deno-lint-ignore no-explicit-any
Data = any,
NotFoundData = Data,
>
```
and switches it all up.
Not a huge issue, but just something to be aware of that others might
report.
One can now inline the `imports` and `scopes` from the import map directly into deno.json.
For new projects, `import_map.json` is not generated anymore.
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit adds support for JSX automatic mode instead of the default
mode that requires the presence of the JSX pragma in each file.
This commit also adds the config file to the `fresh.gen.ts` manifest,
which is used to determine if the client emit should use automatic mode.
The minimum Deno version has also been bumped to 1.25.0.
This commit adds initial support for fresh "plugins". These are bundles
of functionality that can be added to a fresh plugin through a simple
addition in the `main.ts` file.
Right now plugins are only able to hook into the render steps. This
means that they can inject styling and scripts. They can not yet hook
into routing.
Things that I think should be possible now:
- styling integrations for twind, unocss, and probably a few other tools
Things that are not possible yet:
- google analytics middleware
- database connectors
- CMS connectors
The routing additions to plugins can be added in a follow-up though.