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
[core/ssr] Add Node builds that don't explode #3156
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
463f5c3
Add ability to create node build in rollup config
aomarks 951d379
Add node build to lit-html
aomarks a2e074a
Add node build to reactive-element
aomarks 9515303
Add node test to lit-element. Does not need a node build
aomarks e759658
Add node test to lit. Does not need a node build
aomarks 6d6ec28
Changeset
aomarks 7df247b
Merge branch 'main' into explode
aomarks 925b489
Comment about globalThis vs window in IE11
aomarks f7e8dc4
Merge branch 'main' into explode
aomarks 9b05f30
Address PR comments
aomarks 266af90
Temporarily shim HTMLElement in a sneakier way
aomarks 56c0537
Merge branch 'main' into explode
aomarks 19a8df3
Update version string replacer script
aomarks 8367869
Merge branch 'main' into explode
aomarks File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'lit': minor | ||
'lit-html': minor | ||
'@lit/reactive-element': minor | ||
--- | ||
|
||
Lit and its underlying libraries can now be imported directly from Node without crashing, without the need to load the @lit-labs/ssr dom-shim library. Note that actually rendering from a Node context still requires the @lit-labs/ssr dom-shim, and the appropriate integration between @lit-labs/ssr and your framework/tool. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
// This file will be loaded by Node from the node:test script to verify that all | ||
// exports of this package can be imported without crashing in Node. | ||
|
||
import 'lit-element'; | ||
import 'lit-element/experimental-hydrate-support.js'; | ||
import 'lit-element/private-ssr-support.js'; | ||
import 'lit-element/decorators.js'; | ||
import 'lit-element/decorators/custom-element.js'; | ||
import 'lit-element/decorators/event-options.js'; | ||
import 'lit-element/decorators/state.js'; | ||
import 'lit-element/decorators/property.js'; | ||
import 'lit-element/decorators/query.js'; | ||
import 'lit-element/decorators/query-all.js'; | ||
import 'lit-element/decorators/query-assigned-elements.js'; | ||
import 'lit-element/decorators/query-assigned-nodes.js'; | ||
import 'lit-element/decorators/query-async.js'; | ||
|
||
import {LitElement, html} from 'lit-element'; | ||
import {customElement} from 'lit-element/decorators.js'; | ||
|
||
@customElement('my-element') | ||
export class MyElement extends LitElement { | ||
override render() { | ||
return html`Hello World`; | ||
} | ||
} | ||
|
||
export class MyOtherElement extends LitElement { | ||
override render() { | ||
return html`Hello World`; | ||
} | ||
} | ||
customElements.define('my-other-element', MyOtherElement); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/development/ | ||
/node/ | ||
/version-stability-build/ | ||
/directives/ | ||
/node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense to include a version that doesn't use the decorator as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done