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

chore(build): improved build tools #981

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

hardfist
Copy link
Contributor

@hardfist hardfist commented Apr 4, 2021

I try to resolve the following problems of build tools

  • sourcemap verify
  • watch support
  • extract error message
  • ...

@netlify
Copy link

netlify bot commented Apr 4, 2021

Deploy preview for redux-starter-kit-docs ready!

Built with commit 8358c0c

https://deploy-preview-981--redux-starter-kit-docs.netlify.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 4, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8358c0c:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration

@markerikson markerikson changed the title chore(build): improved build toos chore(build): improved build tools Apr 4, 2021
Copy link
Collaborator

@markerikson markerikson left a comment

Choose a reason for hiding this comment

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

So what is the actual net effect of these changes besides converting the build file to TS?

target: 'es2017',
format: 'cjs',
})
mod._compile(code, filename)
Copy link
Collaborator

Choose a reason for hiding this comment

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

💬 hah, is this basically a homegrown ts-node using ESBuild? Nice :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but much faster than ts-node

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There will be some complex logic, and I'm not comfortable with JS so I convert build file to TS

@hardfist
Copy link
Contributor Author

hardfist commented Apr 4, 2021

@markerikson I think umd production sourcemap problem should be fixed now

@hardfist hardfist marked this pull request as draft April 4, 2021 15:54
@hardfist hardfist force-pushed the build-tools branch 2 times, most recently from d25c83a to f20b18c Compare April 4, 2021 16:03
@hardfist hardfist marked this pull request as ready for review April 4, 2021 16:10
@hardfist
Copy link
Contributor Author

hardfist commented Apr 4, 2021

CI is green now, I may leave watch to another PR(I don't know whether you need the watch functionality since you already have tsdx watch)

@markerikson
Copy link
Collaborator

Spent the evening playing around with the existing build.js trying to get it to spit out bundles for the new /query and /query/react entry points, and got it mostly working:

image

image

However, I don't have any of the changes that you put in here. I'm going to repoint this to v1.6-integration, and then merge it so I've got this to use as a baseline. Thanks!

@markerikson markerikson changed the base branch from master to feature/v1.6-integration April 20, 2021 03:45
@markerikson markerikson merged commit 56a3c9a into reduxjs:feature/v1.6-integration Apr 20, 2021
@markerikson
Copy link
Collaborator

Hey @hardfist . Now that I've merged this and am trying it out, I'm very confused by what's going on with the sourcemap stuff. Is some of this experimental / debug? What's it supposed to be doing?

@hardfist
Copy link
Contributor Author

Hey @hardfist . Now that I've merged this and am trying it out, I'm very confused by what's going on with the sourcemap stuff. Is some of this experimental / debug? What's it supposed to be doing?

somthing wrong with sourcemap?

@markerikson
Copy link
Collaborator

I'm just trying to understand what these lines are doing:

https://github.com/hardfist/redux-toolkit/blob/8358c0cf3fab3d21812571a1794d5865ee97bd6c/scripts/build.ts#L110-L139

it seems like it's debug code or something - why are we running asserts in the middle of a build script?

@hardfist
Copy link
Contributor Author

I'm just trying to understand what these lines are doing:

https://github.com/hardfist/redux-toolkit/blob/8358c0cf3fab3d21812571a1794d5865ee97bd6c/scripts/build.ts#L110-L139

it seems like it's debug code or something - why are we running asserts in the middle of a build script?

It's kind of test to make sure the we can use the generated sourcemap to recover location from bundle to origin sourcefile, maybe it should be put into an separate test file.

@markerikson
Copy link
Collaborator

If it's not related to actual functionality, yeah.

FYI, I've got build.ts heavily modified on my local branch right now to support generating bundles for all three entry points (RTK, RTK-Query core, RTK-Query + React). I'm hoping to at least put up a draft PR with that by tomorrow if not tonight, so probably best to hold off on any PRs that modify that 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.

None yet

2 participants