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

Move preact-render-to-string to preact/server #3480

Merged
merged 365 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
365 commits
Select commit Hold shift + click to select a range
4e558b0
3.6.0
developit Feb 14, 2017
c956861
When styles object is empty, don’t render style attribute
mtribes-sdk-bot Mar 30, 2017
e710325
Merge pull request #31 from mikestead/fix/empty-style-attribute
developit Mar 30, 2017
3d1d605
Fix and test for disabling stateful re-rendering during string render…
developit Apr 26, 2017
e9d7808
3.6.1
developit Apr 26, 2017
96c4ceb
Update to preact 8, add test & fix for null child issue
developit May 11, 2017
e238e24
3.6.2
developit May 11, 2017
c7dbf7f
Fix issue where multiline attribute values could trigger indentation …
developit May 22, 2017
b6db12d
3.6.3
developit May 22, 2017
80801f7
Fix jsx renderer double closing elements (#36)
marvinhagemeister Jun 8, 2017
5215613
New: add TypeScript definitions (#39)
niedzielski Sep 8, 2017
b56f338
Fix babel presets (fixes #35)
developit Sep 8, 2017
7560758
Correct & simplify component name detection (Fixes #44) (#45)
developit Sep 15, 2017
ac9bb79
Skip `true` values as Preact does (#48)
developit Sep 15, 2017
2437db4
Fix dangerouslySetInnerHTML in JSX mode (Fixes #42) (#46)
developit Sep 15, 2017
01eaa23
Fix {nodeName:undefined} rendering [object Object] (fixes #38) (#47)
developit Sep 15, 2017
f71517a
3.7.0
developit Oct 12, 2017
9341ef5
ignore package-lock
developit Aug 1, 2018
61ba332
cut the library size in half
developit Aug 1, 2018
d70dda7
Patch attribute name vulnerability.
developit Aug 1, 2018
3ae5040
3.7.1
developit Aug 1, 2018
c75152e
Also sanitize nodeName.
developit Aug 1, 2018
0e62519
Add tests for element name protection
developit Aug 1, 2018
55b620f
3.7.2
developit Aug 1, 2018
474df96
Merge branch 'master' into cut-size-in-half
developit Aug 1, 2018
4df51ba
Slash size by around 50%. Removes support for object class={{}} values.
developit Aug 1, 2018
ed35038
shrink void element handling
developit Aug 1, 2018
3811bc5
Drop some more bytes. Switch to microbundle and eslint-config-developit.
developit Aug 1, 2018
06e16de
Lint fixes.
developit Aug 2, 2018
5efd6d4
3.8.0
developit Aug 2, 2018
5a793c0
Re-add string coersion to fix #59 (#61)
developit Aug 16, 2018
8048193
[feature] replace `undefined` prop values with defaultProps (#60)
ftes Aug 16, 2018
3050415
Include type definition in the npm package. Fixes #51.
developit Aug 16, 2018
d52b3ee
3.8.1
developit Aug 16, 2018
b3f442b
Remove Object.keys ponyfill, since this library was never intended to…
developit Aug 16, 2018
59ef88a
Conditionally compile out support for `{ pretty: true }` from the def…
developit Aug 16, 2018
606741c
Update tests for whitespace change
developit Aug 16, 2018
96bb4c9
4.0.0
developit Aug 16, 2018
5ef665e
Externalize pretty-format dependency. It is no longer bundled into pr…
developit Aug 17, 2018
450df79
Hack: run microbundle twice to ensure inlined pretty-format is transp…
developit Aug 17, 2018
ae8818d
4.0.1
developit Aug 17, 2018
540f1e8
Remove old rollup config
developit Aug 17, 2018
506af23
Adds support for `getDerivedStateFromProps` (#63)
johnhaitas Aug 17, 2018
0afc683
4.1.0
developit Aug 17, 2018
90da414
[WIP] Update for Preact 10 (#70)
developit Mar 7, 2019
1cdbec8
5.0.0: move to preact 10
developit Mar 7, 2019
f98b0c2
remove commented out code
developit Mar 7, 2019
0bc7bad
Run tests on latest node LTS 10.x (#75)
marvinhagemeister Mar 12, 2019
91b7133
Add basic support for hooks
marvinhagemeister Mar 12, 2019
4ca75ec
Fix wrong value for useContext
marvinhagemeister Mar 12, 2019
ccac730
preserve component<->vnode linkage properties when instantiating clas…
developit Mar 14, 2019
eeb8543
5.0.01
developit Mar 14, 2019
a63af32
Resolve crash when using hooks (#77)
vaneenige Mar 15, 2019
22369fd
Add support for Fragments (#79)
marvinhagemeister Mar 20, 2019
27b9310
Release 5.0.2
marvinhagemeister Mar 25, 2019
8ed695f
Fix select value not marking option as selected
marvinhagemeister Apr 10, 2019
9e0c889
Pass select value as arg instead of via context
marvinhagemeister Apr 11, 2019
1a849c1
Fix select value not passed through components
marvinhagemeister Apr 11, 2019
ad4cf37
Use loose equality check for select value
marvinhagemeister Apr 11, 2019
c944938
Merge pull request #85 from developit/fix_select_value
marvinhagemeister Apr 11, 2019
646c9b0
Allow preact x beta as peer dep (#87)
sventschui Apr 30, 2019
df3f395
Support createContext of preact x
May 1, 2019
d6c5257
Support falsy context value
May 1, 2019
273b2a5
Add test for nested Provider
May 2, 2019
d6d3041
Support createContext of preact x (#88)
marvinhagemeister May 3, 2019
0dff57c
Switch from mjs -> js (#89)
marvinhagemeister May 6, 2019
31c7685
Release 5.0.3 (#91)
marvinhagemeister May 7, 2019
2929c9d
Wrap arrays in Fragment to allow proper rendering (#96)
toraora Jun 20, 2019
80aa4c5
Fix options.render is private in core (#97)
marvinhagemeister Jun 22, 2019
b62abc4
Release 5.0.4 (#98)
marvinhagemeister Jun 22, 2019
55eeee7
[TS] Make options optional (#101)
andrewiggins Jul 2, 2019
958d38b
Added type definition tests
9renpoto Mar 31, 2019
a14cd52
fix(tsconfig) use react jsx
9renpoto Mar 31, 2019
31d7121
fixed jsxFactory
9renpoto Mar 31, 2019
dc329af
fix(tsconfig) remove unused options
9renpoto Apr 13, 2019
83cfe0a
Merge pull request #83 from 9renpoto/fix/types
marvinhagemeister Jul 6, 2019
9d56030
Fix pretty option doing nothing
marvinhagemeister Jul 11, 2019
8142c35
Merge pull request #106 from preactjs/pretty_render
marvinhagemeister Jul 11, 2019
ea05501
Release 5.0.5 (#107)
marvinhagemeister Jul 11, 2019
aff8899
Fix mocha compilers deprecation warning
marvinhagemeister Jul 13, 2019
676bdc2
Fix eslint warning
marvinhagemeister Jul 13, 2019
e87b1ba
Fix build tools deprecation warnings (#110)
marvinhagemeister Jul 13, 2019
b832c20
Join adjacent text nodes (#109)
marvinhagemeister Jul 15, 2019
78c3b68
Release 5.0.6
marvinhagemeister Jul 15, 2019
54cd854
(chore) - streamline non-dimensional params with preact X (#111)
JoviDeCroock Jul 20, 2019
7d1ded0
Initialize component state as an empty object (#119)
marvinhagemeister Oct 13, 2019
e2d7092
Indent Fragment's children when pretty printing. (#117)
utkarshkukreti Oct 13, 2019
70a070d
Release 5.0.7 (#120)
marvinhagemeister Oct 13, 2019
e7c0a96
Fix missing context with contextType for class components (#122)
w4zZz4p Oct 18, 2019
279bae1
Release 5.1.0
marvinhagemeister Oct 20, 2019
eb97751
fix: correct type sig for "pretty" option (#123)
dbushong Oct 30, 2019
98b96f8
Fix effects breaking in SSR due to missing _renderCallbacks
developit Nov 1, 2019
b46ee9a
Upgrade to Preact 10.0.4
marvinhagemeister Nov 1, 2019
34f26cf
Fix renderer crashing with effecful hooks
marvinhagemeister Nov 1, 2019
af37b2b
Fix effects breaking in SSR due to missing _renderCallbacks (#124)
marvinhagemeister Nov 1, 2019
8142e59
Release 5.1.1
marvinhagemeister Nov 1, 2019
e342bf4
Fix exception when invoking setState in cWM
marvinhagemeister Dec 6, 2019
3c33f68
Fix state not being flushed after cWM
marvinhagemeister Dec 6, 2019
f2077a1
Merge pull request #127 from preactjs/fix-setState
marvinhagemeister Dec 6, 2019
0087760
Release 5.1.2
marvinhagemeister Dec 6, 2019
f9411ae
CI: Always run without sudo
marvinhagemeister Dec 6, 2019
e5024fe
Disable email notifications
marvinhagemeister Dec 6, 2019
c65d80b
Merge pull request #128 from preactjs/travis
marvinhagemeister Dec 6, 2019
6a31ebd
Always throw errors, not strings (#129)
sventschui Dec 7, 2019
2e41382
Fix support for default context value (#130)
loklaan Dec 19, 2019
5d47fc3
Release 5.1.3
marvinhagemeister Dec 19, 2019
67f3812
Add TypeScript definitions for JSX renderer
squidfunk Jan 22, 2020
fb1aee1
Move TypeScript definition to root
squidfunk Jan 22, 2020
2dfdd37
Add TypeScript definitions for JSX renderer (#131)
marvinhagemeister Jan 22, 2020
0ffb7a7
add package-lock for pika
JoviDeCroock Jan 22, 2020
a5ce60c
remove postinstall and move to devDep for it
JoviDeCroock Jan 22, 2020
a68b538
move to devDeps
JoviDeCroock Jan 22, 2020
dc2947b
remove npm-merge-driver dep
JoviDeCroock Jan 22, 2020
7b449ff
Merge pull request #132 from preactjs/add-pkg-lock
marvinhagemeister Jan 22, 2020
bf6e32d
Release 5.1.4
marvinhagemeister Jan 23, 2020
f74b419
Update Travis CI org name to `preactjs` [skip ci] (#138)
mbrukman Feb 20, 2020
0ee2d7d
Add setState()/forceUpdate() no-op methods to prevent errors
developit Apr 1, 2020
2760f9e
Remove unnecessary line
38elements Apr 1, 2020
d095050
Merge pull request #139 from preactjs/prevent-state-update-errors
marvinhagemeister Apr 6, 2020
4cf0edd
Release 5.1.5 (#141)
marvinhagemeister Apr 7, 2020
6da9bd6
Preact>=10 peer dep
developit Apr 8, 2020
16fee53
Merge pull request #142 from preactjs/preact-10-peer
marvinhagemeister Apr 8, 2020
4a1dfdf
Add renderToString to src/index.d.ts
38elements Apr 8, 2020
32ddc1e
Merge pull request #140 from 38elements/renderToString
marvinhagemeister Apr 9, 2020
d967bbe
5.1.6
developit Apr 10, 2020
9b98794
Add submodule exports (#134)
marvinhagemeister May 4, 2020
155d7d4
Release 5.1.7
marvinhagemeister May 4, 2020
42bcefa
Merge pull request #145 from preactjs/release-5.1.7
marvinhagemeister May 4, 2020
6f2ae62
convert "htmlFor" to "for"
whilelucky May 7, 2020
68af261
Merge pull request #147 from lakshyaranganath/fix/htmlfor
marvinhagemeister May 7, 2020
6014568
Release 5.1.8
marvinhagemeister May 8, 2020
95e3cf3
Merge pull request #149 from preactjs/release-5.1.8
marvinhagemeister May 8, 2020
1b3bf64
don't send the babel plugin attributes down to the client (#152)
JoviDeCroock May 29, 2020
67c42e4
Fix accidental camelCasing of CSS Variables (#153)
developit May 29, 2020
7223090
Release 5.1.9
JoviDeCroock May 29, 2020
6e28cca
Keep state changes during getDerivedStateFromProps
sventschui Jun 2, 2020
3e95a91
Add voidElements config option
sventschui Jun 2, 2020
8afb3c3
Export renderToString as renderToStaticMarkup
Jan 29, 2020
fa56f44
Add test for renderToStaticMarkup
sventschui Jun 2, 2020
4a9760f
Stringify boolean aria-* attributes
sventschui Jun 2, 2020
ab13881
Merge pull request #158 from preactjs/bugfix/aria-boolean-values
marvinhagemeister Jun 2, 2020
f2bcc63
Merge pull request #157 from preactjs/feature/render-to-static-markup
marvinhagemeister Jun 3, 2020
605c083
Merge pull request #155 from preactjs/bugfix/get-derived-state-from-p…
marvinhagemeister Jun 3, 2020
f4f2770
Make voidElements option additive
sventschui Jun 3, 2020
3852032
Merge pull request #156 from preactjs/feature/custom-void-elements
sventschui Jun 3, 2020
7ae96de
Fix SSR for <textarea value>
developit Jul 10, 2020
bbf3324
Add tests for textarea value SSR
developit Jul 10, 2020
c173408
Don't serialize empty textarea value
developit Jul 10, 2020
9123beb
optimization: use existing loop value for props.children
developit Jul 10, 2020
53d74cd
Account for falsey non-null children
developit Jul 10, 2020
f10647a
Merge pull request #161 from preactjs/textarea-value-ssr
marvinhagemeister Jul 11, 2020
7cc439c
Release 5.1.10
marvinhagemeister Jul 14, 2020
7851eaf
Merge pull request #162 from preactjs/release-5.1.10
marvinhagemeister Jul 14, 2020
0f67435
Omit defaultValue attribute
sventschui Jul 15, 2020
6ec06fc
Merge pull request #163 from preactjs/omit-default-value
marvinhagemeister Jul 15, 2020
4daf43d
[bugfix] do not close void elements with a closing tag
gpoitch Oct 8, 2020
7481e8d
Merge pull request #167 from gpoitch/gp/void-close-bugfix
marvinhagemeister Oct 15, 2020
543ab6e
Optimize HTML entity encoding
developit Oct 15, 2020
f93ce19
Update package.json
developit Oct 15, 2020
faa4381
Update util.js
developit Oct 15, 2020
2030944
Update package.json
developit Oct 15, 2020
28a0953
Update util.js
developit Oct 15, 2020
5ed72cf
Merge pull request #170 from preactjs/opt-entity-encoding
marvinhagemeister Oct 16, 2020
ad5fa99
Add prettier setup
marvinhagemeister Oct 15, 2020
a7bacc6
Apply prettier
marvinhagemeister Oct 16, 2020
e18fc97
Merge pull request #168 from preactjs/prettier
marvinhagemeister Oct 16, 2020
a71a5bf
Invoke _diff hook
sventschui Oct 21, 2020
8890f6b
Add tests
sventschui Oct 21, 2020
ecdcff9
Merge pull request #172 from preactjs/bugfix/invoke-diff-hook
marvinhagemeister Oct 21, 2020
365d377
5.1.11
marvinhagemeister Oct 21, 2020
4042de0
Prefer ESM over CJS in package exports
developit Oct 24, 2020
f99774c
Merge pull request #173 from preactjs/package-export-order
marvinhagemeister Oct 24, 2020
2706bdb
prevent to self-close if dangerouslySetInnerHTML set (#174)
Nov 1, 2020
0cc0e2a
Upgrade preact dependency
marvinhagemeister Nov 14, 2020
36d21e8
Fix options.diffed and options._commit not called
marvinhagemeister Nov 14, 2020
b8e3075
Merge pull request #175 from preactjs/option-hooks
marvinhagemeister Nov 14, 2020
0f17875
Release 5.1.12
marvinhagemeister Nov 14, 2020
514b36a
Upgrade deps - pass 1
andrewiggins Dec 29, 2020
736e529
Upgrade deps 2
andrewiggins Dec 29, 2020
046edfc
Upgrade eslint
andrewiggins Dec 29, 2020
2e9e035
Ignore test declartion file
andrewiggins Dec 29, 2020
b012015
Remove npm-merge-driver-install
andrewiggins Dec 29, 2020
2e2720f
Run npm dedupe
andrewiggins Dec 29, 2020
19e3d27
Merge pull request #177 from preactjs/upgrade-deps
marvinhagemeister Dec 29, 2020
fe219e4
Replace Travis CI with Github Actions
marvinhagemeister Feb 12, 2021
f8ece32
Merge pull request #179 from preactjs/github-ci
marvinhagemeister Feb 12, 2021
132a794
Revert package-lock.json changes caused by npm7
marvinhagemeister Feb 12, 2021
aae5ef3
Perf: Improve HTML entity escaping
marvinhagemeister Mar 7, 2021
ffda361
Merge pull request #181 from preactjs/escape-perf
marvinhagemeister Mar 7, 2021
bb9e9fd
5.1.13
marvinhagemeister Mar 7, 2021
b1e6312
Revert back to old commonjs behaviour.
marvinhagemeister Mar 8, 2021
a7a7544
Merge pull request #183 from preactjs/commonjs-regression
marvinhagemeister Mar 8, 2021
a06fd6c
5.1.14
marvinhagemeister Mar 8, 2021
8d14ca0
Add simple benchmarks
marvinhagemeister Mar 10, 2021
e052981
Merge pull request #169 from preactjs/benchmarks
marvinhagemeister Mar 10, 2021
1bc5d56
Memoize entity encoding
marvinhagemeister Mar 10, 2021
f76a75f
Hoist out regex creation
marvinhagemeister Mar 10, 2021
aa0bf6d
Merge pull request #184 from preactjs/encode-perf
marvinhagemeister Mar 10, 2021
833bcc8
5.1.15
marvinhagemeister Mar 10, 2021
bc0faa3
Fix empty CSS value not ignored in inline styles
marvinhagemeister Mar 10, 2021
d5bc1e3
Merge pull request #186 from preactjs/empty-css-value
marvinhagemeister Mar 10, 2021
426b806
Revert "Memoize entity encoding"
marvinhagemeister Mar 11, 2021
336c81c
Merge pull request #187 from preactjs/revert-entity-memo
marvinhagemeister Mar 11, 2021
f14eb53
5.1.16
marvinhagemeister Mar 11, 2021
17a8276
Update test setup (#188)
marvinhagemeister Mar 15, 2021
f9e915e
Benchmark runner updates (#189)
developit Mar 19, 2021
b468445
Performance improvements!
developit Mar 20, 2021
9b230b2
Reintroduce Fragment optimization
developit Mar 25, 2021
845886c
Merge pull request #192 from preactjs/performance-improvements
marvinhagemeister Mar 25, 2021
721bf49
Add encodeEntities fast path for simple strings
jviide Mar 27, 2021
1180c6d
Merge pull request #194 from jviide/turbo-entities
marvinhagemeister Mar 27, 2021
fc535ab
Improve performance by skipping dirty checks for effects alltogether
JoviDeCroock Mar 24, 2021
7ca573b
Inline options._skipEffects
marvinhagemeister Mar 28, 2021
21cff70
Merge pull request #193 from preactjs/JoviDeCroock-patch-1
marvinhagemeister Mar 28, 2021
f47a05f
5.1.17
marvinhagemeister Mar 28, 2021
4549d5d
Bugfix: Prevent infinite render queue array growth (#195)
developit Mar 30, 2021
f15a0e8
5.1.18
developit Mar 30, 2021
ab0e807
Fix preact being accidentally inlined for jsx renderer
marvinhagemeister Apr 5, 2021
4bbee99
Merge pull request #196 from preactjs/jsx-inlined
marvinhagemeister Apr 5, 2021
b7ff8c1
5.1.19
marvinhagemeister Apr 5, 2021
221bd15
Fix: serialize defaultValue as value attribute (#203)
developit Nov 10, 2021
a1f9f4b
introduce changesets
JoviDeCroock Nov 12, 2021
72baec8
update changelog way to be consistent with prefresh
JoviDeCroock Nov 12, 2021
3f7eda2
update node
JoviDeCroock Nov 12, 2021
6b3e590
Merge pull request #204 from preactjs/changesets
marvinhagemeister Nov 12, 2021
da84009
apply changesets retroactively (#205)
JoviDeCroock Nov 12, 2021
ae5aaaa
add missing dep
JoviDeCroock Nov 12, 2021
7fab233
fix: On empty className w/ compat, class attr will no longer be dupli…
rschristian Dec 15, 2021
788d5ac
test: Adding compat test suite
rschristian Dec 15, 2021
637b863
docs: Adding changeset
rschristian Dec 15, 2021
582e16d
Merge pull request #209 from preactjs/fix/compat-empty-classname
marvinhagemeister Dec 16, 2021
62193ee
Update Travis CI badge to GitHub Actions [skip ci]
mbrukman Jan 30, 2022
25013de
Merge pull request #211 from mbrukman/update-travis-ci-badge-to-githu…
rschristian Feb 4, 2022
8292ac6
Version Packages (#206)
github-actions[bot] Feb 21, 2022
1279de3
Merge preact-render-to-string into core under preact/server
marvinhagemeister Mar 15, 2022
21869f0
Remove redundant config files
marvinhagemeister Mar 15, 2022
b7cc569
Add preact/server build pipeline
marvinhagemeister Mar 15, 2022
68ac5bf
Integrate preact/server tests into repo structure
marvinhagemeister Mar 15, 2022
9d3ea5b
Fix server test errors during watch
marvinhagemeister Mar 15, 2022
39bf4f2
Run server tests in CI
marvinhagemeister Mar 15, 2022
698c90d
Merge branch 'main' into render-to-string
marvinhagemeister Mar 15, 2022
3bb6f6e
Add changeset
marvinhagemeister Mar 15, 2022
13acf39
Fix skipped server tests
marvinhagemeister Mar 15, 2022
2375337
Use consistent JSDoc formatting
marvinhagemeister Mar 15, 2022
4824d58
Update compat/server entries
marvinhagemeister Mar 15, 2022
9c20a01
Merge jsx + normal server entry into one
marvinhagemeister Mar 15, 2022
971a366
Remove old export workaround
marvinhagemeister Mar 15, 2022
81b5dcb
Fix linting error
marvinhagemeister Mar 16, 2022
bfa88bd
Mark preact/server as minor in Changeset
marvinhagemeister Mar 16, 2022
20a668a
Remove badges from server README + update name
marvinhagemeister Mar 16, 2022
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
5 changes: 5 additions & 0 deletions .changeset/lovely-islands-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'preact': minor
---

Add `preact/server` entry to the core package
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ preact-*.tgz
preact.tgz
jsx-csstype.d.ts
.cache
src/preact-render-to-string-tests.d.ts
benchmarks/.v8.modern.js
86 changes: 63 additions & 23 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,78 @@ module.exports = function(api) {
rename[name] = mangle.props.props[prop];
}

return {
presets: [
const presets = [];
const plugins = [];

if (process.env.SERVER === 'true') {
presets.push([
'@babel/preset-env',
{
loose: true,
exclude: ['@babel/plugin-transform-typeof-symbol'],
targets: {
node: true
}
}
]);

plugins.push(
[
'@babel/plugin-transform-react-jsx',
{ runtime: 'automatic', importSource: 'preact' }
],
['babel-plugin-transform-rename-properties', { rename }],
[
'@babel/preset-env',
'module-resolver',
{
loose: true,
// Don't transform modules when using esbuild
modules: noModules ? false : 'auto',
exclude: ['@babel/plugin-transform-typeof-symbol'],
targets: {
browsers: [
'Firefox>=60',
'chrome>=61',
'and_chr>=61',
'Safari>=10.1',
'iOS>=10.3',
'edge>=16',
'opera>=48',
'op_mob>=48',
'Samsung>=8.2',
'not dead'
]
root: ['.'],
alias: {
'preact/jsx-dev-runtime': './jsx-runtime/src/index.js',
'preact/jsx-runtime': './jsx-runtime/src/index.js',
'preact/test-utils': './test-utils/src/index.js',
'preact/hooks': './hooks/src/index.js',
'preact/compat': './compat/src/index.js',
preact: './src/index.js'
}
}
]
],
plugins: [
);
} else {
presets.push([
'@babel/preset-env',
{
loose: true,
// Don't transform modules when using esbuild
modules: noModules ? false : 'auto',
exclude: ['@babel/plugin-transform-typeof-symbol'],
targets: {
browsers: [
'Firefox>=60',
'chrome>=61',
'and_chr>=61',
'Safari>=10.1',
'iOS>=10.3',
'edge>=16',
'opera>=48',
'op_mob>=48',
'Samsung>=8.2',
'not dead'
]
}
}
]);

plugins.push(
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-react-jsx',
'babel-plugin-transform-async-to-promises',
['babel-plugin-transform-rename-properties', { rename }]
],
);
}

return {
presets,
plugins,
include: ['**/src/**/*.js', '**/test/**/*.js'],
overrides: [
{
Expand Down
13 changes: 2 additions & 11 deletions compat/server.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
/* eslint-disable */
var renderToString;
try {
const mod = require('preact-render-to-string');
renderToString = mod.default || mod.renderToString || mod;
} catch (e) {
throw Error(
'renderToString() error: missing "preact-render-to-string" dependency.'
);
}
const { renderToString } = require('preact/server');

module.exports = {
renderToString: renderToString,
renderToString,
renderToStaticMarkup: renderToString
};
2 changes: 1 addition & 1 deletion compat/server.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
renderToString,
renderToString as renderToStaticMarkup
} from 'preact-render-to-string';
} from 'preact/server';
Loading