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

Improve local development (v3) #275

Merged
merged 20 commits into from
Dec 6, 2022
Merged

Improve local development (v3) #275

merged 20 commits into from
Dec 6, 2022

Conversation

frandiox
Copy link
Contributor

@frandiox frandiox commented Dec 1, 2022

Few magic things happening here:

  • Remove the development bundle for hydrogen-remix/build since we only use the production one.
  • Use tsup instead of tsc to build the CLI, which allows us to add the CLI to Turbo watched packages without a weird flickering in the terminal.
  • Speed up npm run build times by skipping demo-store build when not needed, and some other generated stuff.
  • Support copying a JS version of .hydrogen in JS projects. Limitation: files don't include JSX (they are compiled). I'm trying to figure out why the jsx: "preserve" option in TS doesn't work. (I've figured it out)
  • Public files (<root>/public/*) are now watched and live-reloaded.
  • Fix types in hydrogen-remix/src/templates.
  • Reload the app when modifying hydrogen-remix/src/templates in local development (requested by @juanpprieto ).
  • Reload the app when remix.config.js is modified, so that changing our own options like includeCart: false in hydrogenRoutes reload stuff. cc @blittle

For 🎩 :

  • npm run clean-all && npm i. Then, npm run dev at the top and check that the app is working.
  • Change remix.config.js to add a console.log. It should reload and print it.
  • Change anything in packages/hydrogen-remix/src/templates. It should reload properly.
  • Rename demo-store/tsconfig.json to demo-store/jsconfig.json and restart npm run dev. It should copy .jsx files to demo-store/.hydrogen instead of .tsx.

@frandiox frandiox requested a review from blittle December 1, 2022 07:52
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run npm run changeset add to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.

@caution-tape-bot
Copy link

👋 It seems that this PR is adding a GitHub Action workflow that looks a lot like a CI step.

CI should generally be handled with Shopify Build pipelines, and GitHub Actions should be used for GitHub automation and package publishing.

If this workflow change is not introducing a CI step, then feel free to ignore this comment.

For more details and explanation, click to expand...

GitHub Actions are generally intended for GitHub, Project or Repository-related automation, or for public package and library publishing. You can learn more about the supported use cases in our GitHub Actions documentation.

If your Action is a CI step, please migrate to shopify-build instead. If you have any questions about how to setup a shopify-build pipeline, don't hesitate to ask them in #help-eng-infrastructure.

Note that this message is based on a simple regex detection, and may not always be accurate. If your action is not a CI step, and is already running on shopify-ubuntu-latest or similar, feel free to ignore this message.

If your repository is intended to become Public later, please use runs-on: shopify-ubuntu-latest for now and ignore the rest of this comment. If you think this workflow has been mistakenly labeled as a CI step, please let us know by commenting your reasons below.

View the source of this rule in Services DB

@frandiox frandiox changed the title Simplify build for hydrogen-remix/build Improve local development (v3) Dec 2, 2022
@juanpprieto
Copy link
Contributor

Amazing fran 🎩 was 💯

@frandiox
Copy link
Contributor Author

frandiox commented Dec 6, 2022

Since it's been top-hatted already and this PR is mostly fixing local dev/build, I'm going to merge this before we get more conflicts.

Feel free to leave comments and I will address them in another PR 👍

@frandiox frandiox merged commit 62abe45 into v0.x-2022-10 Dec 6, 2022
@frandiox frandiox deleted the fd-build-refactor branch December 6, 2022 11:03
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.

2 participants