Skip to content
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

update dom-expressions, solid-js/web, solid-js/html, solid-js/store to make the exports isomorphic #2269

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"babel-plugin-jsx-dom-expressions": "^0.38.5",
"coveralls": "^3.1.1",
"csstype": "^3.1.0",
"dom-expressions": "0.38.5",
"dom-expressions": "https://gitpkg.vercel.app/trusktr/dom-expressions/packages/dom-expressions?update-exports",
Copy link
Contributor Author

@trusktr trusktr Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick way to install a package from any github repo, including sub-folders, useful for testing.

See https://gitpkg.vercel.app

  • update dom-expressions version before merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests are passing. Anything I may not have thought of that needs testing?

"hyper-dom-expressions": "0.38.5",
"jsdom": "^21.1.1",
"lit-dom-expressions": "0.38.5",
Expand Down
3 changes: 3 additions & 0 deletions packages/solid/web/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ export {
Match,
Index,
ErrorBoundary,
// This overrides mergeProps from dom-expressions/src/server.js
mergeProps
} from "solid-js";

export const isServer: boolean = true;
export const isDev: boolean = false;

// Types for these come from dom-expressions/src/server.d.ts
// These override the functions from dom-expressions that throw on the serverside.
export function render() {}
export function hydrate() {}
export function insert() {}
Comment on lines +22 to 26
Copy link
Contributor Author

@trusktr trusktr Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions override the error-throwing functions that are now exported from dom-expressions, making this particular set of functions be no-ops instead of throwing errors.

All the other newly-added functions in dom-expressions (see here) continue to throw errors if they are not overriden here, which is non-breaking.

Removing the set of functions here could be breaking if anyone is already depending on them being no-ops, but the new functions added to dom-expressions/src/server.js never existed there or here for server code, so the introduction of those new error-throwing functions cannot be breaking because no one used them before.

If desired, those additional functions in dom-expressions can be overriden here to make them no-ops instead of error-throwing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me and honestly I think I'm ok even making them throw if called. I don't see any reason why these should ever be called on the server with a server build.

Expand Down
Loading