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

Webpack refactor #50

Draft
wants to merge 81 commits into
base: master
Choose a base branch
from
Draft

Webpack refactor #50

wants to merge 81 commits into from

Conversation

j4k0xb
Copy link
Owner

@j4k0xb j4k0xb commented Jan 13, 2024

closes #6
closes #30
closes #33
closes #66
closes #68

supersedes #31

@mochaaP
Copy link

mochaaP commented Jan 13, 2024

Should also strip the __esModule property? This still got emitted currently:

Object.defineProperty(exports, "__esModule", {
  value: true
});

@mochaaP
Copy link

mochaaP commented Jan 13, 2024

Also, these JSON imports and external imports weren't resolved as they should? They still emit a .js file instead of .json or inlining the import
image

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 13, 2024

Should also strip the __esModule property? This still got emitted currently:

Done

Also, these JSON imports and external imports weren't resolved as they should? They still emit a .js file instead of .json or inlining the import

emitting .json is now also implemented
externals are properly resolved (by ignoring) but not inlined yet

@mochaaP
Copy link

mochaaP commented Jan 13, 2024

also, export statements aren't transformed.
they are firstly all initialized within a single VariableAssignment to undefined, then get assigned the actual value later.

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 13, 2024

thats specific to typescript: https://www.typescriptlang.org/play?module=1#code/KYDwDg9gTgLgBAG2PAhnAvHAjAbiA
this PR is mostly about fixing the webpack issues themselves but it could be implemented later

@mochaaP
Copy link

mochaaP commented Jan 13, 2024

acked

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 15, 2024

Externals are inlined now:

// 0: module.exports = require("worker_threads");
// 1: var tmp = __webpack_require__(0); ...
// 1 gets changed to:
import { MessageChannel, parentPort, Worker, workerData } from "worker_threads";

And import/export paths are properly resolved again for existing modules:
import * as json from "./1.json"; instead of import * as json from "1";

@mochaaP
Copy link

mochaaP commented Jan 28, 2024

🤔 is anything still blocking this pr?

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 28, 2024

yeah there are a couple issues like creating multiple conflicting import { a } from
didn't have much time recently to work on it

@mochaaP
Copy link

mochaaP commented Jan 28, 2024

👌

@mochaaP
Copy link

mochaaP commented Jan 28, 2024

yeah there are a couple issues like creating multiple conflicting import { a } from didn't have much time recently to work on it

my few cents: generate names like import { a as a$chunkId$ } from './chunkId.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants