This commit adds support for an advanced (de)serializer that is used
for page state (island props and plugin state). This new serializer
supports maintaining references (thus supporting circular objects,
and multi-referenced objects).
This is a pre-requisite for allowing to pass signals, JSX, Uint8Arrays,
Date, and many other "advanced" values.
We now add a default HEAD handler to the server, rather than special
casing HEAD requests elsewhere. Static files now get their own optimized
HEAD handler that does not read the file contents.
This could happen if the runtime/utils.ts coe was loaded
prior to server/constants.ts, because they had some shared state on
`globalThis`.
I have mitigated this by not relying on global state anymore.
Fixes#1191
---------
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Fixes#1015
This scenario can happen when a user has a proxy sitting in front of
Fresh, that does TLS termination, while Fresh is running on plain text
HTTP.
---------
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
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.
This commit fixes layered middleware not being invoked for the the index
page of the layer.
For example: routes/api/_middleware.ts was not being invoked for /api,
only /api/foobar
This updates the asset caching to use a cache busting query string,
rather than a totally separate path. This makes it safer to apply
caching automatically to things like `<img>` tags, as the path does not
change anymore.
This commit adds support for suspending during JIT SSR rendering.
Additionally this PR adds `useData` support. This hook is triggered
during JIT render and can be used to fetch data. This data is sent to
the client and returned there from calls to useData too.