-
Notifications
You must be signed in to change notification settings - Fork 30
Refactor transform to be isomorphic (Node/web compatibility) #171
Refactor transform to be isomorphic (Node/web compatibility) #171
Commits on Feb 18, 2023
-
Convert
transform
to async/awaitIncludes tests around API stability, as these expectations were all broken in a previous naive attempt at the same change
Configuration menu - View commit details
-
Copy full SHA for e02efa9 - Browse repository at this point
Copy the full SHA e02efa9View commit details
Commits on Feb 19, 2023
-
Initial Node/DOM compatibility
1. Introduces an abstract subset of DOM APIs corresponding to previous usage of semantically equivalent `libxmljs` APIs. It would have been nicer to import these types and export the subset we care about, but this is inconsistent with how TypeScript `lib` works (it always augments the global scope). 2. Provides a Node implementation of those DOM APIs by extending `libxmljs` prototypes. This kind of extension isn't ideal, but it's the most reasonable way to achieve such a compatibility layer without sacrificing performance. An ealirer alternative approach used `WeakMap`s to cross reference the DOM/`libxmljs` interfaces, but this had a significant impact on perf. This implementation is type checked by default. 3. Provides a web implementation by... just exporting the relevant globals. This implementation is type checked by `tsc` using the `tsconfig.web.json` project file. This ensures that the abstract DOM interfaces are actully consistent with the built in DOM `lib` types. 4. Refactors transformer.ts to use the abstract DOM APIs. This uses the Node DOM compatibility implementation by default, and the native web DOM implementation when the environment variable `ENV` is set to "web". 5. Also when `ENV` is web, tests and benchmarks call `transform` in the specified `BROWSER` environment variable (defaulting to "fiefox") via a simple `playwright` bridge. In CI, all tests and benchmarks are run in: Node 14, Node 16, Firefox, Chromium, Webkit. 6. Build is updated to produce both Node and web targets. The build config itself is fairly complex, but it's been consolidated in `vite.config.ts`. This also includes a corresponding change to build `app.ts` rather than the previous, much more complex `app.js` using a Vite dev server (and roughly restores its implementation to what it had been prior to the initial TypeScript migration). 7. There are several known issues at the point of this commit. These either correspond to XSLT extensions not supported by browser targets, or to differences in behavior between DOM/`libxmljs`, all of which will be addressed in separate commits discussing each in greater detail.
Configuration menu - View commit details
-
Copy full SHA for 6242fbe - Browse repository at this point
Copy the full SHA 6242fbeView commit details -
Fix: consistent URL escaping in web environments
This addresses a slight difference between Node's and browsers' respective implementations of `URL`, namely that browsers do not implicitly escape special path characters for unknown schemes (i.e. `jr`). This change is a workaround, temporarily substituting the `jr` scheme to consistently take advantage of built-in escaping behavior, then restoring it for the final return value.
Configuration menu - View commit details
-
Copy full SHA for 916e2e3 - Browse repository at this point
Copy the full SHA 916e2e3View commit details -
Fix: HTML document/"fragment" hierarchy
This addresses: - an inconsistency between how `libxslt` and the native DOM `XSLTProcessor` handle XSLT transforms to HTML.`libxslt` (correctly, IMO) treats the XSLT document's expressed root element as the resulting document element, whereas browsers produce a document with an implicit `html > body > root` structure. - a slight change in `renderMarkdown` which parses to a document rather than a fragment, for the purpose of a simpler DOM compatibiity API in this case. (That call to `correctHTMLDocHierarchy` was mistakenly included in an earlier commit, but I'm hoping this subsequent commit will be clear enough and we'll likely squash these commits anyhow.)
Configuration menu - View commit details
-
Copy full SHA for a0238fe - Browse repository at this point
Copy the full SHA a0238feView commit details -
Configuration menu - View commit details
-
Copy full SHA for cda915a - Browse repository at this point
Copy the full SHA cda915aView commit details -
Remove fatal errors from XSL from unsupported extensions
The functionality depending on them will be reimplemented with DOM APIs
Configuration menu - View commit details
-
Copy full SHA for b46e7b5 - Browse repository at this point
Copy the full SHA b46e7b5View commit details -
Fix: Firefox does not apply templates to attributes
It's possible there are other attribute cases I haven't identified, but these are the ones I was able to find in test failures, snapshot mismatches, and the spec.
Configuration menu - View commit details
-
Copy full SHA for 29a733f - Browse repository at this point
Copy the full SHA 29a733fView commit details -
Fix: dynamic itemset itext translations
These dynamic template calls are now injected into the XSL, allowing us to eliminate the use of `str:replace` and `dyn:evaluate` extensions.
Configuration menu - View commit details
-
Copy full SHA for 4227fe4 - Browse repository at this point
Copy the full SHA 4227fe4View commit details -
Fix: transform appearance classes in transformer.ts
This eliminates the need to use `str:tokenize` extension
Configuration menu - View commit details
-
Copy full SHA for 3d93e1b - Browse repository at this point
Copy the full SHA 3d93e1bView commit details
Commits on Feb 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 538bcfe - Browse repository at this point
Copy the full SHA 538bcfeView commit details -
Web test/benchmark setup refinements
Faster Firefox startup, improved logging
Configuration menu - View commit details
-
Copy full SHA for d9ae798 - Browse repository at this point
Copy the full SHA d9ae798View commit details -
Configuration menu - View commit details
-
Copy full SHA for 97c1513 - Browse repository at this point
Copy the full SHA 97c1513View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a4a1a1 - Browse repository at this point
Copy the full SHA 9a4a1a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c6f898 - Browse repository at this point
Copy the full SHA 5c6f898View commit details -
Configuration menu - View commit details
-
Copy full SHA for fdb904c - Browse repository at this point
Copy the full SHA fdb904cView commit details
Commits on Feb 22, 2023
-
Attempt to report summaries to PR
Also bumps actions versions which have been warning about Node 12 for no apparent reason
Configuration menu - View commit details
-
Copy full SHA for 77eb952 - Browse repository at this point
Copy the full SHA 77eb952View commit details -
Configuration menu - View commit details
-
Copy full SHA for 51595b4 - Browse repository at this point
Copy the full SHA 51595b4View commit details
Commits on Mar 1, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 69109d0 - Browse repository at this point
Copy the full SHA 69109d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 50d2f76 - Browse repository at this point
Copy the full SHA 50d2f76View commit details
Commits on Mar 2, 2023
-
Address initial review feedback
- Update README - Clarify change to URL escaping implementation per initial review feedback
Configuration menu - View commit details
-
Copy full SHA for 13b1e9c - Browse repository at this point
Copy the full SHA 13b1e9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 885eac7 - Browse repository at this point
Copy the full SHA 885eac7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e480bfe - Browse repository at this point
Copy the full SHA e480bfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 671d5c6 - Browse repository at this point
Copy the full SHA 671d5c6View commit details
Commits on Mar 3, 2023
-
- Add demo dev mode (very useful for manual testing during dev) - Actually display errors - Don't show Invalid state on errors
Configuration menu - View commit details
-
Copy full SHA for 6efd980 - Browse repository at this point
Copy the full SHA 6efd980View commit details