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

feat(html-to-slate-ast): add htmlToSlateASTSync function #115

Merged
merged 16 commits into from
Dec 6, 2023

Conversation

jpedroschmitz
Copy link
Contributor

It adds htmlToSlateASTSync, which doesn't depend on jsdom and will work exclusively on the browser environment.

Copy link

changeset-bot bot commented Dec 4, 2023

⚠️ No Changeset found

Latest commit: ad143ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mahaveer0496
Copy link
Member

mahaveer0496 commented Dec 5, 2023

How about adding a browser file that exports this instead – like react-dom/server is only for server – to make it more explicit? cuz reading htmlToSlateASTSync doesn't convey that it's browser exclusive.

@jpedroschmitz jpedroschmitz marked this pull request as draft December 5, 2023 18:46
@jpedroschmitz
Copy link
Contributor Author

How about adding a browser file that exports this instead – like react-dom/server is only for server – to make it more explicit? cuz reading htmlToSlateASTSync doesn't convey that it's browser exclusive.

I tried to make it work like this, but no luck. When using exports it works, but then breaks TypeScript in the application unless I change the tsconfig moduleResolution to nodenext, which then breaks a bunch of other things 🫠

@jpedroschmitz
Copy link
Contributor Author

I'll export everything from the root as there are no errors on the server for polyfilling jsdom functions now.

@jpedroschmitz jpedroschmitz marked this pull request as ready for review December 5, 2023 20:33
Copy link
Contributor

@anmolarora1 anmolarora1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @jpedroschmitz 👏
Do you think we should document the problem with the existing bundler and how migrating to tsup solved it? Perhaps it could be useful for internal docs 🙂

@jpedroschmitz jpedroschmitz merged commit 232e4da into main Dec 6, 2023
3 checks passed
@jpedroschmitz jpedroschmitz deleted the add-new-function-to-html-slate branch December 6, 2023 14:18
@jpedroschmitz
Copy link
Contributor Author

Sounds great. I'll document this internally and create a ticket so we can move away from tsdx completely. @anmolarora1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants