-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Revert "fix: hoist imports on top" #13131
Conversation
This reverts commit 81b32d8.
|
(I'm confused by the original issue, because imports are always hoisted by engines — there must be an unusual build process involved. Rather than making things more complex, the easiest thing to do to address that issue is probably just to revert #13048 as well, because it's not actually doing anything) |
Uh i wonder if it's just a repl bug? |
Mmm actually i can reproduce it with fresh import { createHotContext as __vite__createHotContext } from "/@vite/client";import.meta.hot = __vite__createHotContext("/src/routes/+page.svelte");import "/node_modules/.vite/deps/svelte_internal_disclose-version.js?v=0ec42dc1";
$.mark_module_start();
_page[$.FILENAME] = "src/routes/+page.svelte";
export const b = _.cloneDeep({ f: '' });
import * as $ from "/node_modules/.vite/deps/svelte_internal_client.js?v=0ec42dc1";
import __vite__cjsImport2_lodash from "/node_modules/.vite/deps/lodash.js?v=0ec42dc1";
// this should be an import but it's a const
const _ = __vite__cjsImport2_lodash.__esModule ? __vite__cjsImport2_lodash.default : __vite__cjsImport2_lodash;
function _page($$anchor, $$props) {
$.check_target(new.target);
$.push($$props, false, _page);
$.init();
return $.pop({ ...$.legacy_api() });
}
if (import.meta.hot) {
_page = $.hmr(_page, () => _page[$.HMR].source);
import.meta.hot.acceptExports(["default"],(module) => {
module.default[$.HMR].source = _page[$.HMR].source;
$.set(_page[$.HMR].source, module.default[$.HMR].original);
});
}
export default _page;
$.mark_module_end(_page); |
Regarding the initial pr from @benmccann i think the purpose is to then use those variables in #13075 ...but tbf this almost seems like a |
Ah, the We can work around it (and probably should, since we can't assume everyone will be on the the latest Vite version) but I think just undoing #13082 and #13048 is the most sensible thing to do in the near term — we can apply a workaround when we get round to the work that #13048 was designed to enable. |
Reverts #13082