This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Refactor transform to be isomorphic (Node/web compatibility) #171
Merged
lognaturel
merged 24 commits into
enketo:master
from
eyelidlessness:refactor/dom-compat
Mar 15, 2023
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e02efa9
Convert `transform` to async/await
eyelidlessness 6242fbe
Initial Node/DOM compatibility
eyelidlessness 916e2e3
Fix: consistent URL escaping in web environments
eyelidlessness a0238fe
Fix: HTML document/"fragment" hierarchy
eyelidlessness cda915a
Fix: namespaces on instance root nodes
eyelidlessness b46e7b5
Remove fatal errors from XSL from unsupported extensions
eyelidlessness 29a733f
Fix: Firefox does not apply templates to attributes
eyelidlessness 4227fe4
Fix: dynamic itemset itext translations
eyelidlessness 3d93e1b
Fix: transform appearance classes in transformer.ts
eyelidlessness 538bcfe
Add web demo
eyelidlessness d9ae798
Web test/benchmark setup refinements
eyelidlessness 97c1513
Update README with web details
eyelidlessness 9a4a1a1
Fix build/test in CI, improve types somewhat
eyelidlessness 5c6f898
Fix: bundle for web, preserve modules for Node
eyelidlessness fdb904c
Move redundant config stuff to shared module again
eyelidlessness 77eb952
Attempt to report summaries to PR
eyelidlessness 51595b4
GitHub does not allow forks to write PR comments at all
eyelidlessness 69109d0
Fix build paths (hopefully for good this time!)
eyelidlessness 50d2f76
Don't show "Transforming..." in demo when not transforming
eyelidlessness 13b1e9c
Address initial review feedback
eyelidlessness 885eac7
Fix: isolation of global DOM types
eyelidlessness e480bfe
Process itemset itext labels in XForm doc, rather than injecting temp…
eyelidlessness 671d5c6
Use single node XPath where appropriate
eyelidlessness 6efd980
Demo tweaks
eyelidlessness File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ Thumbs.db | |
test-coverage | ||
coverage.shield.badge.md | ||
dist | ||
.benchmarks.md |
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 |
---|---|---|
@@ -1,63 +1 @@ | ||
// @ts-check | ||
|
||
import { createServer } from 'vite'; | ||
import { VitePluginNode } from 'vite-plugin-node'; | ||
import { | ||
config, | ||
external, | ||
resolvePath, | ||
rootDir, | ||
} from './config/build.shared.js'; | ||
|
||
const appPath = resolvePath('./app.ts'); | ||
|
||
const init = async () => { | ||
/** @type {import('vite').UserConfig} */ | ||
const baseOptions = { | ||
mode: 'development', | ||
build: { | ||
rollupOptions: { | ||
external, | ||
}, | ||
}, | ||
optimizeDeps: { | ||
disabled: true, | ||
}, | ||
root: rootDir, | ||
ssr: { | ||
target: 'node', | ||
}, | ||
}; | ||
|
||
const servers = await Promise.all([ | ||
createServer({ | ||
...baseOptions, | ||
configFile: false, | ||
plugins: VitePluginNode({ | ||
adapter: 'express', | ||
appPath, | ||
exportName: 'app', | ||
tsCompiler: 'esbuild', | ||
}), | ||
server: { | ||
port: config.port, | ||
}, | ||
}), | ||
createServer({ | ||
...baseOptions, | ||
configFile: false, | ||
publicDir: resolvePath('./test/forms'), | ||
server: { | ||
port: 8081, | ||
}, | ||
}), | ||
]); | ||
|
||
await Promise.all(servers.map((server) => server.listen())); | ||
|
||
servers.forEach((server) => { | ||
server.printUrls(); | ||
}); | ||
}; | ||
|
||
init(); | ||
import './dist/enketo-transformer/app.cjs'; |
This file was deleted.
Oops, something went wrong.
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.
"with deprecated content" -> "with preprocessed content"?
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.
custom content? I don't think "deprecated" is right but I'm not entirely sure of the intent!
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.
This relates to test that use
preprocess
and show an example of continuing to support deprecated form features. Remove the "what it's used for" part and just recommend doing any XForms preprocessing externally.