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

Support for codesandbox #331

Open
meetzaveri opened this issue Aug 12, 2019 · 12 comments
Open

Support for codesandbox #331

meetzaveri opened this issue Aug 12, 2019 · 12 comments

Comments

@meetzaveri
Copy link

Do you want to request a feature or report a bug?
Actually if there is an existing feature, then how should it be accessed to perform test on codesandbox

What is the current behavior?
Perform testing in codesandbox is an ease way better than running npm server on local machine.

If the current behavior is a bug, please provide the steps to reproduce.
Not sure about if it's a bug

What is the expected behavior?
A way to check bundlesize for particular codesandbox

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information.

  • node version (Codesandbox version)
  • npm version (Codesandbox version)
  • Operating system (Codesandbox Web)
  • bundlesize version (Latest version)
  • CI you are using (None)
@Haroenv
Copy link
Collaborator

Haroenv commented Aug 12, 2019

Can you describe your workflow you have now, and how you'd like to see bundlesize as part of it? I'm not exactly sure what is missing now.

Do you want to see the final bundle size of a site you make on code sandbox which never ends up on GitHub?

@meetzaveri
Copy link
Author

meetzaveri commented Aug 13, 2019

Do you want to see the final bundle size of a site you make on code sandbox which never ends up on GitHub?

Yes I need to see final bundle size of my app in codesandbox. Yeah its not on github nor I have connected it to github.

I have simple App built in codesandbox. After installing bundlesize, I followed steps included in documentation. But that clearly states that if you are building app on local machine as if by doing npm start. But here the scenario is where codesandbox automatically runs scripts for us.

So how to run manual script for bundlesize in codesandbox environment ? Is there a way ? Or I can only perform tests while running server locally ?

@siddharthkp
Copy link
Owner

siddharthkp commented Aug 13, 2019

Ah, I understand your question now. When you're using the default react starter (create-react-app) on codesandbox, you don't have access to the terminal.

I haven't tried this but I think wrapping it in a test might just work (the default starter let's you run tests with jest)

This isn't a core part of bundlesize's capabilities but I'd be keen to find a not-so-annoying workaround that works with online editors like codesandbox and glitch.

@meetzaveri
Copy link
Author

Ah, I understand your question now. When you're using the default react starter (create-react-app) on codesandbox, you don't have access to the terminal.

Yes exactly. I need an interface to run script (CLI probably).

Okay, so let me check wrapping test in jest. Haven't explored a jest yet.

If you want to see sandbox, here's the link - https://codesandbox.io/embed/competent-chaplygin-ir9im

@Haroenv
Copy link
Collaborator

Haroenv commented Aug 13, 2019

Note that codesandbox exclusively works in development mode, and doesn’t have an option to run in production mode, unless deployed to now or netlify. Where and when do you want to see the bundlesize output preferably ?

@meetzaveri
Copy link
Author

meetzaveri commented Aug 13, 2019 via email

@siddharthkp
Copy link
Owner

Specifically in development mode

That's probably not what you'd want to measure? The dev build has a bunch of things that you wouldn't ship to users, so the size of that bundle isn't very useful

@meetzaveri
Copy link
Author

Yeah you're right. I got into misconception. Actually I need to check it into production mode. But is it necessary that I can only check it into production mode ? Can I aswell check into dev mode ?

@siddharthkp
Copy link
Owner

But is it necessary that I can only check it into production mode ? Can I aswell check into dev mode ?

bundlesize doesn't care as long as there is a persistent file, but again, I don't think that's of any use

@meetzaveri
Copy link
Author

Okay agreed. So what steps should I perform to check bundlesize for prod build in codesandbox ?

@Haroenv
Copy link
Collaborator

Haroenv commented Aug 13, 2019

My point earlier was that, codesandbox does not make a prod build, and thus it might not make sense to measure the output size there at all

@meetzaveri
Copy link
Author

Okay. So it's like outer from scope of bundlesize capabilities ?

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

No branches or pull requests

3 participants