-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add app.tsx assets to page event in dev env #1423
Conversation
🦋 Changeset detectedLatest commit: 1a48c63 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Can't reproduce with With 0.3.10 app.css and dev-overlay/styles.css are present here.
I guess this is because of nksaraf/vinxi@04b3ff7 causing start's client/index.jsx to not be processed anymore. I lack insight here... may be intended by vinxi and should now be solved in start.
src directory (appRoot) is user configurable and jsx extension is also possible. Suggestions: Define global constant replacementssolid-start/packages/start/config/index.js Lines 135 to 139 in 2d75d5f
...(import.meta.env.DEV ? await clientManifest.inputs[import.meta.env.START_SOME_NAME]!.assets(): []), Throw it on the ssr router's vite config (this is maybe bad... not sure about vite build mode here)config("user", {
...userConfig,
start: {
someName: ""
} ...(import.meta.env.DEV ? await clientManifest.inputs[serverManifest.dev.server.config.start.someName]!.assets(): []), |
Yeah this suggestion makes sense. The compile time/build time can provide the necessary paths and the runtime can use that. |
Refer to this comment: solidjs/solid-start#1423 (comment)
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
During development
app.css
is only loaded in the browser via javascript, resulting in a flash of unstyled content.What is the new behavior?
app.tsx
is registered for asset collection in the pageEvent on the server. This wayapp.css
and other potential css assets ofapp.tsx
are added to the document head, during server side rendering.Open Question
I am not 100% happy with the inlined
src/app.tsx
, do we have a proper way to access the path toapp.tsx
?Other information
How it currently looks in a browser with disabled js:

How it should look:

owser with disabled js:
Credits
@nksaraf helped me to find the proper place to debug the issue 🙏.