vikejs / vike-solid Goto Github PK
View Code? Open in Web Editor NEW๐จ Solid integration for Vike
Home Page: https://vike.dev
License: MIT License
๐จ Solid integration for Vike
Home Page: https://vike.dev
License: MIT License
In previous versions, thanks to the getLang()
function, I could use the onBeforeRoute
hook to dynamically set the application's language with pageContext.lang
. This approach allowed for flexible language management based on various conditions. However, after a recent update, it seems that getLang()
has been replaced by getHeadSetting()
. This new function, as it currently stands, solely fetches the language information from pageContext.configEntries
, limiting the dynamic assignment of languages.
Given this change, I propose an enhancement to how language settings are retrieved and set within the onRenderClient
and onRenderHtml
hooks. Specifically, I suggest the following approach for determining the language setting:
const lang = getHeadSetting("lang", pageContext) || pageContext.lang || "en";
This code snippet aims to provide a fallback mechanism that:
getHeadSetting("lang", pageContext)
.pageContext.lang
."en"
if neither of the above yields a result.This method would not only restore the flexibility previously offered by getLang()
but also align with the current structure, ensuring backward compatibility and enhancing functionality.
Could the maintainers consider this proposal for implementation or provide guidance on how to best handle dynamic language settings under the new system?
When importing ClienOnly
from vike-solid/ClienOnly
, I receive this typescript error-
Could not find a declaration file for module 'vike-solid/ClientOnly'. '/node_modules/vike-solid/dist/ClientOnly.js' implicitly has an 'any' type.
There are types at '/node_modules/vike-solid/dist/components/ClientOnly.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vike-solid' library may need to update its package.json or typings. ts(7016)
@cyco130 thinks that "Solide" could be confusing, e.g. someone may thinks it's a typo.
Thoughts?
At the beginning Solide will be confusing, but in the long term the confusion will go away. It could be worth to "take the bullet".
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
bumpp
, vite
).github/workflows/build.yml
actions/checkout v4
package.json
vike-solid/package.json
vite-plugin-solid ^2.10.1
@babel/core ^7.24.0
@babel/preset-env ^7.24.0
@babel/preset-typescript ^7.23.3
@rollup/plugin-babel ^6.0.4
@rollup/plugin-node-resolve ^15.2.3
babel-preset-solid ^1.8.15
bumpp ^9.3.1
rollup ^4.12.0
rollup-plugin-dts ^6.1.0
solid-js ^1.8.15
tslib ^2.6.2
typescript ^5.3.3
vike ^0.4.165
vite ^5.1.4
Since vike-react
now has a <ClientOnly>
component, it would be great to align vike-solid
to also have such component.
Right now, enabling pre-rendering has to be done in the vike-solid config in vite.config.ts
-- is this intended behavior? if so, it should be documented.
solid({
vps: {
prerender: true,
},
}),
The user may change the lang
setting per-page based on i18n. On client-side navigation, onRenderClient should adapt lang
in the existing DOM.
Same as vikejs/vike-react#59 and vikejs/vike-vue#55
๐๐ผ Hello! First of all, thank you for a great plugin.
I'm not a big solid.js guy, so maybe I'm just missing something.
Reproduction: codesandbox
Description of the reproduction:
onBeforeRender
which simply adds a string of random letters.LayoutDefault
.useRandom
hook that will output this string of random letters.useRandom
and usePageContext
. useRandom always returns the string that was added at the first render. usePageContext
returns the current data (in case it is called not in Layout
but in Page
).Actually, in a real project, I use I18n instead of the stupid random string of letters. Some pages have their own namespaces that need to be loaded for each page separately to optimise response size.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.