Giter Site home page Giter Site logo

vikejs / vike-solid Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 2.0 470 KB

๐Ÿ”จ Solid integration for Vike

Home Page: https://vike.dev

License: MIT License

TypeScript 78.00% JavaScript 22.00%
full-stack node server-rendering solid solid-ssr solidjs ssr static-site-generator vite vite-plugin

vike-solid's People

Contributors

aurelienlourot avatar brillout avatar magne4000 avatar phonzammi avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

brillout

vike-solid's Issues

Updating lang from hooks (onBeforeRoute, onPrerenderStart, ...)

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:

  • Primarily attempts to retrieve the language setting using getHeadSetting("lang", pageContext).
  • If not available, it falls back to pageContext.lang.
  • Defaults to "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?

The 'vike-solid' library may need to update its package.json or typings

Description

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)

Name "Solide" may lead to confusion?

@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".

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update all non-major dependencies (bumpp, vite)

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
npm
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

  • Check this box to trigger a request for Renovate to run again on this repository

usePageContext doesn't update Provider that wraps LayoutDefault, but should it?

๐Ÿ‘‹๐Ÿผ 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:

  1. I added onBeforeRender which simply adds a string of random letters.
  2. createContext which should store this string.
  3. Context.Provider which is the first component in LayoutDefault.
  4. The actual useRandom hook that will output this string of random letters.
  5. I added 2 pages that have 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).
  6. Two more pages (page-with-provider) that have the top component of the Provider itself, in this case it works well, but adding a Provider for each page does not.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.