Skip to content

feat(web): add basic setup#491

Open
pkaramon wants to merge 10 commits intomainfrom
@pkaramon/web-setup
Open

feat(web): add basic setup#491
pkaramon wants to merge 10 commits intomainfrom
@pkaramon/web-setup

Conversation

@pkaramon
Copy link
Collaborator

@pkaramon pkaramon commented Mar 18, 2026

Summary

Explain the motivation for making this change: here are some points to help you:

  • Basic web setup for the library and example app, intended for internal use only for now
  • Currently the code related to web is not exported to npm
  • Added web entry + minimal web EnrichedTextInput stub to unblock web integration work.
  • Wired example-web app to the EnrichedTextInput for the web
  • index.native.tsx entrypoint for android/ios, index.tsx entrypoint for the web

Test Plan

  • Run example-web app, make sure a textarea with "Hello from web!" appears.
  • Check that example app still builds for android and ios

Screenshots / Videos

image ## Compatibility
OS Implemented
iOS
Android
Web

@pkaramon pkaramon force-pushed the @pkaramon/web-setup branch from 959e349 to a3444c5 Compare March 18, 2026 11:53
@pkaramon pkaramon force-pushed the @pkaramon/web-setup branch from a3444c5 to c9d4f52 Compare March 18, 2026 14:17
EnrichedTextInputInstance,
} from '../types';

export interface EnrichedTextInputProps extends BaseEnrichedTextInputProps {}
Copy link
Collaborator Author

@pkaramon pkaramon Mar 18, 2026

Choose a reason for hiding this comment

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

I will try to keep the types as close as possible between native and web, but I think we will have to make at least so tiny modifications for example the style?: ViewStyle | TextStyle will need changing on web to CSSProperties.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can have only definition of types and they have to be exactly the same for both plaforms (even if some props on one platform will be no-op)

Comment on lines +28 to +35
"!src/web",
"!src/index.tsx",
"!lib/module/web",
"!lib/module/index.js",
"!lib/module/index.js.map",
"!lib/typescript/src/web",
"!lib/typescript/src/index.d.ts",
"!lib/typescript/src/index.d.ts.map",
Copy link
Collaborator Author

@pkaramon pkaramon Mar 18, 2026

Choose a reason for hiding this comment

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

I think it would be a good idea to keep the web code hidden until it's at least semi-functional. @exploIF @kacperzolkiewski curious what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good to me!
But it is a little inconsistent to me that we point to excluded files here:

  "exports": {
    ".": {
      "react-native": {
        "types": "./lib/typescript/src/index.native.d.ts",
        "default": "./lib/module/index.native.js"
      },
      "types": "./lib/typescript/src/index.d.ts",
      "default": "./lib/module/index.js"
    }, 

@pkaramon pkaramon marked this pull request as ready for review March 19, 2026 09:09
@pkaramon pkaramon requested review from exploIF and kacperzolkiewski and removed request for exploIF and kacperzolkiewski March 19, 2026 09:09
Copy link
Collaborator

@exploIF exploIF left a comment

Choose a reason for hiding this comment

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

This looks really good! Couple tiny comments and we should be ready to go

EnrichedTextInputInstance,
} from '../types';

export interface EnrichedTextInputProps extends BaseEnrichedTextInputProps {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can have only definition of types and they have to be exactly the same for both plaforms (even if some props on one platform will be no-op)

*/
useHtmlNormalizer?: boolean;
}
export interface EnrichedTextInputProps extends BaseEnrichedTextInputProps {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's redundant. We should have single types definition (but some props can be no-op)

@@ -1,4 +1,5 @@
export * from './EnrichedTextInput';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Until we don't have fully functional web, I would keep mobile implementation in index file and web implementation inside index.web. Once web is ready to be published we will rename it to index and index.native. I think it's more safe, I remember that some setups might fail if there is no regular index file.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants