-
Notifications
You must be signed in to change notification settings - Fork 47
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
refactor: split languages/clients into packages #92
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sliphq/run-wasm/FGfU6SSmqBvvtYJfA3DL6fv5jy28 [Deployment for 3734578 failed] |
In order to get deploy previews working, you'll have to prepare the other packages, THEN install the demo app. here's the vercel override install command I used Example: https://run-wasm-wheat.vercel.app/ |
@kennethcassel and I chatted -
|
Instead of using this naming convention - |
Totally, I think there's a couple ways. I heard |
Yeah I like this naming convention. Using @run-wasm instead of @slip is preferred. It's not unlikely that we will end up rebranding Slip to another name in the future. |
Awesome work @cameronmoreau! Got the vercel build preview working, but looks like the jest tests are failing now |
I agree! I like this naming convention too. Plus, it's unlikely you'd be able to get |
Hmm...the tests can't run because the $ tsc
src/index.tsx(2,19): error TS2307: Cannot find module 'react' or its corresponding type declarations.
src/index.tsx(20,5): error TS2503: Cannot find namespace 'JSX'.
src/index.tsx(20,5): error TS4060: Return type of exported function has or is using private name 'JSX'.
src/index.tsx(22,5): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
src/index.tsx(25,7): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
src/index.tsx(25,19): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
src/index.tsx(26,5): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. Maybe there's an error in the tsconfig? There's an example here |
Love it, what about the main package though? @kennethcassel lmk and I'll update all the package names
@kennethcassel oops, nice catch. Think I fixed tests. Although I can't figure out how to get them to run in this pr 🤔 Only Vercel deploy is triggered. @jsjoeio are you running
Running Hope this helps. Checkout lerna commands and this example for more info. |
Option 2 is good I think, but yeah naming is hard lol 😅 |
I had to approve and run the tests, actions require maintainer approval for first time contributors |
Thanks for the detailed response! Just check types I guess? We were just using |
Getting this issue on the vercel build
|
@kennethcassel did some digging and for some reason once adding the Even more odd because TLDR; update the build command (one last time) to - pushd ../ && pwd && yarn && yarn bootstrap --no-ci && yarn build && popd && yarn |
@cameronmoreau is this helpful? Wish I had more experience with Lerna to help. Or could it be that you're mixing |
Trying to test after updating the command but vercel builds are degraded right now! https://www.vercel-status.com/incidents/dtmzmybbbzyh Will test soon :) hoping to get this one merged in soon! Thanks for all the work @cameronmoreau 🎉 |
@all-contributors please add @cameronmoreau for code contributions :) |
I've put up a pull request to add @cameronmoreau! 🎉 |
Saw @zackradisic's comment about splitting up the packages from this project and figured I'd drop a proof-of-concept.
Intro
I think it's a great idea to split up the packages, especially since it looks like each language has a different set of dependencies, and the separation would be easier to maintain.
This splits into two parts:
A great example of a project that does this is Expo. Check out the packages folder specifically.
Lerna is a great tool to accomplish this, and I've used it in the past for previous large mono-repo package styles projects. For those new to the tool, here's a great example.
Demo
cd run-wasm
yarn
yarn bootstrap
This will install/build all packagescd example-nextjs
yarn
You may need to npm link each package if you're having troubleyarn dev
See the project works with split packages! 🙌 🎉
What's next
It looks like each client uses the following, but not sure if
loadPackages
or abootstrap
should be included.Also curious on folk's opinion for exporting since the example used is
not