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

convert DOM creation/manipuation code to concise Solid JSX #1716

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 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 .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x]
node-version: [16.x, 17.x]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x]
node-version: [16.x, 17.x]
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']

steps:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /app
COPY . .
RUN rm package-lock.json
RUN npm install
RUN npx playwright install
RUN npx playwright install
RUN npm run build
ENTRYPOINT ["npm", "run"]
CMD ["test"]
CMD ["test"]
10 changes: 2 additions & 8 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
['babel-preset-solid', { generate: 'dom', hydratable: true }],
['@babel/preset-env', { targets: { node: 'current' } }],
],
};
28 changes: 15 additions & 13 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const rollup = require('rollup')
const buble = require('rollup-plugin-buble')
const commonjs = require('rollup-plugin-commonjs')
const nodeResolve = require('rollup-plugin-node-resolve')
const { uglify } = require('rollup-plugin-uglify')
const replace = require('rollup-plugin-replace')
const babel = require('@rollup/plugin-babel').default
const commonjs = require('@rollup/plugin-commonjs')
const nodeResolve = require('@rollup/plugin-node-resolve').default
const { terser: uglify } = require('rollup-plugin-terser')
const replace = require('@rollup/plugin-replace')
const isProd = process.env.NODE_ENV === 'production'
const version = process.env.VERSION || require('../package.json').version
const chokidar = require('chokidar')
Expand All @@ -22,10 +22,10 @@ async function build(opts) {
.rollup({
input: opts.input,
plugins: (opts.plugins || []).concat([
buble({
transforms: {
dangerousForOf: true
}}),
babel({
babelHelpers: "bundled",
presets: ['babel-preset-solid']
}),
commonjs(),
nodeResolve(),
replace({
Expand All @@ -49,10 +49,12 @@ async function build(opts) {

console.log(dest)
return bundle.write({
format: 'iife',
output: opts.globalName ? {name: opts.globalName} : {},
file: dest,
strict: false
output: {
format: 'iife',
name: opts.globalName,
file: dest,
strict: false
},
})
})
}
Expand Down
15 changes: 6 additions & 9 deletions build/ssr.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
var rollup = require('rollup')
var buble = require('rollup-plugin-buble')
var async = require('rollup-plugin-async')
var replace = require('rollup-plugin-replace')
var babel = require('@rollup/plugin-babel').default
var replace = require('@rollup/plugin-replace')

rollup
.rollup({
input: 'packages/docsify-server-renderer/index.js',
plugins: [
async(),
replace({
__VERSION__: process.env.VERSION || require('../package.json').version,
'process.env.SSR': true
}),
buble({
transforms: {
generator: false
}
})
babel({
babelHelpers: "bundled",
presets: ['babel-preset-solid']
}),
],
onwarn: function () {}
})
Expand Down
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
// Unit Tests (Jest)
{
...sharedConfig,
preset: 'solid-jest/preset/browser',
displayName: 'unit',
setupFilesAfterEnv: ['<rootDir>/test/config/jest.setup-tests.js'],
testMatch: ['<rootDir>/test/unit/*.test.js'],
Expand All @@ -28,6 +29,7 @@ module.exports = {
// Integration Tests (Jest)
{
...sharedConfig,
preset: 'solid-jest/preset/browser',
displayName: 'integration',
setupFilesAfterEnv: ['<rootDir>/test/config/jest.setup-tests.js'],
testMatch: ['<rootDir>/test/integration/*.test.js'],
Expand Down
Loading