Skip to content

Remove JSPool package#1026

Open
jasonsummers wants to merge 2 commits intostatiqdev:mainfrom
jasonsummers:remove-jspool-package
Open

Remove JSPool package#1026
jasonsummers wants to merge 2 commits intostatiqdev:mainfrom
jasonsummers:remove-jspool-package

Conversation

@jasonsummers
Copy link
Contributor

Summary

BREAKING CHANGE: GetJavaScriptEnginePool in IExecutionContext has been removed and replaced by GetJavaScriptEngine which returns a single IJavaScriptEngine instead of a pool.

Changes

  • GetJavaScriptEnginePoolinIExecutionContexthas been removed and replaced byGetJavaScriptEnginewhich returns a singleIJavaScriptEngine`.
  • All classes which implement IExecutionContext have been updated.
  • The GetJavaScriptEngine method retains an Action<IJavaScriptEngine> parameter to enable engine configuration.
  • The HighlightCode extension has been refactored to retain the behaviour that each call to HighlightCode.HighlightElement uses a clean JavaScript Engine.

BREAKING: GetJavaScriptEnginePool signature in IExecutionState.cs changed as follows:
- renamed to GetJavaScriptEngine
- All parameters removed and replaced with a single Action<IJavaScriptEngine> parameter which is used to configure the engine.

- removes the JSPool package from Statiq.Core.csproj.
- bumps JavaScriptEngineSwitcher packages to latest versions.
- removes all classes related to JavaScript Engine Pooling.
- updates consuming code in the Statiq.Highlight extension.
…pt Engine.

Under the previous Pooled model of JavaScript Engine provision, each call to the `HighlightCode.HighlightElement` function would retrieve a 'clean' JavaScript engine from the pool.

Given that JavaScript Engines cannot be reset this change ensures that the previous behavior of consuming a fresh JavaScript Engine for every call to the `HighlightCode.HighlightElement` function is preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Refactor provision of JavaScript engines to ExecutionContext

1 participant