feat: separating non-react specific utils and type definitions into it's own package.#2751
Open
ValeryG wants to merge 12 commits into
Open
feat: separating non-react specific utils and type definitions into it's own package.#2751ValeryG wants to merge 12 commits into
ValeryG wants to merge 12 commits into
Conversation
✅ Deploy Preview for stoplight-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for stoplight-elements-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
… this package is not yet build - ci steps will faill attempting to find it without building
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Separation of presentation and helper code
Both
elementsandelements-coreare presentation level specific. They depend on react and their bundles they publish have client side polyfills and references to document/window and globalThis. This makes it hard to use code exported from those packages to be used in non-react or ssr running projects.And there is an excellent code. Eg:
http-specis producing AST, but the layer that creates TableOfContent structure is backed into presentation package.So the idea of this PR is to introduce new package,
elements-utilsmake it be presentation framework agnostic (no dependency on react, no browser specific code in the bundle), and move the implementation described above into this package. So essentially make it a helper on top ofhttp-spec, and keepelementsandelements-corehold presentation level.CONTRIBUTING.mdOther Available PR Templates:
CONTRIBUTING.mdTODO:
as new package
@stoplight/elements-utlsis not published, there are some temperately changes introduced to prevent CI from failing. Those changes needed to be rolled back after package is published: