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

feat: change yarn dev to use gulp #93

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

noname0310
Copy link
Collaborator

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the main branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • All tests are passing
  • New/updated tests are included

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

  • Since the bug in ts-macros has been fixed, it is now possible to hot reload with gulp So I changed the yarn dev.
    [BUG] error when build twice GoogleFeud/ts-macros#15

  • Results built through yarn dev are now identical to cjs builds, excluding source maps.

  • The hot reload is a little slow because we are currently using the babel and terser.
    If you want a faster hot reload, you can also exclude it from dev mode.
    However, there will be a slight difference between the results from dev mode and the build results.

  • Builds in dev mode are now created in dist/dev.

@noname0310 noname0310 changed the title feat: change dev hot reload to use gulp feat: change yarn dev to use gulp Oct 27, 2022
@coveralls
Copy link
Collaborator

coveralls commented Oct 27, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling 62b6815 on noname0310:fix/update-ts-macro into 7a28c07 on js-sdsl:dev.

@noname0310 noname0310 self-assigned this Oct 27, 2022
@ZLY201
Copy link
Member

ZLY201 commented Oct 27, 2022

Does yarn dev run quickly?

@noname0310
Copy link
Collaborator Author

Does yarn dev run quickly?

It takes longer than before, but now the dev build is the same as the production build result.

And you wanted to get rid of tsconfig.dev.json and build it the same way

function build() {
return gulpFactory(
{ globs: 'src/**/*.ts' },
'dist/dev',
Copy link
Member

Choose a reason for hiding this comment

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

'dist/cjs'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okay

gulpfile.ts Outdated Show resolved Hide resolved
gulpfile.ts Show resolved Hide resolved
@noname0310
Copy link
Collaborator Author

noname0310 commented Oct 27, 2022

I just tried building with minimal code except for babel and terser, and it came out in 13 seconds.
I think it must take more than 12 seconds to hot load with gulp typescript.

it takes 12~13 seconds on hot reload:

const project = gulpTs.createProject('tsconfig.json');

gulp.task('build', () => {
  return gulp.src('src/**/*.ts', { base: 'src' })
    .pipe(project())
    .pipe(gulp.dest('dist'));
});

gulp.task('watch',
  gulp.series(
    'ts',
    function watch() {
      return gulp.watch('src/**/*.ts', gulp.series('build'));
    }
  )
);

https://github.com/ivogabe/gulp-typescript#incremental-compilation

@noname0310
Copy link
Collaborator Author

It seems better to update ts-macro. By the way, if you don't like slow gulp hot reload, I'll rollback gulp dev build

@ZLY201
Copy link
Member

ZLY201 commented Oct 27, 2022

It seems better to update ts-macro. By the way, if you don't like slow gulp hot reload, I'll rollback gulp dev build

It's ok, the dev mode should be as consistent as possible with thebuildmode.

But we also should try to reduce the complie time.

@noname0310
Copy link
Collaborator Author

It seems better to update ts-macro. By the way, if you don't like slow gulp hot reload, I'll rollback gulp dev build

It's ok, the dev mode should be as consistent as possible with thebuildmode.

But we also should try to reduce the complie time.

okay, I'll find a way to speed up the typescript hot reload

Then, I will prioritize umd build support I think it will take more time to improve the hot reload time

@ZLY201
Copy link
Member

ZLY201 commented Oct 27, 2022

It seems better to update ts-macro. By the way, if you don't like slow gulp hot reload, I'll rollback gulp dev build

It's ok, the dev mode should be as consistent as possible with thebuildmode.
But we also should try to reduce the complie time.

okay, I'll find a way to speed up the typescript hot reload

Then, I will prioritize umd build support I think it will take more time to improve the hot reload time

That's ok.

@noname0310 noname0310 mentioned this pull request Oct 29, 2022
6 tasks
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

3 participants