babel-plugin-superjson-next icon indicating copy to clipboard operation
babel-plugin-superjson-next copied to clipboard

[draft] feat: Allow props to be exported from other files

Open alii opened this issue 3 years ago • 11 comments

Fixes #121 and allows for props to exported in the following manner

export {getStaticProps} from '../props';

export default function Page(props) {
	// ...
}

alii avatar Apr 01 '22 10:04 alii

Okay so, the test is passing at this point so just wanted to ask for any feedback, maybe we could implement some more test cases?

cc @Skn0tt @flybayer

alii avatar Apr 04 '22 15:04 alii

@alii thanks a lot for working on this! There's a lot of changes unrelated to the original issue, that's making it hard for me to review. Can I ask you to revert the import changes you made, so this PR is more contained? That'd give me the confidence that I'm not missing anything while reviewing.

Skn0tt avatar Apr 06 '22 10:04 Skn0tt

@Skn0tt The import changes were due to a type mismatch between @babel/core and @babel/types — they're the same functionally just without having conflicting types (for whatever reason that was). I can revert the imports but it will leave a few anys and things lying around.

alii avatar Apr 06 '22 18:04 alii

Interesting! Yeah, reverting would be nice.

Skn0tt avatar Apr 08 '22 12:04 Skn0tt

I'll look at that type mismatch separately, that sounds interesting

Skn0tt avatar Apr 08 '22 12:04 Skn0tt

@Skn0tt do you need some help with this one? I would love to see it merged!

apieceofbart avatar Sep 19 '22 08:09 apieceofbart

@apieceofbart this PR contains a lot of unrelated changes, which is why I'm not moving forward with it. if you want to work on it, I think it'd be best to open a new PR :)

Skn0tt avatar Sep 19 '22 08:09 Skn0tt

@apieceofbart this PR contains a lot of unrelated changes, which is why I'm not moving forward with it. if you want to work on it, I think it'd be best to open a new PR :)

cool, yeah, I'll give it a try especially that a lot of code is already written :)

apieceofbart avatar Sep 19 '22 10:09 apieceofbart

Ohh I'm really sorry haha, I'm not sure why I never completed this. I think I did have the changes locally but didn't push for some reason. Happy to help as well @apieceofbart if you need a hand. :D

alii avatar Sep 19 '22 21:09 alii

@alii I only checked briefly yesterday - tried to be smart and copy your code but without the type changes part. Unfortunately when I did this there were a couple of TS errors.

What is weird is that when I open index.ts without any changes I get error in vscode here and here: Argument of type 'Identifier' is not assignable to parameter of type 'Expression | V8IntrinsicIdentifier'. However running tsc from code line is fine. This is not a big deal but a bit annoying since when working on the code you don't know which errors are "real".

apieceofbart avatar Sep 20 '22 07:09 apieceofbart

I think that was the reason I ended up updating all of the dependencies in my branch, because there were a lot of type mismatches between them. @apieceofbart

iirc, the things I deps I moved around here fixed those issues

alii avatar Sep 20 '22 12:09 alii